Skip to content

Commit 3c784c9

Browse files
committed
docs improvements
1 parent 89aae14 commit 3c784c9

File tree

10 files changed

+45
-38
lines changed

10 files changed

+45
-38
lines changed

Diff for: README.rst

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ scikit-matter
22
=============
33
|tests| |codecov| |pypi| |conda| |docs| |doi|
44

5-
A collection of scikit-learn compatible utilities that implement methods born out of the
6-
materials science and chemistry communities.
5+
A collection of ``scikit-learn`` compatible utilities that implement methods born out of
6+
the materials science and chemistry communities.
77

88
For details, tutorials, and examples, please have a look at our `documentation`_.
99

@@ -72,7 +72,7 @@ Writing code is not the only way to contribute to the project. You can also:
7272
.. _`examples and tutorials`: https://scikit-matter.readthedocs.io/en/latest/contributing.html#contributing-new-examples
7373
.. _`new datasets`: https://scikit-matter.readthedocs.io/en/latest/contributing.html#contributing-datasets
7474

75-
.. marker-contributors
75+
.. marker-citing
7676
7777
Citing scikit-matter
7878
--------------------
@@ -81,7 +81,11 @@ If you use *scikit-matter* for your work, please cite:
8181
Goscinski A, Principe VP, Fraux G et al. scikit-matter :
8282
A Suite of Generalisable Machine Learning Methods Born out of Chemistry
8383
and Materials Science. Open Res Europe 2023, 3:81.
84-
`10.12688/openreseurope.15789.2 <https://doi.org/10.12688/openreseurope.15789.2>`_
84+
`10.12688/openreseurope.15789.2`_
85+
86+
.. _`10.12688/openreseurope.15789.2`: https://doi.org/10.12688/openreseurope.15789.2
87+
88+
.. marker-contributors
8589
8690
Contributors
8791
------------
@@ -90,18 +94,17 @@ Thanks goes to all people that make scikit-matter possible:
9094
.. image:: https://contrib.rocks/image?repo=scikit-learn-contrib/scikit-matter
9195
:target: https://github.com/scikit-learn-contrib/scikit-matter/graphs/contributors
9296

93-
.. |tests| image:: https://github.com/scikit-learn-contrib/scikit-matter/workflows/Test/badge.svg
97+
.. |tests| image:: https://github.com/scikit-learn-contrib/scikit-matter/workflows/Tests/badge.svg
9498
:alt: Github Actions Tests Job Status
95-
:target: (https://github.com/scikit-learn-contrib/scikit-matter/\
96-
actions?query=workflow%3ATests)
99+
:target: action_
97100

98101
.. |codecov| image:: https://codecov.io/gh/scikit-learn-contrib/scikit-matter/branch/main/graph/badge.svg?token=UZJPJG34SM
99102
:alt: Code coverage
100103
:target: https://codecov.io/gh/scikit-learn-contrib/scikit-matter/
101104

102105
.. |docs| image:: https://img.shields.io/badge/documentation-latest-sucess
103106
:alt: Python
104-
:target: https://scikit-matter.readthedocs.io
107+
:target: documentation_
105108

106109
.. |pypi| image:: https://img.shields.io/pypi/v/skmatter.svg
107110
:alt: Latest PYPI version
@@ -113,4 +116,6 @@ Thanks goes to all people that make scikit-matter possible:
113116

114117
.. |doi| image:: https://img.shields.io/badge/DOI-10.12688-blue
115118
:alt: ORE Paper
116-
:target: https://doi.org/10.12688/openreseurope.15789.2
119+
:target: `10.12688/openreseurope.15789.2`_
120+
121+
.. _`action`: https://github.com/scikit-learn-contrib/scikit-matter/actions?query=branch%3Amain

Diff for: docs/src/index.rst

+7-3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@
7474
:start-after: marker-issues
7575
:end-before: marker-contributing
7676

77+
.. include:: ../../README.rst
78+
:start-after: marker-citing
79+
:end-before: marker-contributors
80+
81+
If you would like to contribute to scikit-matter, check out our :ref:`contributing`
82+
page!
83+
7784
.. toctree::
7885
:hidden:
7986

@@ -84,6 +91,3 @@
8491
contributing
8592
changelog
8693
bibliography
87-
88-
If you would like to contribute to scikit-matter, check out our :ref:`contributing`
89-
page!

Diff for: examples/README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Examples
22
========
33

4-
For a thorough tutorial of the methods introduced in `scikit-matter`, we
4+
For a thorough tutorial of the methods introduced in ``scikit-matter``, we
55
suggest you check out the pedagogic notebooks in our companion project
66
`kernel-tutorials <https://github.com/lab-cosmo/kernel-tutorials/>`_.
77

8-
For running the examples locally install `scikit-matter` with the ``examples``
8+
For running the examples locally install ``scikit-matter`` with the ``examples``
99
optional dependencies.
1010

1111
.. code-block:: bash

Diff for: src/skmatter/_selection.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -592,19 +592,17 @@ def _compute_pi(self, X, y=None):
592592
the squares of the first :math:`k` components of the right singular vectors
593593
594594
.. math::
595-
\\pi_j =
596-
\\sum_i^k \\left(\\mathbf{U}_\\mathbf{C}\\right)_{ij}^2.
595+
\pi_j = \sum_i^k \left(\mathbf{U}_\mathbf{C}\right)_{ij}^2.
597596
598-
where :math:`\\mathbf{C} = \\mathbf{X}^T\\mathbf{X}`.
597+
where :math:`\mathbf{C} = \mathbf{X}^T\mathbf{X}`.
599598
600-
For sample selection, the importance score :math:`\\pi` is the sum over the
599+
For sample selection, the importance score :math:`\pi` is the sum over the
601600
squares of the first :math:`k` components of the right singular vectors
602601
603602
.. math::
604-
\\pi_j =
605-
\\sum_i^k \\left(\\mathbf{U}_\\mathbf{K}\\right)_{ij}^2.
603+
\pi_j = \sum_i^k \left(\mathbf{U}_\mathbf{K}\right)_{ij}^2.
606604
607-
where :math:`\\mathbf{K} = \\mathbf{X}\\mathbf{X}^T`.
605+
where :math:`\mathbf{K} = \mathbf{X}\mathbf{X}^T`.
608606
609607
Parameters
610608
----------
@@ -615,7 +613,7 @@ def _compute_pi(self, X, y=None):
615613
Returns
616614
-------
617615
pi : numpy.ndarray of (n_to_select_from_)
618-
:math:`\\pi` importance for the given samples or features
616+
:math:`\pi` importance for the given samples or features
619617
"""
620618
svd_kwargs = dict(k=self.k, random_state=self.random_state)
621619
if self._axis == 0:
@@ -941,7 +939,7 @@ def get_distance(self):
941939
942940
For sample selection, this is a row-wise Euclidean distance, which can be
943941
expressed in terms of the Gram matrix
944-
:math:`\\mathbf{K} = \mathbf{X} \\mathbf{X} ^ T`
942+
:math:`\mathbf{K} = \mathbf{X} \mathbf{X} ^ T`
945943
946944
.. math::
947945
\operatorname{d}_r(i, j) = K_{ii} - 2 K_{ij} + K_{jj}.

Diff for: src/skmatter/datasets/descr/who_dataset.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
WHO dataset
44
###########
55

6-
`who_dataset.csv` is a compilation of multiple publically-available datasets
6+
``who_dataset.csv`` is a compilation of multiple publically-available datasets
77
through data.worldbank.org. Specifically, the following versioned datasets are used:
88

99
- NY.GDP.PCAP.CD (v2_4770383) [1]_
@@ -17,7 +17,7 @@ through data.worldbank.org. Specifically, the following versioned datasets are u
1717
- SP.DYN.LE00.IN (v2_4770556) [9]_
1818
- SP.POP.TOTL (v2_4770385) [10]_
1919

20-
where the corresponding file names are `API_{dataset}_DS2_excel_en_{version}.xls`.
20+
where the corresponding file names are ``API_{dataset}_DS2_excel_en_{version}.xls``.
2121

2222
This dataset, intended only for demonstration, contains 2020 country-year pairings and
2323
the corresponding values above.

Diff for: src/skmatter/preprocessing/_data.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class KernelNormalizer(KernelCenterer):
225225
where :math:`\phi` is a function mapping x to a Hilbert space.
226226
KernelNormalizer centers (i.e., normalize to have zero mean) the data without
227227
explicitly computing :math:`\phi(x)`.
228-
It is equivalent to centering and scaling :math:`\\phi(x)` with
228+
It is equivalent to centering and scaling :math:`\phi(x)` with
229229
sklearn.preprocessing.StandardScaler(with_std=False).
230230
231231
Parameters

Diff for: src/skmatter/sample_selection/_base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class PCovFPS(_PCovFPS):
147147
----------
148148
mixing: float, default=0.5
149149
The PCovR mixing parameter, as described in PCovR as
150-
:math:`{\\alpha}`
150+
:math:`{\alpha}`
151151
initialize: int or 'random', default=0
152152
Index of the first selection. If 'random', picks a random value when fit starts.
153153
n_to_select : int or float, default=None
@@ -350,7 +350,7 @@ class PCovCUR(_PCovCUR):
350350
Parameters
351351
----------
352352
mixing: float, default=0.5
353-
The PCovR mixing parameter, as described in PCovR as :math:`{\\alpha}`. Stored
353+
The PCovR mixing parameter, as described in PCovR as :math:`{\alpha}`. Stored
354354
in :py:attr:`self.mixing`.
355355
recompute_every : int
356356
number of steps after which to recompute the pi score defaults to 1, if 0 no

Diff for: src/skmatter/sample_selection/_voronoi_fps.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ def score(self, X=None, y=None):
111111
def get_distance(self):
112112
r"""Traditional FPS employs a column-wise Euclidean distance for feature
113113
selection, which can be expressed using the covariance matrix
114-
:math:`\\mathbf{C} = \\mathbf{X} ^ T \\mathbf{X}`.
114+
:math:`\mathbf{C} = \mathbf{X} ^ T \mathbf{X}`.
115115
116116
.. math::
117117
\operatorname{d}_c(i, j) = C_{ii} - 2 C_{ij} + C_{jj}.
118118
119119
For sample selection, this is a row-wise Euclidean distance, which can be
120120
expressed in terms of the Gram matrix
121-
:math:`\\mathbf{K} = \\mathbf{X} \\mathbf{X} ^ T`
121+
:math:`\mathbf{K} = \mathbf{X} \mathbf{X} ^ T`
122122
123123
.. math::
124124
\operatorname{d}_r(i, j) = K_{ii} - 2 K_{ij} + K_{jj}.

