Skip to content

Commit bc41504

Browse files
authored
Merge pull request #851 from zerothi/doc-changes
major restructure of the documentation
2 parents 614aadb + 1970caf commit bc41504

28 files changed

+195
-67
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
- [ ] Closes #
44
- [ ] Added tests for new/changed functions?
5-
- [ ] Ran `isort .` and `black .` [24.2.0] at top-level
65
- [ ] Documentation for functionality in `docs/`
76
- [ ] Changes documented in `CHANGELOG.md`
7+
8+
<!--
9+
Creating a PR will check whether the pre-commit hooks
10+
have runned, and if it fails, you should do this manually.
11+
12+
Please see here: https://zerothi.github.io/sisl/contribute.html
13+
on how to enable the pre-commit hooks enabled in `sisl`
14+
15+
The short message is:
16+
- run `isort .` at the top level
17+
- run `black .` (version=24.2.0) at top-level
18+
-->

.pre-commit-config.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
# If pre-commit does some modification, the commit will fail. Add the
99
# changes done by pre-commit and commit again.
1010
repos:
11-
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.5.0
13-
hooks:
14-
- id: check-yaml
15-
- id: end-of-file-fixer
16-
- id: trailing-whitespace
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v4.5.0
13+
hooks:
14+
- id: check-yaml
15+
- id: end-of-file-fixer
16+
- id: trailing-whitespace
1717
# Black to format code with a consistent style
1818
- repo: https://github.com/psf/black-pre-commit-mirror
1919
rev: 24.2.0
@@ -44,3 +44,8 @@ repos:
4444
- --license-filepath
4545
- .LICENSE_header
4646
- --no-extra-eol
47+
#Validate our CITATION.cff
48+
- repo: https://github.com/citation-file-format/cff-converter-python
49+
rev: ebf0b5e44d67f8beaa1cd13a0d0393ea04c6058d
50+
hooks:
51+
- id: validate-cff

docs/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
# General information about the project.
7272
project = "sisl"
73-
author = "Nick Papior"
73+
author = "sisl developers"
7474
copyright = f"2015-{date.today().year}, {author}"
7575

7676

@@ -92,6 +92,8 @@
9292
"sphinx.ext.todo",
9393
# allows to view code directly in the homepage
9494
"sphinx.ext.viewcode",
95+
# Enable redirections
96+
"sphinxext.rediraffe",
9597
# toggle-button on info/warning/...
9698
"sphinx_togglebutton",
9799
# allow copybutton on code-blocks
@@ -375,6 +377,12 @@ def has_no_under(name: str):
375377
html_use_index = True
376378

377379

