Skip to content

Add documentation for patching utilities and interfaces#107

Open
ndgrigorian wants to merge 11 commits intomasterfrom
document-numpy-interface
Open

Add documentation for patching utilities and interfaces#107
ndgrigorian wants to merge 11 commits intomasterfrom
document-numpy-interface

Conversation

@ndgrigorian
Copy link
Copy Markdown
Collaborator

@ndgrigorian ndgrigorian commented Mar 19, 2026

This PR adds documentation for patching and for the interfaces submodule

@ndgrigorian ndgrigorian force-pushed the document-numpy-interface branch from 8b56414 to d26d763 Compare March 19, 2026 21:46
@ndgrigorian ndgrigorian force-pushed the document-numpy-interface branch from d26d763 to fe7b7a2 Compare March 20, 2026 01:44
@ndgrigorian ndgrigorian marked this pull request as ready for review March 20, 2026 02:14
@ndgrigorian
Copy link
Copy Markdown
Collaborator Author

@antonwolfy @jharlow-intel
Downloading the documentation artifact and opening with python -m http.server --directory /dir/with/unzipped/docs, the changes seem to be working, and there are docs pages for mkl_random.interfaces, the patching, and new APIs

PR is ready for review

@antonwolfy
Copy link
Copy Markdown
Collaborator

Downloading the documentation artifact

Alternatively, it can be downloaded through GH action

@ndgrigorian ndgrigorian force-pushed the document-numpy-interface branch from 47b4649 to 3c3fd15 Compare April 6, 2026 21:46
@ndgrigorian ndgrigorian force-pushed the document-numpy-interface branch from 6978343 to e7963c5 Compare April 6, 2026 22:05
@ndgrigorian ndgrigorian force-pushed the document-numpy-interface branch from 09ac28a to 297cb4b Compare April 6, 2026 22:54
@ndgrigorian ndgrigorian force-pushed the document-numpy-interface branch from 297cb4b to 9422ee0 Compare April 6, 2026 22:57
@ndgrigorian ndgrigorian requested a review from antonwolfy April 6, 2026 23:10
@ndgrigorian
Copy link
Copy Markdown
Collaborator Author

@antonwolfy
ready for another review

@antonwolfy antonwolfy added this to the 1.4.0 release milestone Apr 10, 2026
The state of pseudo-random number generator is stored in :class:`mkl_random.RandomState` class,
.. tip::
If you want a drop-in replacement for the `numpy.random <https://numpy.org/doc/stable/reference/random/legacy.html>`_ legacy interface,
see :ref:`interfaces`. While it is recommended users rewrite code to use :mod:`mkl_random` or :mod:`<|mkl_random.interfaces.numpy_random|>`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In the rendered documentation it's shown as

<|mkl_random.interfaces.numpy_random|>

Is that intended to wrap with <|?

Functions
---------

.. autofunction:: mkl_random.patch_numpy_random
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems the Notes section is not properly rendered there.

`RandomState`, it has been rewritten to use MKL's vector statistics
functionality, that provides efficient implementation of the MT19937.
As consequences:
this version is NOT seed-compatible with the original
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If the idea was to have that rendered as a list item, then it does not seem working.

2. `state`: a dictionary guaranteed to contain the key
`mkl_stream`, whose value is a bytes object holding content of
Intel MKL's stream for the generator.
If `legacy` is False, a dictionary containing the state information
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That one also badly formatted in the rendered page: probably the issue with proposed indention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants