Skip to content

Miscellaneous typos and code cleaning #264

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

Merged
merged 7 commits into from
Jul 17, 2025
Merged

Miscellaneous typos and code cleaning #264

merged 7 commits into from
Jul 17, 2025

Conversation

rvasav26
Copy link
Collaborator

@rvasav26 rvasav26 commented Jun 30, 2025

This addresses some typos in the docs as well as a few redundant code lines. Additionally, we rename a few methods in _BasePCov and _BaseKPCov. Finally, we change test_pcovc to use a multiclass dataset for testing.

Contributor (creator of PR) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

For Reviewer

  • CHANGELOG updated if important change?

📚 Documentation preview 📚: https://scikit-matter--264.org.readthedocs.build/en/264/

@rvasav26 rvasav26 marked this pull request as ready for review June 30, 2025 17:35
@rvasav26 rvasav26 requested a review from cajchristian June 30, 2025 17:36
Copy link
Collaborator

@cajchristian cajchristian left a comment

Choose a reason for hiding this comment

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

These look good. Maybe we should have Philip or Rosy review because they are more knowledgeable with formatting and coding standards than I am.

Copy link
Collaborator

@PicoCentauri PicoCentauri left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup. I have two comments

  1. I would rephrase the "Default = XXX" to propper sentences
  2. See my comment on how to typeset inline code in the docs. You can also always render the docs locally with tox -e docs or check the read the docs link in the PR conversation.

whether to compute the PCovC in `sample` or `feature` space
default=`sample` when :math:`{n_{samples} < n_{features}}` and
whether to compute the PCovC in `sample` or `feature` space.
Default = `sample` when :math:`{n_{samples} < n_{features}}` and
Copy link
Collaborator

Choose a reason for hiding this comment

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

This looks a bit weird for me. Maybe write a "real" sentence like

Suggested change
Default = `sample` when :math:`{n_{samples} < n_{features}}` and
The default value is `sample` when :math:`{n_{samples} < n_{features}}` and

or similar.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you push the changes. Somehow I don't see them here?

`feature` when :math:`{n_{features} < n_{samples}}`

classifier: `estimator object` or `precomputed`, default=None
classifier: `estimator object` or `precomputed`, default=None
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you want to do a code highlighting use double ticks ``. Our documentation pages use rst where inline codes are highlighted with double ticks. Sorry for the confusion and this very subtle difference between markdown and rst.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, that makes sense. I think the reason I have single ticks is to match how PCovR/KPCovR docstrings handle `precomputed`, but I will keep that in mind

whether to compute the PCovC in `sample` or `feature` space
default=`sample` when :math:`{n_{samples} < n_{features}}` and
whether to compute the PCovC in `sample` or `feature` space.
Default = `sample` when :math:`{n_{samples} < n_{features}}` and
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

Copy link
Collaborator

@PicoCentauri PicoCentauri left a comment

Choose a reason for hiding this comment

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

Cool! Thanks for the updates. I have some final minor suggestions to improve the flow when reading the docs.

@@ -227,11 +227,12 @@ def fit(self, X, Y, W=None):
regressed form of the properties, :math:`{\mathbf{\hat{Y}}}`.

W : numpy.ndarray, shape (n_features, n_properties)
Regression weights, optional when regressor= `precomputed`. If not
Regression weights, optional when regressor = `precomputed`. If not
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
Regression weights, optional when regressor = `precomputed`. If not
Regression weights, optional when regressor is ``precomputed``. If not

@@ -126,7 +126,7 @@ class PCovR(RegressorMixin, MultiOutputMixin, _BasePCov):
Must be of range [0.0, infinity).

space: {'feature', 'sample', 'auto'}, default='auto'
whether to compute the PCovR in `sample` or `feature` space default=`sample`
whether to compute the PCovR in `sample` or `feature` space. Default = `sample`
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
whether to compute the PCovR in `sample` or `feature` space. Default = `sample`
whether to compute the PCovR in `sample` or `feature` space. Default is equal to ``sample``

Comment on lines 92 to 93
The default is = `sample` when :math:`{n_{samples} < n_{features}}`
and `feature` when :math:`{n_{features} < n_{samples}}`
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
The default is = `sample` when :math:`{n_{samples} < n_{features}}`
and `feature` when :math:`{n_{features} < n_{samples}}`
The default is equal to ``sample`` when :math:`{n_{samples} < n_{features}}`
and ``feature`` when :math:`{n_{features} < n_{samples}}`

Comment on lines 147 to 149
whether to compute the PCovC in `sample` or `feature` space.
The default is = `sample` when :math:`{n_{samples} < n_{features}}`
and `feature` when :math:`{n_{features} < n_{samples}}`
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
whether to compute the PCovC in `sample` or `feature` space.
The default is = `sample` when :math:`{n_{samples} < n_{features}}`
and `feature` when :math:`{n_{features} < n_{samples}}`
whether to compute the PCovC in ``sample`` or ``feature`` space.
The default is equal to ``sample`` when :math:`{n_{samples} < n_{features}}`
and ``feature`` when :math:`{n_{features} < n_{samples}}`

`feature` when :math:`{n_{features} < n_{samples}}`

classifier: `estimator object` or `precomputed`, default=None
classifier: `estimator object` or `precomputed`, default=None
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
classifier: `estimator object` or `precomputed`, default=None
classifier: ``estimator object`` or ``precomputed``, default=None

whether to compute the PCovC in `sample` or `feature` space
default=`sample` when :math:`{n_{samples} < n_{features}}` and
whether to compute the PCovC in `sample` or `feature` space.
Default = `sample` when :math:`{n_{samples} < n_{features}}` and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you push the changes. Somehow I don't see them here?

@rvasav26
Copy link
Collaborator Author

Cool! Thanks for the updates. I have some final minor suggestions to improve the flow when reading the docs.

Great! Everything should be added now. I think a few changes were left out from the previous commit.

@PicoCentauri
Copy link
Collaborator

I am happy. We can merge if @cajchristian is as well.

Copy link
Collaborator

@cajchristian cajchristian left a comment

Choose a reason for hiding this comment

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

I am happy too!

@rvasav26 rvasav26 merged commit eb9919e into main Jul 17, 2025
10 checks passed
@rvasav26 rvasav26 deleted the pcovc-edits branch July 17, 2025 21:30
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.

3 participants