Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extend-ignore =
D100,
# missing docstring in public class:
D101,
# missing docstring in public method:
# missing docstring in public function:
D103,
# missing docstring in public package:
D104,
Expand All @@ -26,6 +26,7 @@ extend-ignore =
per-file-ignores =
mkl_random/__init__.py: F401
mkl_random/interfaces/__init__.py: F401
mkl_random/tests/**/*.py: D102

filename = *.py, *.pyx, *.pxi, *.pxd
max_line_length = 80
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* Added `mkl_random.interfaces` with `mkl_random.interfaces.numpy_random` interface, which aliases `mkl_random` functionality to more strictly adhere to NumPy's API (i.e., drops arguments and functions which are not part of standard NumPy) [gh-92](https://github.com/IntelPython/mkl_random/pull/92)

* Added third-party tests from `numpy.random` which tests the `mkl_random.interfaces.numpy_random` interface [gh-103](https://github.com/IntelPython/mkl_random/pull/103)

### Changed
* Updates to `mkl_random` implementations to better align with newer versions of `numpy.random` [gh-103](https://github.com/IntelPython/mkl_random/pull/103)

### Fixed
* Various bugfixes including a hang in `zipf` when called with `np.nan` and size-1 1D arrays being cast to scalars [gh-103](https://github.com/IntelPython/mkl_random/pull/103)

### Removed
* Dropped support for Python 3.9 [gh-81](https://github.com/IntelPython/mkl_random/pull/81)

Expand Down
26 changes: 20 additions & 6 deletions mkl_random/interfaces/_numpy_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,18 @@ def exponential(self, scale=1.0, size=None):
"""
return super().exponential(scale=scale, size=size)

def tomaxint(self, size=None):
"""
tomaxint(size=None)

Return a sample of uniformly distributed random integers in the
interval [0, ``np.iinfo("long").max``].

For full documentation refer to `numpy.random.RandomState.tomaxint`.

"""
return super().tomaxint(size=size)

def standard_exponential(self, size=None):
"""
standard_exponential(size=None)
Expand Down Expand Up @@ -314,27 +326,29 @@ def gamma(self, shape, scale=1.0, size=None):
"""
return super().gamma(shape=shape, scale=scale, size=size)

def f(self, dfn, dfd, size=None):
def f(self, dfnum, dfden, size=None):
"""
f(dfn, dfd, size=None)
f(dfnum, dfden, size=None)

Draw samples from an F distribution.

For full documentation refer to `numpy.random.f`.

"""
return super().f(dfn=dfn, dfd=dfd, size=size)
return super().f(dfnum=dfnum, dfden=dfden, size=size)

def noncentral_f(self, dfn, dfd, nonc, size=None):
def noncentral_f(self, dfnum, dfden, nonc, size=None):
"""
noncentral_f(dfn, dfd, nonc, size=None)
noncentral_f(dfnum, dfden, nonc, size=None)

Draw samples from a non-central F distribution.

For full documentation refer to `numpy.random.noncentral_f`.

"""
return super().noncentral_f(dfn=dfn, dfd=dfd, nonc=nonc, size=size)
return super().noncentral_f(
dfnum=dfnum, dfden=dfden, nonc=nonc, size=size
)

def chisquare(self, df, size=None):
"""
Expand Down
Loading
Loading