Skip to content

Commit 610a5c4

Browse files
committed
Cleanup rst files
- Add linter for sphinx rst files - Remove trailing spaces - Convert README.md to README.rst (Preparations for later code sharing between REDME and docs) - Use 88 chars/line for rst files
1 parent 9139358 commit 610a5c4

21 files changed

+352
-281
lines changed

README.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

README.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
scikit-matter
2+
=============
3+
4+
|tests| |codecov| |docs| |pypi| |conda| |docs|
5+
6+
A collection of scikit-learn compatible utilities that implement methods born out of the
7+
materials science and chemistry communities.
8+
9+
Installation
10+
------------
11+
12+
You can install *scikit-matter* either via pip using
13+
14+
.. code-block:: bash
15+
16+
pip install skmatter
17+
18+
19+
or conda
20+
21+
.. code-block:: bash
22+
23+
conda install -c conda-forge skmatter
24+
25+
26+
You can then `import skmatter` in your code!
27+
28+
Developing the package
29+
----------------------
30+
31+
Start by installing the development dependencies:
32+
33+
.. code-block:: bash
34+
35+
pip install tox black flake8
36+
37+
38+
Then this package itself
39+
40+
.. code-block:: bash
41+
42+
git clone https://github.com/lab-cosmo/scikit-matter
43+
cd scikit-matter
44+
pip install -e .
45+
46+
47+
This install the package in development mode, making is ``import`` able globally and
48+
allowing you to edit the code and directly use the updated version.
49+
50+
Running the tests
51+
^^^^^^^^^^^^^^^^^
52+
53+
.. code-block:: bash
54+
55+
cd <scikit-matter PATH>
56+
# run unit tests
57+
tox
58+
# run the code formatter
59+
black --check .
60+
# run the linter
61+
flake8
62+
63+
64+
You may want to setup your editor to automatically apply the `black`_ code formatter
65+
when saving your files, there are plugins to do this with `all major editors`_.
66+
67+
License and developers
68+
----------------------
69+
70+
This project is distributed under the BSD-3-Clauses license. By contributing to it you
71+
agree to distribute your changes under the same license.
72+
73+
.. _`black`: https://black.readthedocs.io/en/stable/
74+
.. _`all major editors`: https://black.readthedocs.io/en/stable/editor_integration.html
75+
76+
.. |tests| image:: https://github.com/lab-cosmo/scikit-matter/workflows/Test/badge.svg
77+
:alt: Github Actions Tests Job Status
78+
:target: https://github.com/lab-cosmo/scikit-matter/actions?query=workflow%3ATests
79+
80+
.. |codecov| image:: https://codecov.io/gh/lab-cosmo/scikit-matter/branch/main/graph/badge.svg?token=UZJPJG34SM
81+
:alt: Code coverage
82+
:target: https://codecov.io/gh/lab-cosmo/scikit-matter/
83+
84+
.. |pypi| image:: https://img.shields.io/pypi/v/skmatter.svg
85+
:alt: Latest PYPI version
86+
:target: https://pypi.org/project/skmatter
87+
88+
.. |conda| image:: https://anaconda.org/conda-forge/skmatter/badges/version.svg
89+
:alt: Latest conda version
90+
:target: https://anaconda.org/conda-forge/skmatter
91+
92+
.. |docs| image:: https://img.shields.io/badge/documentation-latest-sucess
93+
:alt: Documentation
94+
:target: https://scikit-matter.readthedocs.io

docs/src/bibliography.rst

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,39 @@ References
33

