Skip to content

Commit df1f3b1

Browse files
PicoCentauriagoscinski
authored andcommitted
Cleanup docstrings and add basic docs-linter
1 parent a5e815e commit df1f3b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+900
-1455
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ __pycache__
1010
build/
1111
dist/
1212
docs/src/examples
13+
sg_execution_times.rst

examples/reconstruction/PlotGFRE.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44
"""
55
Global Feature Reconstruction Error (GFRE) and Distortion (GFRD)
66
================================================================
7-
8-
Example for the usage of the :class:`skmatter.metrics.global_reconstruction_error`
9-
as global feature reconstruction error (GFRE) and
7+
Example for the usage of the :class:`skmatter.metrics.global_reconstruction_error` as
8+
global feature reconstruction error (GFRE) and
109
:class:`skmatter.metrics.global_reconstruction_distortion` global feature reconstruction
11-
distortion (GFRD). We apply the global reconstruction measures on the degenerate
12-
CH4 manifold dataset. This dataset was specifically constructed to be
13-
representable by a 4-body features (bispectrum) but not by a 3-body features
14-
(power spectrum). In other words the dataset contains environments which are
15-
different, but have the same 3-body features. For more details about the dataset
16-
please refer to `Pozdnyakov 2020 <https://doi.org/10.1103/PhysRevLett.125.166001>`_.
10+
distortion (GFRD). We apply the global reconstruction measures on the degenerate CH4
11+
manifold dataset. This dataset was specifically constructed to be representable by a
12+
4-body features (bispectrum) but not by a 3-body features (power spectrum). In other
13+
words the dataset contains environments which are different, but have the same 3-body
14+
features. For more details about the dataset please refer to `Pozdnyakov 2020
15+
<https://doi.org/10.1103/PhysRevLett.125.166001>`_.
1716
1817
The ``skmatter`` dataset already contains the 3 and 4-body features computed with
19-
`librascal <https://github.com/lab-cosmo/librascal>`_ so we can load it and
20-
compare it with the GFRE/GFRD.
18+
`librascal <https://github.com/lab-cosmo/librascal>`_ so we can load it and compare it
19+
with the GFRE/GFRD.
2120
"""
2221
# %%
2322
#

examples/reconstruction/PlotLFRE.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
Pointwise Local Reconstruction Error
55
====================================
6-
76
Example for the usage of the
87
:class:`skmatter.metrics.pointwise_local_reconstruction_error` as pointwise local
98
reconstruction error (LFRE) on the degenerate CH4 manifold. We apply the local
@@ -14,9 +13,9 @@
1413
dataset please refer to `Pozdnyakov 2020
1514
<https://doi.org/10.1103/PhysRevLett.125.166001>`_.
1615
17-
The skmatter dataset already contains the 3 and 4-body features computed with
18-
`librascal <https://github.com/lab-cosmo/librascal>`_ so we can load it and compare it
19-
with the LFRE.
16+
The skmatter dataset already contains the 3 and 4-body features computed with `librascal
17+
<https://github.com/lab-cosmo/librascal>`_ so we can load it and compare it with the
18+
LFRE.
2019
"""
2120
# %%
2221
#

examples/reconstruction/PlotPointwiseGFRE.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
"""
55
Pointwise GFRE applied on RKHS features
6-
================================================================
7-
6+
=======================================
87
Example for the usage of the
98
:class:`skmatter.metrics.pointwise_global_reconstruction_error` as the pointwise global
109
feature reconstruction error (pointwise GFRE). We apply the pointwise global feature

examples/regression/OrthogonalRegressionNonAnalytic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
r"""
44
Regression with orthogonal projector/matrices
55
=============================================
6-
76
In this example, we explain how when using
87
:class:`skmatter.linear_model.OrthogonalRegression` the option
98
``use_orthogonal_projector`` can result in non-analytic behavior. In

examples/regression/Ridge2FoldCVRegularization.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# %%
22

33
r"""
4-
Ridge2FoldCV for data with low effective rank
5-
=======================================================
6-
In this notebook we explain in more detail how
7-
:class:`skmatter.linear_model.Ridge2FoldCV` speeds up the
8-
cross-validation optimizing the regularitzation parameter :param alpha: and
9-
compare it with existing solution for that in scikit-learn
10-
:class:`slearn.linear_model.RidgeCV`.
11-
:class:`skmatter.linear_model.Ridge2FoldCV` was designed to predict
12-
efficiently feature matrices, but it can be also useful for the prediction
13-
single targets.
4+
Ridge2FoldCV for data with low effective rank
5+
=============================================
6+
In this notebook we explain in more detail how
7+
:class:`skmatter.linear_model.Ridge2FoldCV` speeds up the cross-validation optimizing
8+
the regularitzation parameter :param alpha: and compare it with existing solution for
9+
that in scikit-learn :class:`slearn.linear_model.RidgeCV`.
10+
:class:`skmatter.linear_model.Ridge2FoldCV` was designed to predict efficiently feature
11+
matrices, but it can be also useful for the prediction single targets.
1412
"""
1513
# %%
1614
#
@@ -128,6 +126,7 @@
128126

129127

130128
def micro_bench(ridge):
129+
"""A small benchmark function."""
131130
global N_REPEAT_MICRO_BENCH, X, y
132131
timings = []
133132
train_mse = []
@@ -177,6 +176,7 @@ def micro_bench(ridge):
177176

178177

179178
def get_train_test_error(estimator):
179+
"""The train tets error based on the estimator."""
180180
global X_train, y_train, X_test, y_test
181181
estimator = estimator.fit(X_train, y_train)
182182
return (

0 commit comments

Comments
 (0)