theislab / sfaira

data and model repository for single-cell data
https://sfaira.readthedocs.io
BSD 3-Clause "New" or "Revised" License
135 stars 11 forks source link

small change to eliminate obsolete np.int calls #738

Closed vjcitn closed 1 year ago

vjcitn commented 1 year ago

Many thanks for contributing to sfaira!

PR Checklist Please fill in the appropriate checklist below (delete whatever is not relevant). These are the most common things requested on pull requests (PRs).

Description of changes

Please ignore the 'note.fork' file in the PR.

np.int is defunct in recent numpy. We run into

> ui$predict_all() 
Error in eval(ei, envir) : 
  AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in 
existing code, use `int` by itself. Doing this will not modify any behavior 
and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64`
or `np.int32` to specify the precision. If you wish to review your current use, 
check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details 
and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

The changes proposed convert two occurrences of np.int to int and this permits the function to compute with numpy 1.21.5.

le-ander commented 1 year ago

Thanks a lot!

vjcitn commented 1 year ago

will there be a new release with this repair?

le-ander commented 1 year ago

Sorry for the delay. Everything is now merged into main and a new release was created. This should be available via pypi in the next days. You can already get it now using pip install git+https://github.com/theislab/sfaira.git