Contributing to the Codebase#

Coding Style#

Quote conventions:

name = 'spectrum'             # regular string
label = f"{name}: {value}"    # f-string

def func():
    """Docstring."""          # docstring

Docstring style:

  • Use a Numpy docstring for all public functions (see Docstring Rules). You can also see a template docstring (see here).

We also lint our code using ruff.

New Functions and Classes#

Every new public function or class requires all of the following:

  1. Export it in src/visualastro/__init__.py.

  2. Write a NumPy-style docstring (see Docstring Rules).

  3. Add tests (see Writing Tests).

  4. Register it in the reference docs (see Writing Documentation) at the minimum. It would also nice to add some examples! If you would like to add documentation, but don’t know how (see Writing Documentation)! Or, reach out and the VisualAstro team will be happy to help you write the docs.

Submitting Changes#

See Submitting a Pull Request for the branch and pull request workflow.