Skip to content

Commit

Permalink
Fix cyclical import of plots (mckinsey#152)
Browse files Browse the repository at this point in the history
Co-authored-by: philip_pilgerstorfer <philip.pilgerstorfer!@quantumblack.com>
  • Loading branch information
qbphilip and philip_pilgerstorfer authored Apr 12, 2021
1 parent 0ed3bdc commit 88f23cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
exclude: ^causalnex/ebaybbn

- repo: https://github.com/psf/black
rev: stable
rev: 20.8b1
hooks:
- id: black

Expand Down
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Upcoming release

* Fixes cyclical import of `causalnex.plots`, as per #106.

# Release 0.9.2
* Remove Boston housing dataset from "sklearn tutorial", see #91 for more information.
* Update pylint version to 2.7
Expand Down
8 changes: 3 additions & 5 deletions causalnex/plots/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@

import networkx as nx

from causalnex.structure.structuremodel import StructureModel


def plot_structure(
sm: StructureModel,
sm: nx.DiGraph,
prog: str = "neato",
all_node_attributes: Dict[str, str] = None,
all_edge_attributes: Dict[str, str] = None,
Expand Down Expand Up @@ -187,12 +185,12 @@ def color_gradient_string(from_color: str, to_color: str, steps: int) -> str:


def _add_attributes(
sm: StructureModel,
sm: nx.DiGraph,
all_node_attributes: Dict[str, str] = None,
all_edge_attributes: Dict[str, str] = None,
node_attributes: Dict[str, Dict[str, str]] = None,
edge_attributes: Dict[str, Dict[str, str]] = None,
) -> StructureModel:
) -> nx.DiGraph:
_sm = deepcopy(sm)

# shift labels to be above nodes
Expand Down

0 comments on commit 88f23cd

Please sign in to comment.