Skip to content

Commit

Permalink
add d3blocks to setup with minimum version for interactive plots
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Mar 16, 2024
1 parent bbd82b0 commit b912d02
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
14 changes: 9 additions & 5 deletions bnlearn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

__author__ = 'Erdogan Tasksen'
__email__ = '[email protected]'
__version__ = '0.8.4'
__version__ = '0.8.5'

import pgmpy
# Check version pgmpy
Expand All @@ -48,19 +48,23 @@
# Version check
import matplotlib
if not version.parse(matplotlib.__version__) >= version.parse("3.3.4"):
raise ImportError('[bnlearn] >Error: Matplotlib version should be >= v3.3.4.\nTry to: pip install -U matplotlib')
raise ImportError('[bnlearn] >Error: Matplotlib version should be >= v3.3.4\nTry to: pip install -U matplotlib')

import networkx as nx
if not version.parse(nx.__version__) >= version.parse("2.7.1"):
raise ImportError('[bnlearn] >Error: networkx version should be > 2.7.1.\nTry to: pip install -U networkx')
raise ImportError('[bnlearn] >Error: networkx version should be > 2.7.1\nTry to: pip install -U networkx')

import numpy as np
if not version.parse(np.__version__) >= version.parse("1.24.1"):
raise ImportError('[bnlearn] >Error: numpy version should be > 1.24.1.\nTry to: pip install -U numpy')
raise ImportError('[bnlearn] >Error: numpy version should be > 1.24.1\nTry to: pip install -U numpy')

import pandas as pd
if not version.parse(pd.__version__) <= version.parse("1.5.3"):
raise ImportError('[bnlearn] >Error: pands version should be <= 1.5.3.')
raise ImportError('[bnlearn] >Error: pands version should be <= 1.5.3')

import d3blocks as d3
if not version.parse(d3.__version__) <= version.parse("1.4.9"):

This comment has been minimized.

Copy link
@braceletboy

braceletboy Apr 9, 2024

I think this should be
if not version.parse(d3.__version__) >= version.parse("1.4.9"):

I am getting an error when I am running the bnlearn package.

raise ImportError('[bnlearn] >Error: d3blocks version should be >= 1.4.9')

# module level doc-string
__doc__ = """
Expand Down
6 changes: 3 additions & 3 deletions bnlearn/examples.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import bnlearn as bn
# Load asia DAG
model_true = bn.import_DAG('asia')
model = bn.import_DAG('asia')
# plot ground truth
G = bn.plot(model_true)
G = bn.plot(model)

Gi = bn.plot(model_true, interactive=True)
Gi = bn.plot(model, interactive=True)

# %% issue plot static vs dynamic is different
import bnlearn as bn
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ networkx>='2.7.1'
matplotlib>='3.3.4'
numpy>='1.24.1'
pandas==1.5.3
d3blocks>='1.4.9'
tqdm
ismember
scikit-learn
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"matplotlib>=3.3.4",
"numpy>=1.24.1",
'pandas==1.5.3',
'd3blocks>=1.4.9',
'tqdm',
'ismember',
'scikit-learn',
Expand Down

0 comments on commit b912d02

Please sign in to comment.