Skip to content
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

[DOC] resolved the inconsistency of double ticks for the anomaly detection module #809 #2546

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

AnaghDeshpande
Copy link

Reference Issues/PRs

#809

What does this implement/fix? Explain your changes.

This PR addresses the issue Inconsistent double tick quotes in docstrings #809.

In the anomaly_detection module i have changed all the double tick quotes to single tick quotes.

Does your contribution introduce a new dependency? If yes, which one?

Any other comments?

PR checklist

For all contributions
  • The PR title starts with either [ENH], [MNT], [DOC], [BUG], [REF], [DEP] or [GOV] indicating whether the PR topic is related to enhancement, maintenance, documentation, bugs, refactoring, deprecation or governance.

@aeon-actions-bot aeon-actions-bot bot added anomaly detection Anomaly detection package documentation Improvements or additions to documentation labels Feb 19, 2025
@aeon-actions-bot
Copy link
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: [ $\color{#F3B9F8}{\textsf{documentation}}$ ].
I have added the following labels to this PR based on the changes made: [ $\color{#6F6E8D}{\textsf{anomaly detection}}$ ]. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.

Don't hesitate to ask questions on the aeon Slack channel if you have any.

PR CI actions

These checkboxes will add labels to enable/disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • Run pre-commit checks for all files
  • Run mypy typecheck tests
  • Run all pytest tests and configurations
  • Run all notebook example tests
  • Run numba-disabled codecov tests
  • Stop automatic pre-commit fixes (always disabled for drafts)
  • Disable numba cache loading
  • Push an empty commit to re-run CI checks

@SebastianSchmidl
Copy link
Member

Did I get the issue wrong, or is this PR transforming the quotes the wrong way around?

Single ticks render as italics while double ticks render as code in the api docs, e.g. int v.s. int.

I think double ticks is preferable

IMO, code references, such as class names, parameter names, and default values should, thus, be in double quotes: ``

@AnaghDeshpande
Copy link
Author

Sorry for the mistake i will change it to double quotes.

``window_size`` and ``stride``. The internal `X` has the shape
`(n_windows, window_size * n_channels)`.
Here, ``X`` refers to the set of sliding windows extracted from the time series
using :func:``aeon.utils.windowing.sliding_windows`` with the parameters
Copy link
Member

@SebastianSchmidl SebastianSchmidl Feb 21, 2025

Choose a reason for hiding this comment

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

Directives must use single ticks; otherwise, they do not render correctly. Please revert to single ticks and also check other locations for this.

Copy link
Author

Choose a reason for hiding this comment

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

ok sure. will check sorry about the delay.

the PyOD model ``CBLOF`` except for `window_size` and `stride`, which are used to
construct the sliding windows.
the PyOD model ``CBLOF`` except for ``window_size`` and ``stride``,
which are used to construct the sliding windows.

The documentation for parameters has been adapted from the
[PyOD documentation](https://pyod.readthedocs.io/en/latest/pyod.models.html#id117).
Copy link
Member

Choose a reason for hiding this comment

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

Because we are already working on the docs. Please also fix the link. This is Markdown syntax and not rst: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#hyperlinks

Copy link
Member

Choose a reason for hiding this comment

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

@MatthewMiddlehurst
Copy link
Member

MatthewMiddlehurst commented Feb 25, 2025

Thanks Sebastian for the review. Please check how changes are rendered after you make them in the PR docs build https://aeon-toolkit--2546.org.readthedocs.build/en/2546/

- If "auto", then ``max_samples=min(256, n_samples)``.
- If ``int``, then draw ``max_samples`` samples.
- If ``float``, then draw ``max_samples * X.shape[0]`` samples.
- If ``auto``, then ``max_samples=min(256, n_samples)``.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- If ``auto``, then ``max_samples=min(256, n_samples)``.
- If ``"auto"``, then ``max_samples=min(256, n_samples)``.



random_state : int, np.RandomState or None, default=None
If int, random_state is the seed used by the random number generator;
If ``int``, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If None, the random number generator is the RandomState instance used
If ``None``, the random number generator is the RandomState instance used

@@ -156,8 +156,9 @@ def predict(self, X, axis=1) -> np.ndarray:
Returns
-------
np.ndarray
A boolean, int or float array of length len(X), where each element indicates
whether the corresponding subsequence is anomalous or its anomaly score.
A boolean, ``int`` or ``float`` array of length len(X), where each element
Copy link
Member

Choose a reason for hiding this comment

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

Why have int and float as code, but boolean not? Also len(X) is code

Comment on lines +146 to +148
``MyClass(**params)`` or ``MyClass(**params[i])`` creates a valid test
instance. ``create_test_instance`` uses the first (or only) dictionary
in ``params``.
Copy link
Member

Choose a reason for hiding this comment

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

@SebastianSchmidl does it make sense for these to be here in the first place? It is private so not on the webpage, I'm just wondering if it formats ln intellisense as well or any other reason we would want this.

@@ -43,8 +43,8 @@ class OneClassSVM(BaseAnomalyDetector):

- if ``gamma='scale'`` (default) is passed then it uses
1 / (n_features * X.var()) as value of gamma,
- if 'auto', uses 1 / n_features
- if float, must be non-negative.
- if ``"auto"``, uses 1 / n_features
Copy link
Member

Choose a reason for hiding this comment

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

This is not the only one, but I'm not sure I agree to using both quotes " and ``

@@ -192,9 +192,10 @@ def fit_predict(self, X, y=None, axis=1) -> np.ndarray:
Returns
-------
np.ndarray
A boolean, ``int`` or ``float`` array of length len(X), where each element
indicates whether the corresponding subsequence is anomalous or
A ``boolean``, ``int`` or ``float`` array of length ``len(X)``, where each
Copy link
Member

Choose a reason for hiding this comment

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

bool not boolean i think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anomaly detection Anomaly detection package documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants