Skip to content

Commit

Permalink
Final improvement docs to v1.0 (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
prisae authored May 27, 2021
1 parent 765c8a5 commit a58a95c
Show file tree
Hide file tree
Showing 44 changed files with 1,391 additions and 506 deletions.
33 changes: 33 additions & 0 deletions docs/_static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* "emsig"-colours
blue : #447fc1
blue-lighter : #61a2d8
blue-darker : #285985
red : #ef413d
*/

/* Button colours */

.btn-info {
font-weight: bold;
background: #447fc1;
border-color: #447fc1;
}

.btn-info:hover {
background: #ef413d;
border-color: #ef413d;
}

/* Card headers */
.card-header {
font-size: var(--pst-font-size-h5);
font-weight: bold;
padding: 1rem 2rem;
text-align: center;
}

/* fa stuff */
.fa {
margin: 0 1rem 0 0;
color: #ef413d;
}
39 changes: 31 additions & 8 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ API reference
.. module:: emg3d

.. toctree::
:maxdepth: 1
:maxdepth: 2
:hidden:

core
Expand All @@ -29,11 +29,34 @@ API reference
time
utils

Direct links to the main user-facing functions and classes:

- Grid: :class:`emg3d.meshes.TensorMesh`
- Model: :class:`emg3d.models.Model`
- Survey: :class:`emg3d.surveys.Survey`
- Simulation: :class:`emg3d.simulations.Simulation`
- Solver: :func:`emg3d.solver.solve`
- All sources and receivers are in :mod:`emg3d.electrodes`
.. panels::
:container: container-lg pb-1
:column: col-lg-12 p-2

Grid: :class:`emg3d.meshes.TensorMesh`

---
:column: col-lg-12 p-2

Model: :class:`emg3d.models.Model`

---
:column: col-lg-12 p-2

Survey: :class:`emg3d.surveys.Survey`

---
:column: col-lg-12 p-2

Simulation: :class:`emg3d.simulations.Simulation`

---
:column: col-lg-12 p-2

Solver: :func:`emg3d.solver.solve`

---
:column: col-lg-12 p-2

All sources and receivers are in :mod:`emg3d.electrodes`
13 changes: 10 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
extensions = [
# 'sphinx.ext.autodoc',
'numpydoc',
'sphinx_panels',
'sphinx.ext.intersphinx',
# 'sphinx.ext.autosummary',
'sphinx.ext.mathjax',
Expand All @@ -18,6 +19,7 @@
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive',
]
panels_add_bootstrap_css = False
autosummary_generate = True
add_module_names = True
add_function_parentheses = False
Expand Down Expand Up @@ -55,7 +57,7 @@

# General information about the project.
project = 'emg3d'
author = 'The EMSiG community'
author = 'The emsig community'
copyright = f'2018-{time.strftime("%Y")}, {author}'

# |version| and |today| tags (|release|-tag is not used).
Expand All @@ -78,8 +80,8 @@
html_theme_options = {
"github_url": "https://github.com/emsig/emg3d",
"external_links": [
{"name": "Gallery", "url": "https://dev1.emsig.xyz/gallery/gallery"},
{"name": "EMSiG", "url": "https://emsig.xyz"},
{"name": "Gallery", "url": "https://emsig.xyz/emg3d-gallery/gallery"},
{"name": "emsig", "url": "https://emsig.xyz"},
],
# "use_edit_page_button": True,
}
Expand All @@ -94,6 +96,11 @@
html_use_modindex = True
html_file_suffix = '.html'
htmlhelp_basename = 'emg3d'
html_css_files = [
"style.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/" +
"css/font-awesome.min.css"
]

# ==== 4. linkcheck ====

Expand Down
38 changes: 19 additions & 19 deletions docs/dev/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
.. _dev-contributing:

Contributing
============

.. todo::
emg3d is a community code, and contributions of any kind are welcomed: From
typos in the documentation to additional examples, reporting or fixing bugs in
the code, all the way to new suggestion or implementing new features.

Good places to get started is to browse the existing issues, check out the
roadmap, or have a look at any open PR:

Rework this for version 1.
- `Issues <https://github.com/emsig/emg3d/issues>`_;
- `Roadmap-project <https://github.com/emsig/emg3d/projects/1>`_;
- `PR's <https://github.com/emsig/emg3d/pulls>`_.

New contributions, bug reports, or any kind of feedback is always welcomed!
Have a look at the `Roadmap-project
<https://github.com/emsig/emg3d/projects/1>`_ to get an idea of things that
could be implemented. The GitHub `issues
<https://github.com/emsig/emg3d/issues>`_ and
`PR's <https://github.com/emsig/emg3d/pulls>`_ are also a good starting
point. The best way for interaction is at https://github.com/emsig or by
joining the `Slack channel <http://slack.simpeg.xyz>`_ «em-x-d» of SimPEG. If
you prefer to get in touch outside of GitHub/Slack use the contact form on
https://werthmuller.org.
There are various different ways to get in touch, see
`emsig.xyz#contributing-contact <https://emsig.xyz/#contributing-contact>`_.

To install emg3d from source, you can download the latest version from GitHub
and install it in your python distribution via:
If you think about making changes to the code and contribute code have a look
at :doc:`tests`

.. code-block:: console

make install
.. note::

Please make sure your code follows the pep8-guidelines by using, for instance,
the python module ``flake8``, and also that your code is covered with
appropriate tests. Just get in touch if you have any doubts.
The community is tiny so far, so there are no former protocols (such as
CoC) in place (yet). Please get in touch if you think it is about time to
implement those.
41 changes: 39 additions & 2 deletions docs/dev/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,46 @@ Development

.. toctree::
:maxdepth: 2
:hidden:

contributing
tests_benchmarks
tests
maintenance
making_a_release
release

.. panels::
:container: container-lg pb-2 text-center

:fa:`code,fa-4x`

.. link-button:: contributing
:type: ref
:text: Contributing
:classes: btn-link stretched-link font-weight-bold

---

:fa:`fas fa-hourglass-half,fa-4x`

.. link-button:: tests
:type: ref
:text: Tests & Benchmarks
:classes: btn-link stretched-link font-weight-bold

---

:fa:`cogs,fa-4x`

.. link-button:: maintenance
:type: ref
:text: Maintenance
:classes: btn-link stretched-link font-weight-bold

---

:fa:`rocket,fa-4x`

.. link-button:: release
:type: ref
:text: Making a release
:classes: btn-link stretched-link font-weight-bold
12 changes: 8 additions & 4 deletions docs/dev/maintenance.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Maintenance
===========

.. todo::

Rework this for version 1.
Status reports and other tools to have the checks all in one place, for quick
QC.

Quick overview / QC
-------------------

All possible badges of the CI chain. Definitely check this before making a
release.

- .. image:: https://github.com/emsig/emg3d/actions/workflows/linux.yml/badge.svg
:target: https://github.com/emsig/emg3d/actions/workflows/linux.yml
:alt: GitHub Actions linux
Expand Down Expand Up @@ -57,10 +59,12 @@ Quick overview / QC
Info from ReadTheDocs
---------------------

To check the environment in which the documentation was built.

.. ipython::

In [1]: import emg3d
...: emg3d.Report(
...: ['sphinx', 'numpydoc', 'ipykernel', 'sphinx_numfig',
...: 'sphinx_automodapi', 'pydata_sphinx_theme']
...: 'sphinx_panels', 'sphinx_automodapi', 'pydata_sphinx_theme']
...: )
80 changes: 41 additions & 39 deletions docs/dev/making_a_release.rst → docs/dev/release.rst
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
Making a release
================

