py-why / causal-learn

Causal Discovery in Python. It also includes (conditional) independence tests and score functions.
https://causal-learn.readthedocs.io/en/latest/
MIT License
1.11k stars 182 forks source link

use of deprecated `np.mat` #185

Open Alex-Markham opened 1 month ago

Alex-Markham commented 1 month ago

Numpy 2.0 was released less than a month ago, resulting in some deprecated code in causal-learn. For example, see Line 42 of causal-learn/utils/ScoreUtils.py which uses the deprecated np.mat. This should be a quick fix, so I'll try to make a (backwards-compatible) pull request in the next week or so, unless someone else gets to it first.

It could also be worth considering adding compatible release version specifiers in setup.py to ensure automatically installed requirements are compatible with versions that devs have used in tests.

kunwuz commented 1 month ago

Aha, thank you so much for the reminder and your proposal to address it. The recent PR for GRaSP and BOSS (#188) removed some 'np.mat' in the local score functions, but there are likely still instances elsewhere. Please feel free to submit a PR, and let us know if you have any questions.