You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So it seems like there is no need to migrate those immediately, but just wanted to mention that here. Since there are around ~390 usages in tests I am not listing them here.
I found usages using the following bash command: find . -name "*.py" -exec grep -o -H -n -E 'np.random.\w+' {} \; | grep -v "RandomState" | sort | uniq
(cc @ericspod@john-zielke-snkeos follow-up of the discussions in #6854, self.R and RandomState is currently preferred over np.random.*, this ticket is to track the issue.
e.g. preferred usage:
If we wanted to first change the usages of np.random.* to use a RandomState then migrate in the future to Generator we could do the following:
Change the usage of np.random.* in transforms to use self.R. This will change some expected deterministic behaviour but would be more reproducible.
In other places in core change routines to accept a RandomState object as an argument and use that, defaulting to np.random if none is provided. This would cover most use cases with minimal addition. @wyli 's code snippet is probably the technique to use for this.
In apps/* and auto3dseg ask contributors what they would want to do, mentioning we're trying to tighten up the implementation with an eye to future migration.
We do need to have a more considered discussion about what to do about migration at some point, either we move to Generator or we do implement our own class to replace RandomState usage.
So it seems like there is no need to migrate those immediately, but just wanted to mention that here. Since there are around ~390 usages in tests I am not listing them here.
I found usages using the following bash command:
find . -name "*.py" -exec grep -o -H -n -E 'np.random.\w+' {} \; | grep -v "RandomState" | sort | uniq
Originally posted by @john-zielke-snkeos in #6854 (comment)
The text was updated successfully, but these errors were encountered: