Skip to content

Commit

Permalink
Merge pull request #28006 from charris/backport-28003
Browse files Browse the repository at this point in the history
MAINT: random: Tweak module code in mtrand.pyx to fix a Cython warning.
  • Loading branch information
charris authored Dec 15, 2024
2 parents 42fd84c + 0d8444d commit eb7071c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numpy/random/mtrand.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4902,6 +4902,7 @@ def ranf(*args, **kwargs):
return _rand.random_sample(*args, **kwargs)

__all__ = [
'RandomState',
'beta',
'binomial',
'bytes',
Expand Down Expand Up @@ -4954,7 +4955,6 @@ __all__ = [
'wald',
'weibull',
'zipf',
'RandomState',
]

seed.__module__ = "numpy.random"
Expand All @@ -4963,7 +4963,8 @@ sample.__module__ = "numpy.random"
get_bit_generator.__module__ = "numpy.random"
set_bit_generator.__module__ = "numpy.random"

for method_name in __all__[:-1]:
# The first item in __all__ is 'RandomState', so it can be skipped here.
for method_name in __all__[1:]:
method = getattr(RandomState, method_name, None)
if method is not None:
method.__module__ = "numpy.random"
Expand Down

0 comments on commit eb7071c

Please sign in to comment.