Skip to content

Commit

Permalink
Fix bandit
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Li <[email protected]>
  • Loading branch information
adam2392 committed Aug 17, 2022
1 parent 351d9cc commit 3506e1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poe.tasks]
_flake8 = 'flake8'
_bandit = 'bandit -r pywhy_graphs'
_bandit = 'bandit -r pywhy_graphs -c pyproject.toml'
_black = 'black .'
_isort = 'isort .'
_black_check = 'black --check pywhy_graphs examples'
Expand Down Expand Up @@ -170,3 +170,6 @@ omit = ['**/__init__.py', '**/tests/**']
[tool.coverage.report]
exclude_lines = ['pragma: no cover', 'if __name__ == .__main__.:']
precision = 2

[tool.bandit]
exclude_dirs = ["tests"]
3 changes: 2 additions & 1 deletion pywhy_graphs/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def to_numpy(causal_graph):
# ADMGs can have two edges between any 2 nodes
if type(causal_graph).__name__ == "ADMG":
# we handle this case separately from the other graphs
assert len(graph_map) == 1
if len(graph_map) != 1:
raise AssertionError("The number of graph maps should be 1...")

# set all bidirected edges with value 10
bidirected_graph_arr[bidirected_graph_arr != 0] = 10
Expand Down

0 comments on commit 3506e1c

Please sign in to comment.