Skip to content

Commit 823e68c

Browse files
authored
Improvements to developer documentation (#161)
* first draft * add doc8 to docs requirements * more docs
1 parent 3237a68 commit 823e68c

File tree

4 files changed

+60
-21
lines changed

4 files changed

+60
-21
lines changed
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
Developer Documentation
2-
================================
2+
=======================
3+
4+
.. toctree::
5+
:hidden:
6+
:titlesonly:
7+
8+
ingest_functions
9+
documentation
10+
11+
12+
Setup
13+
-----
14+
15+
If you'd like to contribute to `astrodb_utils`, first, first make a fork of the repository.
16+
Then, clone your fork of the repository to your local machine.
17+
Contributions will be accepted via pull requests from your fork to the primary repository.
18+
319

420
Installation
5-
---------------------
21+
------------
622

723
If you'd like to run tests, make sure to install the package with the optional test dependencies. E.g.,
824

@@ -11,13 +27,14 @@ If you'd like to run tests, make sure to install the package with the optional t
1127
pip install -e ".[test]"
1228
1329
Make sure you get the `astrodb-template-db`` submodule. This is required for running tests and building the documentation.
30+
1431
.. code-block:: bash
1532
1633
git submodule update --init --recursive
1734
1835
1936
Running Tests
20-
---------------------
37+
-------------
2138

2239
All contributions should include tests. To run the tests, use the command
2340

@@ -26,28 +43,11 @@ All contributions should include tests. To run the tests, use the command
2643
pytest
2744
2845
Linting and Formatting
29-
---------------------
46+
----------------------
3047

3148
Use `ruff <https://docs.astral.sh/ruff/>`_ for linting and formatting.
3249
A pre-commit hook is provided for automatic linting and formatting with ruff.
3350
To use it, run `pip install pre-commit` and then `pre-commit install --allow-missing-config`.
3451

3552
VSCode setup instructions: `Formatting Python in VSCode <https://code.visualstudio.com/docs/python/formatting>`_
3653

37-
Build the Docs
38-
---------------------
39-
The documentation is built using files in the `astrodb-template-db` submodule.
40-
Be sure to update the submodule before building the docs.
41-
.. code-block:: bash
42-
43-
git submodule update --init --recursive
44-
45-
46-
To build the docs, use `sphinx-autobuild <https://pypi.org/project/sphinx-autobuild/>`_.
47-
48-
.. code-block:: bash
49-
50-
pip install -e ".[docs]"
51-
sphinx-autobuild docs docs/_build/html
52-
53-
The docs will then be available locally at <http://127.0.0.1:8000>.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Documentation
2+
=============
3+
4+
Build the Docs
5+
--------------
6+
The documentation is built using files in the `astrodb-template-db` submodule.
7+
Be sure to update the submodule before building the docs.
8+
.. code-block:: bash
9+
10+
git submodule update --init --recursive
11+
12+
13+
To build the docs, use `sphinx-autobuild <https://pypi.org/project/sphinx-autobuild/>`_.
14+
15+
.. code-block:: bash
16+
17+
pip install -e ".[docs]"
18+
sphinx-autobuild docs docs/_build/html
19+
20+
The docs will then be available locally at <http://127.0.0.1:8000>.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Ingest functions
2+
================
3+
4+
Ingest function design guidelines
5+
---------------------------------
6+
* ingest one thing. E.g., one parameter, or one spectrum.
7+
* use `raise_error = True/False`.
8+
* use :py:mod:`exit_function<astrodb_utils.utils.exit_function>` to help
9+
* If `True`, raise an error if the ingest fails.
10+
* If `False`, return `None` and log warning if the ingest fails and log warning.
11+
12+
- use helper functions to get constrained values from the database such as regime, instrument, etc.
13+
- * :py:mod:`astrodb_utils.utils.get_constrained_value`
14+
15+
Need to decide
16+
--------------
17+
- ways to accept input. E.g, parameter= parameter, value=value, OR paramet dict = {parameter: value}. See https://github.com/astrodbtoolkit/astrodb_utils/issues/13
18+

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ docs = [
4747
"pydata-sphinx-theme",
4848
"pandoc",
4949
"sphinx_mdinclude",
50+
"doc8"
5051
]
5152
all = ["astrodb_utils[test, docs]"]
5253

0 commit comments

Comments
 (0)