.. todo::

Rework this for version 1.
Making a release is by now straight forward. Creating a «New Release» on GitHub
will trigger all the required things. However, there are still a few things to
do beforehand and a few things to check afterwards.

1. Update ``CHANGELOG.rst``.

2. Push it to GitHub, create a release tagging it.

3. Tagging it on GitHub will automatically deploy it to PyPi, which in turn
will create a PR for the conda-forge `feedstock
<https://github.com/conda-forge/emg3d-feedstock>`_. Merge that PR.
<https://github.com/conda-forge/emg3d-feedstock>`_. The PR will be
automatically merged. (Note: if the dependencies change or the minimum
Python version or other installation things then the feedstock has to be
updated manually!)

4. Check that:
4. After releasing it, check that:

- `PyPi <https://pypi.org/project/emg3d>`_ deployed;
- `conda-forge <https://anaconda.org/conda-forge/emg3d>`_ deployed;
- `Zenodo <https://doi.org/10.5281/zenodo.3229006>`_ minted a DOI;
- `emg3d.emsig.xyz <https://emg3d.emsig.xyz>`_ created a tagged version.


Useful things
-------------

- If there were changes to README, check it with::

python setup.py --long-description | rst2html.py --no-raw > index.html

- If unsure, test it first on testpypi (requires ~/.pypirc)::

~/anaconda3/bin/twine upload dist/* -r testpypi

- If unsure, test the test-pypi for conda if the skeleton builds::

conda skeleton pypi --pypi-url https://test.pypi.io/pypi/ emg3d

- If it fails, you might have to install ``python3-setuptools``::

sudo apt install python3-setuptools


CI
--
CI automatic and manual bits
----------------------------

Automatic bits
``````````````
Automatic
`````````

- Testing on Github Actions includes:
- Testing on `Github Actions <https://github.com/emsig/emg3d/actions>`_
includes:

- Tests using ``pytest``
- Tests using ``pytest`` (Linux, MacOS, Windows)
- Linting / code style with ``pytest-flake8``
- Ensure all http(s)-links work (``sphinx linkcheck``)
- Ensure all http(s)-links work (``sphinx -b linkcheck``)

- Line-coverage with ``pytest-cov`` on `Coveralls
<https://coveralls.io/github/emsig/emg3d>`_
- Code-quality on `Codacy
<https://app.codacy.com/manual/prisae/emg3d/dashboard>`_
<https://app.codacy.com/gh/emsig/emg3d/dashboard>`_
- Manual on `ReadTheDocs <https://emg3d.emsig.xyz/en/latest>`_
- DOI minting on `Zenodo <https://doi.org/10.5281/zenodo.3229006>`_

Manual things
`````````````
Manual
``````

- Benchmarks with `Airspeed Velocity <https://emsig.xyz/emg3d-asv>`_
(``asv``)
- Gallery in `emg3d-gallery <https://emsig.xyz/emg3d-gallery>`_
(``sphinx-gallery``)

Automatically deploys if tagged
```````````````````````````````

- `PyPi <https://pypi.org/project/emg3d>`_
- `conda -c conda-forge <https://anaconda.org/conda-forge/emg3d>`_
Useful things
-------------

The following info was from the time when we still manually deployed. Now
every push to main triggers a test to Test-PyPI, so things can be verified
there. However, these hints my still be useful at some point.

- If there were changes to README, check it with::

python setup.py --long-description | rst2html.py --no-raw > index.html

- If unsure about something, test it first on testpypi (requires ~/.pypirc)::

~/anaconda3/bin/twine upload dist/* -r testpypi

- If unsure, test the test-pypi for conda if the skeleton builds::

conda skeleton pypi --pypi-url https://test.pypi.io/pypi/ emg3d

- If it fails, you might have to install ``python3-setuptools``::

sudo apt install python3-setuptools
Loading

0 comments on commit a58a95c

Please sign in to comment.