380+
# Redirects of moved pages
381+
rediraffe_redirects = {
382+
"contribute.rst": "dev/index.rst",
383+
"visualization/viz_module/index.rst": "visualization/viz/index.rst",
384+
}
385+
378386
latex_elements = {
379387
# The paper size ('letterpaper' or 'a4paper').
380388
"papersize": "a4paper",
@@ -390,7 +398,7 @@ def has_no_under(name: str):
390398
# (source start file, target name, title,
391399
# author, documentclass [howto, manual, or own class]).
392400
latex_documents = [
393-
("index", "sisl.tex", "sisl Documentation", "Nick Papior", "manual"),
401+
("index", "sisl.tex", project, author, "manual"),
394402
]
395403

396404
#####

docs/contribute.rst

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

docs/dev/index.rst

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
2+
.. _devindex:
3+
4+
Contributing to sisl
5+
====================
6+
7+
The sisl code is open-source, and thus we encourage external users to contribute
8+
back to the code base.
9+
10+
Even if you are a non-coder, your contributions are valuable to the community!
11+
Please do remember that open-source projects benefits from interaction!
12+
13+
There are many aspects of useful contributions:
14+
15+
- Code maintenance and development
16+
- Creating tutorials and extending documentation
17+
- Finding bugs or typos
18+
- Development of the website
19+
- Missing a useful feature
20+
21+
We understand that people have different backgrounds, and thus different
22+
experience in coding. We try to engage as much as possible with ticket creators.
23+
24+
In the following of this document you will find information related to the specifics
25+
of making a development workflow for `sisl`.
26+
27+
28+
29+
Summary of development process
30+
------------------------------
31+
32+
33+
Here is a short summary of how to do developments with `sisl`.
34+
35+
36+
1. If you are a first time contributor, you need to clone your repository
37+
and setup a few things.
38+
39+
The procedure enables one to follow the upstream changes, while simultaneously
40+
have a fork where one has write access.
41+
42+
* Go to `github.com/zerothi/sisl <sisl-git_>`_ and click the "fork" button to
43+
create your own copy of the code base.
44+
45+
* Clone the fork to your local machine:
46+
47+
.. code:: bash
48+
49+
git clone https://github.com/<your-username>/sisl.git
50+
51+
* Add the upstream repository:
52+
53+
.. code:: bash
54+
55+
git remote add upstream https://github.com/zerothi/sisl.git
56+
57+
* Enable the `pre-commit <https://pre-commit.com>`_ hooks
58+
59+
.. code:: bash
60+
61+
python -m pip install pre-commit
62+
pre-commit install
63+
64+
This will run specific checks before you commit things to the repo.
65+
It ensures a consistency in the project.
66+
67+
2. Installing the project in development mode.
68+
69+
It is adviced to instal the project in *editable* mode for faster
70+
turn-around times.
71+
Please follow :ref:`these instructions <installation-testing>`.
72+
73+
3. Developing your contribution.
74+
75+
First start by ensuring you have the latest changes on the ``main``
76+
branch.
77+
78+
.. code:: bash
79+
80+
git checkout main
81+
git pull upstream main
82+
83+
If you are fixing an already opened issue (say :issue:`42`) it is adviced
84+
to name your branch according to the issue number following a sensible name:
85+
86+
.. code:: bash
87+
88+
git checkout -b 42-enhancing-doc
89+
90+
If no issue has been created, then just name it sensibly.
91+
92+
Do all your commits locally as you progress.
93+
94+
Be sure to document your changes, and write sensible documentation
95+
for the API.
96+
97+
4. To submit your contribution:
98+
99+
* Push your changes back to your fork on GitHub:
100+
101+
.. code:: bash
102+
103+
git push origin 42-enhancing-doc
104+
105+
* Go to `sisl's pull request site <pr_>`_.
106+
The new branch will show up with a green Pull Request
107+
button. Make sure the title and message are clear, concise, and self-
108+
explanatory. Then click the button to submit it.
109+
110+
5. Review process.
111+
112+
The maintainers of `sisl` will do their best to respond as fast as possible.
113+
But first ensure that the CI runs successfully, if not, maintainers will likely
114+
wait untill it succeeds before taking any action.
115+
116+
117+
Contribute external code
118+
------------------------
119+
120+
External toolbox codes may be contributed `here <issue_>`_, then press
121+
"Issue" and select *Contribute toolbox*.
122+
123+
There are two cases of external contributions:
124+
125+
1. If the code is directly integratable into sisl it will be merged into the sisl source.
126+
127+
2. If the code is showing how to use sisl to calculate some physical quantity but is not a general
128+
implementation, it will be placed in toolbox directory.
129+
130+
Either way, any contribution is very welcome.
131+
132+
133+
134+
Contribute additional tests
135+
---------------------------
136+
137+
Additional test files should be added to `this repository <sisl-files_>`_.
138+
Please follow the guidelines there, or open up an issue at that repository
139+
for specific details.

docs/index.rst

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,46 +67,45 @@ Since then it has expanded to accommodate a rich set of DFT code input/outputs.
6767
.. toctree::
6868
:hidden:
6969
:maxdepth: 2
70-
:caption: User Guide
70+
:caption: Getting started
7171

7272
introduction
7373
quickstart/index
74-
tutorials/index
75-
scripts/index
76-
environment
77-
math
74+
cite
7875

7976
.. toctree::
8077
:hidden:
8178
:maxdepth: 2
82-
:caption: Visualization
79+
:caption: User Guide
8380

84-
visualization/viz_module/index
85-
visualization/ase/index
81+
tutorials/index
82+
visualization/viz/index
83+
scripts/index
8684

8785
.. toctree::
8886
:hidden:
8987
:maxdepth: 2
90-
:caption: Toolboxes
88+
:caption: Advanced usage
9189

90+
api/index
91+
environment
9292
toolbox/index
9393

9494
.. toctree::
9595
:hidden:
9696
:maxdepth: 2
97-
:caption: Development details
97+
:caption: Development
9898

99-
contribute
100-
changelog/index
101-
cite
102-
other
99+
dev/index
103100

104101
.. toctree::
105102
:hidden:
106103
:maxdepth: 3
107-
:caption: Reference documentation
104+
:caption: Extras
108105

109-
api/index
106+
math
107+
changelog/index
108+
other
110109
references
111110

112111

docs/other.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. _other:
22

3-
Similar solutions
3+
Related software
44
=================
55

66
One of `sisl`'s goals is an easy interaction between a variety of DFT simulations, much like `ASE`_ with
@@ -11,9 +11,9 @@ calculations.
1111
However, `sisl` is far from the only Python package that implements simplistic tight-binding calculations.
1212
We are currently aware of 3 established tight-binding methods used in literature (in random order):
1313

14-
- `PythTB <http://physics.rutgers.edu/pythtb/index.html>`_
14+
- `PythTB <http://physics.rutgers.edu/pythtb/index.html>`__
1515
- `kwant`_
16-
- `pybinding <http://pybinding.site/>`_
16+
- `pybinding <http://pybinding.site/>`__
1717
- `ASE`_
1818

1919
`sisl`'s philosophy is drastically different in the sense that the Hamiltonian (and other

docs/references.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _references:
22

3-
References
4-
==========
3+
Bibliography
4+
============
55

66
.. create the bibliography will all references.
77
We may still use local footnote bib's for clarity.

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ sphinx-copybutton
1717
sphinx-togglebutton
1818
sphinx-inline-tabs
1919
sphinxcontrib-bibtex
20+
sphinxext-rediraffe
2021
importlib-metadata
2122
ipywidgets
2223
jupyterlab-widgets

0 commit comments

Comments
 (0)