Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to new numpy.random.Generator #396

Merged
merged 2 commits into from
Oct 19, 2023
Merged

Move to new numpy.random.Generator #396

merged 2 commits into from
Oct 19, 2023

Conversation

Lilly-May
Copy link
Collaborator

PR Checklist

Description of changes

All occurrences of numpy Legacy Generator (RandomState) were replaced with the new numpy.random.Generator. Whenever an instance of the numpy.random.Generator was created, the recommended constructor default_rng was used.

Technical details

I tested that all legacy warnings have disappeared by including the numpy rules from ruff in the pre-commit checks.

@github-actions github-actions bot added bug Something isn't working chore labels Oct 11, 2023
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we need to set a seed here. As far as I can see, there is no random number generator used throughout the test. However, please review whether we can indeed delete this (so far, I've only commented it out).

Copy link
Member

Choose a reason for hiding this comment

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

I don't see one being used in the implementation as well. I guess we can remove it. However, the test should also be a fixture, right? The "make_test_adatashould be aadata` fixture. Can you please implement it?

Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

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

Exactly what we wanted. Thank you very much! See my minor comment. Please merge after you've addressed it.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see one being used in the implementation as well. I guess we can remove it. However, the test should also be a fixture, right? The "make_test_adatashould be aadata` fixture. Can you please implement it?

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #396 (86427ae) into main (b58f7fc) will not change coverage.
Report is 14 commits behind head on main.
The diff coverage is 0.00%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #396   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         40      40           
  Lines       4888    4885    -3     
=====================================
+ Misses      4888    4885    -3     
Files Coverage Δ
pertpy/plot/_mixscape.py 0.00% <ø> (ø)
pertpy/tools/_coda/_tasccoda.py 0.00% <ø> (ø)
pertpy/tools/_scgen/_jax_scgen.py 0.00% <ø> (ø)
pertpy/tools/_coda/_sccoda.py 0.00% <0.00%> (ø)
pertpy/tools/_cinemaot.py 0.00% <0.00%> (ø)
pertpy/tools/_coda/_base_coda.py 0.00% <0.00%> (ø)
pertpy/tools/_distances/_distance_tests.py 0.00% <0.00%> (ø)
pertpy/tools/_scgen/_utils.py 0.00% <0.00%> (ø)

... and 17 files with indirect coverage changes

@Lilly-May Lilly-May merged commit ef8de38 into main Oct 19, 2023
7 of 8 checks passed
@Lilly-May Lilly-May deleted the fix/numpy_random branch October 22, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move to new numpy.random.Generator
2 participants