Diff for: src/skmatter/utils/_orthogonalizers.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ def Y_feature_orthogonalizer(y, X, tol=1e-12, copy=True):
8787

8888

8989
def Y_sample_orthogonalizer(y, X, y_ref, X_ref, tol=1e-12, copy=True):
90-
r"""Orthogonalizes a matrix of targets :math:`{\\mathbf{Y}}` given a reference
91-
feature matrix :math:`{\\mathbf{X}_r}` and reference target matrix
92-
:math:`{\\mathbf{Y}_r}`:
90+
r"""Orthogonalizes a matrix of targets :math:`{\mathbf{Y}}` given a reference
91+
feature matrix :math:`{\mathbf{X}_r}` and reference target matrix
92+
:math:`{\mathbf{Y}_r}`:
9393
9494
.. math::
95-
\\mathbf{Y} \\leftarrow \\mathbf{Y} -
96-
\\mathbf{X} \\left(\\mathbf{X}_{\\mathbf{r}}^T
97-
\\mathbf{X}_{\\mathbf{r}}\\right)^{-1}\\mathbf{X}_{\\mathbf{r}}^T
98-
\\mathbf{Y}_{\\mathbf{r}}
95+
\mathbf{Y} \leftarrow \mathbf{Y} -
96+
\mathbf{X} \left(\mathbf{X}_{\mathbf{r}}^T
97+
\mathbf{X}_{\mathbf{r}}\right)^{-1}\mathbf{X}_{\mathbf{r}}^T
98+
\mathbf{Y}_{\mathbf{r}}
9999
100100
Parameters
101101
----------

Diff for: tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ commands =
6565
black --check --diff {[tox]lint_folders}
6666
blackdoc --check --diff {[tox]lint_folders}
6767
isort --check-only --diff {[tox]lint_folders}
68-
sphinx-lint --enable line-too-long --max-line-length 88 \
68+
sphinx-lint --enable all --max-line-length 88 \
6969
-i "{toxinidir}/docs/src/examples" \
7070
{[tox]lint_folders} "{toxinidir}/README.rst"
7171

0 commit comments

Comments
 (0)