Skip to content

Commit

Permalink
Numpy2.0 support (#86)
Browse files Browse the repository at this point in the history
* Numpy2.0 support

* Steven comments

* enlarge the range

---------

Co-authored-by: Steven <[email protected]>
  • Loading branch information
aslan-bakirov and Steven authored Oct 22, 2024
1 parent 41bf4bf commit e0d7d2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## NEXT

- Added support for `numpy < 3.0.0` for Python versions `>= 3.10`.

## 0.5.6

- Added the `cai_causal_graph.causal_graph.CausalGraph.get_nodes_between` method, which returns the set of all nodes
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ packages = [{include = "cai_causal_graph"}]
mypy-extensions = "^1.0.0"
# networkx 3.3 broke how get_all_simple_paths works so want to bound for now.
networkx = ">=3.0.0, <3.3.0"
numpy = "^1.20.0"
numpy = [
{version = ">=1.18.0, <3.0.0", python = ">=3.10"},
{version = ">=1.18.0, <2.0.0", python = "<3.10"}
]
pandas = ">=1.0.0, <3.0.0"
python = ">=3.9.0, <3.13.0"

Expand Down
2 changes: 1 addition & 1 deletion tests/test_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _graph_to_adjmat(graph: networkx.DiGraph) -> numpy.ndarray:
p = float(degree) / (d - 1)

# note that we need to pass an int seed to erdos_renyi_graph(), which we extract from the current rng state
rng_state = rng.__getstate__()['state']['state']
rng_state = rng.bit_generator.state['state']['state']

# generate graph, using a faster algorithm if graph is sparse, or deliberately specified
sparsity_threshold = 0.1
Expand Down

0 comments on commit e0d7d2c

Please sign in to comment.