Contributing
Thank you for helping build CubeDynamics! This project keeps climate cube math lightweight, streaming-first, and well documented.
Repository layout
src/
cubedynamics/
__init__.py # re-exports verbs and pipe helpers
piping.py # Pipe class + helpers
ops/
__init__.py
transforms.py # anomaly, month_filter, NDVI helpers
stats.py # variance, correlation_cube, rolling metrics
io.py # to_netcdf and future exporters
docs/ # MkDocs + Material site
Tests live under tests/ and rely on pytest. Documentation is built with MkDocs (Material theme); run mkdocs serve while editing docs.
Local setup
- Fork or branch from
mainand create feature branches for your work. - Install dependencies in editable mode (e.g.,
python -m pip install -e .[dev]once extras are defined). - Run
pytestplus any relevant notebooks/scripts before opening a pull request.
Adding a new verb
- Create the implementation in
cubedynamics/ops/. - Follow the factory pattern:
python
def verb_name(...):
def _inner(cube):
...
return _inner
- Re-export the verb in
cubedynamics/verbs/__init__.py(and optionallycubedynamics/__init__.py) so users canfrom cubedynamics import verbs as vand callv.verb_namedirectly. - Document the new function under
docs/reference/verbs_*.mdand add examples using the pipe syntax. - Write tests that cover direct invocation and pipe usage.
Streaming philosophy
- Streaming-first – functions should operate on iterables, chunked dask arrays, or lazy
xarrayobjects whenever possible. - Side-effect aware – avoid downloading entire archives; expose hooks for caching and resuming streams.
- Composable – keep verbs pure (no global state) so they chain cleanly in the pipe system.
Docs + website
- Keep the navigation structure in
mkdocs.ymlaligned with the docs files. - Use the new section layout (Concepts, Getting Started, Examples, Verbs Reference, Related Work, Development) when adding content.
- Remember that Lexcube widgets do not render on the static site; include screenshots or Binder links where appropriate.