Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Use int instead of numpy.int #1504

Merged
merged 2 commits into from Jul 20, 2021
Merged

Use int instead of numpy.int #1504

merged 2 commits into from Jul 20, 2021

Conversation

sroet
Copy link
Contributor

@sroet sroet commented Jul 19, 2021

A test on a downstream project was showing Deprecation warnings from this code:

/home/sroet/miniconda3/envs/python3/lib/python3.9/site-packages/pyemma/coordinates/data/featurization/featurizer.py:240: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    pair_inds = np.array(pair_inds).astype(dtype=np.int, casting='safe')

This PR solves that warning with the most common solution (just use the unaliased int)

  • [NA] Make sure to include one or more tests for your change
  • Add yourself to AUTHORS
  • Add a new entry to the doc/source/CHANGELOG (choose any open position to avoid merge conflicts with other PRs).
    Decide whether your change is a fix or a new feature.

@sroet
Copy link
Contributor Author

sroet commented Jul 20, 2021

force pushed to rebase on top off #1505

Copy link
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looks good to me, thank you for your contributions! 🎉

@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #1504 (652d37c) into devel (366ce03) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel    #1504      +/-   ##
==========================================
+ Coverage   92.02%   92.03%   +0.01%     
==========================================
  Files         229      229              
  Lines       26804    26804              
==========================================
+ Hits        24666    24670       +4     
+ Misses       2138     2134       -4     
Impacted Files Coverage Δ
...yemma/coordinates/data/featurization/featurizer.py 89.73% <100.00%> (ø)
pyemma/coordinates/data/util/traj_info_backends.py 93.72% <0.00%> (+1.79%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 366ce03...652d37c. Read the comment docs.

@clonker clonker merged commit d6eba9d into markovmodel:devel Jul 20, 2021
@sroet sroet deleted the patch-2 branch July 20, 2021 14:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants