Repository navigation
Document MKLRandomState in the API reference and align docstrings with NumPy
#165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vlad-perevezentsev
wants to merge
12
commits into
master
Choose a base branch
from
align-docstrings-with-numpy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
89119ef
Align distribution docstrings with NumPy
vlad-perevezentsev 8351071
Render distribution methods under MKLRandomState in API reference
vlad-perevezentsev 310392a
Use numpydoc to render the API reference
vlad-perevezentsev 2d65eb8
Fix distribution docstring rendering under numpydoc
vlad-perevezentsev 110bf72
Add gh-165 to changelog
vlad-perevezentsev 52ea3c9
Temporary publish rendered docs to this PR
vlad-perevezentsev c971af8
Merge remote-tracking branch 'origin/master' into align-docstrings-wi…
vlad-perevezentsev cb0fdec
Fix MKLRandomState docstrings that disagree with the code
vlad-perevezentsev 6c44791
Resolve Python, numpy and scipy cross-references in docstrings
vlad-perevezentsev 87147f6
Describe RandomState as a deprecated subclass
vlad-perevezentsev 0f8bad3
Merge remote-tracking branch 'origin/master' into align-docstrings-wi…
vlad-perevezentsev 8efaff4
Require positive scale parameters and use the exported method tokens
vlad-perevezentsev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* mkl_random docs: small Furo overrides for a NumPy-like API look. */ | ||
|
|
||
| /* Keep autosummary tables left-aligned (Furo centres wide ones). */ | ||
| .longtable.docutils { | ||
| margin-left: 0; | ||
| margin-right: auto; | ||
| } | ||
|
|
||
| /* Restore body font size in notes (Furo shrinks admonitions). */ | ||
| div.admonition { | ||
| font-size: inherit !important; | ||
| } | ||
|
|
||
| /* Emphasise section headings (Furo renders them small/uppercase, unbold). */ | ||
| dd p.rubric, | ||
| dl.field-list > dt, | ||
| .admonition > .admonition-title { | ||
| text-transform: none !important; | ||
| font-size: inherit !important; | ||
| font-weight: 700 !important; | ||
| background-color: var(--color-background-secondary); | ||
| padding: 4px 8px; | ||
| } | ||
|
|
||
| /* Bold the signature name and parameter names (Furo only colours them). */ | ||
| dt.sig.sig-object, | ||
| dt.sig.sig-object * { | ||
| font-weight: 400 !important; | ||
| } | ||
| dt.sig.sig-object .sig-name, | ||
| dt.sig.sig-object .sig-name *, | ||
| dt.sig.sig-object .sig-param > .n, | ||
| dt.sig.sig-object .sig-param > .n * { | ||
| font-weight: 700 !important; | ||
| } | ||
|
|
||
| /* Full grid, roomier padding, zebra rows (Furo borders are faint). */ | ||
| body table.docutils td, | ||
| body table.docutils th { | ||
| border: 1px solid var(--color-foreground-border) !important; | ||
| padding: 8px 12px; | ||
| } | ||
| body table.docutils tbody tr.row-odd { | ||
| background-color: var(--color-background-secondary) !important; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,108 @@ | ||
| .. _fullapi: | ||
|
|
||
| Class RandomState | ||
| ================= | ||
| MKL-powered RandomState | ||
| ======================= | ||
|
|
||
| .. autoclass:: mkl_random.RandomState | ||
| :members: | ||
| .. currentmodule:: mkl_random | ||
|
|
||
| .. autoclass:: MKLRandomState | ||
|
|
||
| .. note:: | ||
|
|
||
| ``mkl_random.RandomState`` is a deprecated subclass of | ||
| :class:`mkl_random.MKLRandomState`, kept for backward compatibility with | ||
| legacy code. A NumPy-compatible drop-in replacement for | ||
| :class:`numpy.random.RandomState` is available in | ||
| :mod:`mkl_random.interfaces.numpy_random`. | ||
|
|
||
| Seeding and state | ||
| ----------------- | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| ~MKLRandomState.seed | ||
| ~MKLRandomState.get_state | ||
| ~MKLRandomState.set_state | ||
|
|
||
| Simple random data | ||
| ------------------ | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| ~MKLRandomState.rand | ||
| ~MKLRandomState.randn | ||
| ~MKLRandomState.randint | ||
| ~MKLRandomState.random_integers | ||
| ~MKLRandomState.random_sample | ||
| ~MKLRandomState.tomaxint | ||
| ~MKLRandomState.choice | ||
| ~MKLRandomState.bytes | ||
|
|
||
| Permutations | ||
| ------------ | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| ~MKLRandomState.shuffle | ||
| ~MKLRandomState.permutation | ||
|
|
||
| Distributions | ||
| ------------- | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| ~MKLRandomState.beta | ||
| ~MKLRandomState.binomial | ||
| ~MKLRandomState.chisquare | ||
| ~MKLRandomState.dirichlet | ||
| ~MKLRandomState.exponential | ||
| ~MKLRandomState.f | ||
| ~MKLRandomState.gamma | ||
| ~MKLRandomState.geometric | ||
| ~MKLRandomState.gumbel | ||
| ~MKLRandomState.hypergeometric | ||
| ~MKLRandomState.laplace | ||
| ~MKLRandomState.logistic | ||
| ~MKLRandomState.lognormal | ||
| ~MKLRandomState.logseries | ||
| ~MKLRandomState.multinomial | ||
| ~MKLRandomState.multivariate_normal | ||
| ~MKLRandomState.negative_binomial | ||
| ~MKLRandomState.noncentral_chisquare | ||
| ~MKLRandomState.noncentral_f | ||
| ~MKLRandomState.normal | ||
| ~MKLRandomState.pareto | ||
| ~MKLRandomState.poisson | ||
| ~MKLRandomState.power | ||
| ~MKLRandomState.rayleigh | ||
| ~MKLRandomState.standard_cauchy | ||
| ~MKLRandomState.standard_exponential | ||
| ~MKLRandomState.standard_gamma | ||
| ~MKLRandomState.standard_normal | ||
| ~MKLRandomState.standard_t | ||
| ~MKLRandomState.triangular | ||
| ~MKLRandomState.uniform | ||
| ~MKLRandomState.vonmises | ||
| ~MKLRandomState.wald | ||
| ~MKLRandomState.weibull | ||
| ~MKLRandomState.zipf | ||
|
|
||
| MKL-specific methods | ||
| -------------------- | ||
|
|
||
| .. autosummary:: | ||
| :toctree: generated/ | ||
| :nosignatures: | ||
|
|
||
| ~MKLRandomState.leapfrog | ||
| ~MKLRandomState.skipahead | ||
| ~MKLRandomState.randint_untyped | ||
| ~MKLRandomState.multinormal_cholesky |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the temporary preview steps need to come out before this merges, as the comment here says. Besides pushing each PR's docs to the public gh-pages with a write token, the
mshick/add-pr-commentpin is what fails the zizmor check: its# v2comment doesn't match the pinned SHA (v2currently points at b8f338c).