Skip to content

Add documentation for patching utilities and interfaces#107

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

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

Conversation

@ndgrigorian
Copy link
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
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
Collaborator

Downloading the documentation artifact

Alternatively, it can be downloaded through GH action

Class MKLRandomState
====================

.. autoclass:: mkl_random.MKLRandomState
Copy link
Collaborator

Choose a reason for hiding this comment

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

The rendered page has # no-cython-lint. Is there a way to suppress the linter warning without being shown on the generated page?


.. autoclass:: mkl_random.interfaces.numpy_random.RandomState
:members:
:undoc-members:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The same here: # noqa: E501,W505

-------------------------------------------------------------

:mod:`mkl_random.interfaces.numpy_random` is a drop-in replacement for the legacy portion of
:mod:`numpy.random`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it be a ref on numpy.random page?

.. note::
While the API is the same, :mod:`mkl_random.interfaces.numpy_random` is **not** seed-compatible
with :mod:`numpy.random`. Given the same seed, the two modules will produce different sequences.
The output of `get_state` and accepted input to `set_state` may also differ. It is not
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should here be a ref on functions?

Suggested change
The output of `get_state` and accepted input to `set_state` may also differ. It is not
The output of :func:`get_state` and accepted input to :func:`set_state` may also differ. It is not


.. autoclass:: mkl_random.interfaces.numpy_random.RandomState
:members:
:undoc-members:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The link on numpy.random.RandomState is not clicable:

For full documentation refer to numpy.random.RandomState.


.. autosummary::

mkl_random.interfaces.numpy_random.rand
Copy link
Collaborator

Choose a reason for hiding this comment

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

The link on page with numpy corresponding functions are not working.


mkl_random.interfaces.numpy_random.seed
mkl_random.interfaces.numpy_random.get_state
mkl_random.interfaces.numpy_random.set_state
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should it be clickable to go from the table to the function description?

============================

:mod:`mkl_random` can temporarily replace functions and classes in :mod:`numpy.random` with
:mod:`mkl_random`implementations from the :ref:`numpy interface <numpy_random_interface>`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
:mod:`mkl_random`implementations from the :ref:`numpy interface <numpy_random_interface>`.
:mod:`mkl_random` implementations from the :ref:`numpy interface <numpy_random_interface>`.

modules using :mod:`mkl_random` implementations. Currently, only a NumPy interface is provided,
but more may be added in the future.


Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we updat examples in brngs description with MKLRandomState? (I mean pages, like: rendered%20documentation/reference/mt19937.html)

Copy link
Collaborator

Choose a reason for hiding this comment

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

The same is about example on How-to guide (documentation/how_to.html)

Copy link
Collaborator

Choose a reason for hiding this comment

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

And Beginner's guide (documentation/tutorials.html)


The reference guide contains a detailed description of class :class:`mkl_random.RandomState` and its methods.
The reference guide contains a detailed description of class :class:`mkl_random.MKLRandomState`,
the :ref:`interfaces <interfaces>` submodule, and :ref:`NumPy patching <patching>` utilities.
Copy link
Collaborator

Choose a reason for hiding this comment

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

All links here are referred on documentation/reference/index.html page, but I guess, it should be on specific section with detailed description.

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