Skip to content

Commit 181857a

Browse files
authored
update API reference and contributor's guide (#341)
* include BibTeX citation in citing and remove bibliography * add sphinx interlink extension and link to musica * update API reference modules and contributing page content
1 parent def3703 commit 181857a

File tree

8 files changed

+71
-43
lines changed

8 files changed

+71
-43
lines changed

docs/source/api/acom_music_box.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
MusicBox
22
========
33

4-
Submodules
5-
----------
4+
.. automodule:: acom_music_box
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
68

79
acom\_music\_box.music\_box module
810
----------------------------------
@@ -60,10 +62,3 @@ acom\_music\_box.utils module
6062
:undoc-members:
6163
:show-inheritance:
6264

63-
Module contents
64-
---------------
65-
66-
.. automodule:: acom_music_box
67-
:members:
68-
:undoc-members:
69-
:show-inheritance:

docs/source/api/index.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
###
2-
API
3-
###
1+
###############
2+
API Reference
3+
###############
4+
5+
This documentation describes the Python API for MusicBox.
6+
For detailed information on the chemistry-related objects and reaction definitions used in MusicBox via MUSICA, see the :mod:`musica.mechanism_configuration`
47

58
.. toctree::
69
:maxdepth: 4
710

8-
acom_music_box
11+
acom_music_box

docs/source/citing_and_bibliography/citation.rst renamed to docs/source/citing/index.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11

2+
##########################
23
Citing MusicBox
3-
===============
4+
##########################
45

5-
MusicBox is a group scientific and software effort.
6+
.. toctree::
7+
:maxdepth: 1
68

7-
Cite the software
8-
-----------------
9-
10-
The software can be cited like this
9+
MusicBox is a group scientific and software effort. The software can be cited like this:
1110

1211
.. code-block:: console
1312
@@ -28,6 +27,4 @@ The software can be cited like this
2827
publisher = {Zenodo},
2928
version = {v2.8.0},
3029
doi = {10.5281/zenodo.15427735},
31-
url = {https://doi.org/10.5281/zenodo.15427735},
32-
33-
}
30+
url = {https://doi.org/10.5281/zenodo.15427735}

docs/source/citing_and_bibliography/bibliography.rst

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

docs/source/citing_and_bibliography/index.rst

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

docs/source/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
'sphinx.ext.autodoc',
2828
'sphinx_copybutton',
2929
'sphinx_design',
30+
'sphinx.ext.intersphinx'
3031
]
3132

3233
templates_path = ['_templates']
@@ -36,6 +37,13 @@
3637
exclude_patterns = []
3738

3839
highlight_language = 'python'
40+
41+
#-- link to MUSICA documentation ---
42+
43+
intersphinx_mapping = {
44+
'musica': ('https://ncar.github.io/musica/api/', None),
45+
}
46+
3947
# -- Options for HTML output -------------------------------------------------
4048
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4149

docs/source/contributing/index.rst

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,52 @@ The code for MusicBox is hosted on `GitHub <https://github.com/NCAR/music-box>`_
66
features, documentation updates, etc.), please start by opening an `issue <https://github.com/NCAR/music-box/issues/new/choose>`_
77
describing your request or planned contribution.
88

9-
Testing
10-
-------
9+
Creating a development environment
10+
-----------------------------------
11+
To contribute to MusicBox and test changes locally, we recommend making a `conda <https://www.anaconda.com/docs/getting-started/miniconda/main>`_ environment:
12+
13+
.. code-block:: console
14+
15+
$ git clone https://github.com/NCAR/music-box
16+
$ cd music-box
17+
$ conda create --name musicbox python=<minimum-3.9> --yes
18+
$ conda activate musicbox
19+
20+
After the GitHub repository is cloned and the virtual environment made, MusicBox should be built and installed with an ediable installation:
21+
22+
.. code-block:: console
23+
24+
$ pip install -e .
25+
26+
27+
Testing with continuous integration
28+
------------------------------------
29+
MusicBox uses GitHub Actions to automatically test and validate changes whenever a pull request is opened.
30+
A pull request will be considered for merging when it passes all tests in the test suite, indicated by a green checkmark.
31+
32+
Before pushing your changes, you can run the same tests locally using:
33+
34+
.. code-block:: console
35+
36+
$ pytest
1137
1238
Style guide
1339
-----------
40+
MusicBox follows the `PEP 8 <https://peps.python.org/pep-0008/>`_ style guide for Python code. Please attempt to do the same on any new contributions.
41+
To maintain consistency, we use a GitHub action that autoformats for PEP 8 conventions after each PR is pulled.
1442

1543
Documentation
16-
-------------
44+
-------------
45+
All of our docs are stored in the ``docs`` directory and is built using `Sphinx <https://www.sphinx-doc.org/en/master/>`_.
46+
There are several Python dependencies that are necessary to build the documentation locally. These dependencies can be installed by
47+
running the following from your cloned ``music-box`` directory:
48+
49+
.. code-block:: console
50+
51+
$ cd docs
52+
$ pip install -r requirements.txt
53+
54+
To build the documentation locally after edits:
55+
56+
- On macOS/Linux: ``make html``
57+
- On Windows (cmd or PowerShell): ``.\make.bat html``

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Welcome to Music Box's documentation!
3939

4040
The source code for music box is heavily documented. This reference will help you understand the internals of music box.
4141

42-
.. grid-item-card:: Contributors guide
42+
.. grid-item-card:: Contributor's guide
4343
:img-top: _static/index_contribute.svg
4444
:link: contributing/index
4545
:link-type: doc
@@ -56,7 +56,7 @@ Welcome to Music Box's documentation!
5656
user_guide/index
5757
api/index
5858
contributing/index
59-
citing_and_bibliography/index
59+
citing/index
6060

6161
Indices and tables
6262
==================

0 commit comments

Comments
 (0)