44
.. [deJong1992]
55
S. de Jong, H.A.L. Kiers,
6-
"Principal covariates regression: Part I. Theory",
7-
Chemom. intell. lab. syst. 14 (1992) 155-164
8-
https://doi.org/10.1016/0169-7439(92)80100-I
6+
"Principal covariates regression: Part I. Theory", Chemom. intell. lab. syst. 14
7+
(1992) 155-164 https://doi.org/10.1016/0169-7439(92)80100-I
98
109
.. [Imbalzano2018]
11-
Giulio Imbalzano, Andrea Anelli, Daniele Giofré, Sinja Klees, Jörg Behler, and Michele Ceriotti,
12-
“Automatic selection of atomic fingerprints and reference configurations for machine-learning potentials.”
13-
The Journal of chemical physics 148 24 (2018): 241730.
14-
https://aip.scitation.org/doi/10.1063/1.5024611.
10+
Giulio Imbalzano, Andrea Anelli, Daniele Giofré,Sinja Klees, Jörg Behler, and
11+
Michele Ceriotti, “Automatic selection of atomic fingerprints and reference
12+
configurations for machine-learning potentials.” The Journal of chemical physics 148
13+
24 (2018): 241730. https://aip.scitation.org/doi/10.1063/1.5024611.
1514
1615
.. [Ceriotti2019]
17-
Michele Ceriotti, Lyndon Emsley, Federico Paruzzo, Albert Hofstetter, Félix Musil, Sandip De, Edgar A. Engel, and Andrea Anelli.
18-
"Chemical Shifts in Molecular Solids by Machine Learning Datasets",
19-
Materials Cloud Archive 2019.0023/v2 (2019),
16+
Michele Ceriotti, Lyndon Emsley, Federico Paruzzo, Albert Hofstetter, Félix Musil,
17+
Sandip De, Edgar A. Engel, and Andrea Anelli. "Chemical Shifts in Molecular Solids
18+
by Machine Learning Datasets", Materials Cloud Archive 2019.0023/v2 (2019),
2019
https://doi.org/10.24435/materialscloud:2019.0023/v2.
2120
2221
.. [Helfrecht2020]
2322
Benjamin A Helfrecht, Rose K Cersonsky, Guillaume Fraux, and Michele Ceriotti,
24-
"Structure-property maps with Kernel principal covariates regression."
25-
2020 Mach. Learn.: Sci. Technol. 1 045021.
23+
"Structure-property maps with Kernel principal covariates regression." 2020 Mach.
24+
Learn.: Sci. Technol. 1 045021.
2625
https://iopscience.iop.org/article/10.1088/2632-2153/aba9ef.
2726
2827
.. [Pozdnyakov2020]
29-
Pozdnyakov, S. N., Willatt, M. J., Bartók, A. P., Ortner, C., Csányi, G., & Ceriotti, M. (2020).
30-
"Incompleteness of Atomic Structure Representations."
31-
Physical Review Letters, 125(16).
32-
https://doi.org/10.1103/physrevlett.125.166001
28+
Pozdnyakov, S. N., Willatt, M. J., Bartók, A. P., Ortner, C., Csányi, G., &
29+
Ceriotti, M. (2020). "Incompleteness of Atomic Structure Representations." Physical
30+
Review Letters, 125(16). https://doi.org/10.1103/physrevlett.125.166001
3331
3432
.. [Goscinski2021]
35-
Alexander Goscinski, Guillaume Fraux, Giulio Imbalzano, and Michele Ceriotti,
36-
"The role of feature space in atomistic learning."
37-
2021 Mach. Learn.: Sci. Technol. 2 025028.
38-
https://iopscience.iop.org/article/10.1088/2632-2153/abdaf7.
33+
Alexander Goscinski, Guillaume Fraux, Giulio Imbalzano, and Michele Ceriotti, "The
34+
role of feature space in atomistic learning." 2021 Mach. Learn.: Sci. Technol. 2
35+
025028. https://iopscience.iop.org/article/10.1088/2632-2153/abdaf7.
3936
4037
.. [Cersonsky2021]
41-
Rose K Cersonsky, Benjamin A Helfrecht, Edgar A. Engel, Sergei Kliavinek, and Michele Ceriotti,
42-
"Improving Sample and Feature Selection with Principal Covariates Regression"
43-
2021 Mach. Learn.: Sci. Technol. 2 035038.
38+
Rose K Cersonsky, Benjamin A Helfrecht, Edgar A. Engel, Sergei Kliavinek, and
39+
Michele Ceriotti, "Improving Sample and Feature Selection with Principal Covariates
40+
Regression" 2021 Mach. Learn.: Sci. Technol. 2 035038.
4441
https://iopscience.iop.org/article/10.1088/2632-2153/abfe7c.

docs/src/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
master_doc = "index"
6565

6666
project = "scikit-matter"
67-
author = ", ".join(open(os.path.join(ROOT, "contributors.txt")))
67+
author = ", ".join(open(os.path.join(ROOT, "contributors.txt")).read().splitlines())
6868
copyright = f"{datetime.now().date().year}, {author}"
6969

7070
# The full version, including alpha/beta/rc tags

docs/src/contributing.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ Then this package itself
1818
cd scikit-matter
1919
pip install -e .
2020
21-
This install the package in development mode, making it importable globally
22-
and allowing you to edit the code and directly use the updated version.
21+
This install the package in development mode, making it importable globally and allowing
22+
you to edit the code and directly use the updated version.
2323

2424
Running the tests
2525
#################
2626

27-
The testsuite is implemented using Python's `unittest`_ framework and should be set-up and
28-
run in an isolated virtual environment with `tox`_. All tests can be run with
27+
The testsuite is implemented using Python's `unittest`_ framework and should be set-up
28+
and run in an isolated virtual environment with `tox`_. All tests can be run with
2929

