-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
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.
These look good. Maybe we should have Philip or Rosy review because they are more knowledgeable with formatting and coding standards than I am.
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.
Thanks for the cleanup. I have two comments
- I would rephrase the "Default = XXX" to propper sentences
- 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.
src/skmatter/decomposition/_pcovc.py
Outdated
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 |
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.
This looks a bit weird for me. Maybe write a "real" sentence like
Default = `sample` when :math:`{n_{samples} < n_{features}}` and | |
The default value is `sample` when :math:`{n_{samples} < n_{features}}` and |
or similar.
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.
Changed!
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.
Did you push the changes. Somehow I don't see them here?
src/skmatter/decomposition/_pcovc.py
Outdated
`feature` when :math:`{n_{features} < n_{samples}}` | ||
|
||
classifier: `estimator object` or `precomputed`, default=None | ||
classifier: `estimator object` or `precomputed`, default=None |
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.
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.
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.
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
src/skmatter/decomposition/_pcovc.py
Outdated
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 |
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.
same as above
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.
Cool! Thanks for the updates. I have some final minor suggestions to improve the flow when reading the docs.
src/skmatter/decomposition/_pcovr.py
Outdated
@@ -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 |
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.
Regression weights, optional when regressor = `precomputed`. If not | |
Regression weights, optional when regressor is ``precomputed``. If not |
src/skmatter/decomposition/_pcovr.py
Outdated
@@ -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` |
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.
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`` |
src/skmatter/decomposition/_pcovr.py
Outdated
The default is = `sample` when :math:`{n_{samples} < n_{features}}` | ||
and `feature` when :math:`{n_{features} < n_{samples}}` |
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.
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}}` |
src/skmatter/decomposition/_pcovc.py
Outdated
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}}` |
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.
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}}` |
src/skmatter/decomposition/_pcovc.py
Outdated
`feature` when :math:`{n_{features} < n_{samples}}` | ||
|
||
classifier: `estimator object` or `precomputed`, default=None | ||
classifier: `estimator object` or `precomputed`, default=None |
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.
classifier: `estimator object` or `precomputed`, default=None | |
classifier: ``estimator object`` or ``precomputed``, default=None |
src/skmatter/decomposition/_pcovc.py
Outdated
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 |
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.
Did you push the changes. Somehow I don't see them here?
Great! Everything should be added now. I think a few changes were left out from the previous commit. |
I am happy. We can merge if @cajchristian is as well. |
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 am happy too!
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 changetest_pcovc
to use a multiclass dataset for testing.Contributor (creator of PR) checklist
For Reviewer
📚 Documentation preview 📚: https://scikit-matter--264.org.readthedocs.build/en/264/