3030
.. code-block:: bash
3131
@@ -40,11 +40,11 @@ If you wish to test only specific functionalities, for example:
4040
tox -e examples # test the examples
4141
4242
43-
You can also use ``tox -e format`` to use tox to do actual formatting instead
44-
of just testing it. Also, you may want to setup your editor to automatically apply the
45-
`black <https://black.readthedocs.io/en/stable/>`_ code formatter when saving your
46-
files, there are plugins to do this with `all major
47-
editors <https://black.readthedocs.io/en/stable/editor_integration.html>`_.
43+
You can also use ``tox -e format`` to use tox to do actual formatting instead of just
44+
testing it. Also, you may want to setup your editor to automatically apply the `black
45+
<https://black.readthedocs.io/en/stable/>`_ code formatter when saving your files, there
46+
are plugins to do this with `all major editors
47+
<https://black.readthedocs.io/en/stable/editor_integration.html>`_.
4848

4949
.. _unittest: https://docs.python.org/3/library/unittest.html
5050
.. _tox: https://tox.readthedocs.io/en/latest
@@ -60,9 +60,8 @@ machine as described above. Then, build the documentation with
6060
6161
tox -e docs
6262
63-
You can then visualize the local documentation with your favorite browser using
64-
the following command (or open the :file:`docs/build/html/index.html` file
65-
manually).
63+
You can then visualize the local documentation with your favorite browser using the
64+
following command (or open the :file:`docs/build/html/index.html` file manually).
6665

6766
.. code-block:: bash
6867
@@ -172,8 +171,8 @@ Then, show ``scikit-matter`` how to load your data by adding a loader function t
172171
173172
Add this function to ``src/skmatter/datasets/__init__.py``.
174173

175-
Finally, add a test to ``tests/test_datasets.py`` to see that your dataset
176-
loads properly. It should look something like this:
174+
Finally, add a test to ``tests/test_datasets.py`` to see that your dataset loads
175+
properly. It should look something like this:
177176

178177
.. code-block:: python
179178
@@ -190,7 +189,8 @@ loads properly. It should look something like this:
190189
self.my_data.DESCR
191190
192191
193-
You're good to go! Time to submit a `pull request. <https://github.com/lab-cosmo/scikit-matter/pulls>`_
192+
You're good to go! Time to submit a `pull request.
193+
<https://github.com/lab-cosmo/scikit-matter/pulls>`_
194194

195195

196196
License

docs/src/datasets.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ Datasets
77

88
.. include:: ../../src/skmatter/datasets/descr/nice_dataset.rst
99

10-
.. include:: ../../src/skmatter/datasets/descr/who_dataset.rst
11-
10+
.. include:: ../../src/skmatter/datasets/descr/who_dataset.rst

docs/src/gfrm.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Reconstruction Measures
1111
Global Reconstruction Error
1212
###########################
1313

14-
.. autofunction:: pointwise_global_reconstruction_error
15-
.. autofunction:: global_reconstruction_error
14+
.. autofunction:: pointwise_global_reconstruction_error
15+
.. autofunction:: global_reconstruction_error
1616

1717
.. _GRD-api:
1818

19-
Global Reconstruction Distortion
19+
Global Reconstruction Distortion
2020
################################
2121

2222
.. autofunction:: pointwise_global_reconstruction_distortion

docs/src/index.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
scikit-matter documentation
22
===========================
33

4-
``scikit-matter`` is a collection of `scikit-learn <https://scikit.org/>`_
5-
compatible utilities that implement methods born out of the materials science
6-
and chemistry communities.
4+
``scikit-matter`` is a collection of `scikit-learn <https://scikit.org/>`_ compatible
5+
utilities that implement methods born out of the materials science and chemistry
6+
communities.
77

8-
Convenient-to-use libraries such as scikit-learn have accelerated the adoption and application
9-
of machine learning (ML) workflows and data-driven methods. Such libraries have gained great
10-
popularity partly because the implemented methods are generally applicable in multiple domains.
11-
While developments in the atomistic learning community have put forward general-use machine
12-
learning methods, their deployment is commonly entangled with domain-specific functionalities,
13-
preventing access to a wider audience.
8+
Convenient-to-use libraries such as scikit-learn have accelerated the adoption and
9+
application of machine learning (ML) workflows and data-driven methods. Such libraries
10+
have gained great popularity partly because the implemented methods are generally
11+
applicable in multiple domains. While developments in the atomistic learning community
12+
have put forward general-use machine learning methods, their deployment is commonly
13+
entangled with domain-specific functionalities, preventing access to a wider audience.
1414

1515
scikit-matter targets domain-agnostic implementations of methods developed in the
16-
computational chemical and materials science community, following the
17-
scikit-learn API and coding guidelines to promote usability and interoperability
18-
with existing workflows. scikit-matter contains a toolbox of methods for
19-
unsupervised and supervised analysis of ML datasets, including the comparison,
20-
decomposition, and selection of features and samples.
16+
computational chemical and materials science community, following the scikit-learn API
17+
and coding guidelines to promote usability and interoperability with existing workflows.
18+
scikit-matter contains a toolbox of methods for unsupervised and supervised analysis of
19+
ML datasets, including the comparison, decomposition, and selection of features and
20+
samples.
2121

2222
.. toctree::
2323
:maxdepth: 1

0 commit comments

Comments
 (0)