Contributing¶
Development setup¶
git clone https://github.com/hadesllm/morie.git
cd morie
python -m venv .venv && source .venv/bin/activate
pip install -e ".[test,interactive]"
Python tests¶
pytest -q
R tests¶
Rscript -e "library(morie); testthat::test_dir('r-package/morie/tests/testthat')"
Build docs¶
python -m sphinx -b html docs/source docs/build/html
open docs/build/html/index.html
Documentation conventions¶
Python docstrings use NumPy style (Napoleon parses them).
Include
:math:inline and.. math::display blocks for all estimators.R documentation uses roxygen2 markdown.
New modules must be registered in
morie.modules.MODULE_SPECSwith aModuleSpecentry listing all output file names.Every non-trivial Python function needs a
pytesttest; every R export needs atestthattest.
Code quality¶
Type annotations on all Python function signatures.
No hardcoded file paths; use
DatasetRegistry.Row-level data from non-public sources must never be committed.
Adding a new module¶
Add a
ModuleSpecentry toMODULE_SPECSinsrc/morie/modules.py.Add a branch in
run_module()that calls an implementation function.Implement the analysis function in the appropriate module file (
causal.py,investigation.py, etc.).Add the module name to the R
list_morie_modules()table inr-package/morie/R/modules.R.Add a page to
docs/source/methods/if the module has significant logic.Write tests in
tests/(Python) andr-package/morie/tests/testthat/(R).
License¶
Contributions are accepted under GPL-2.0-only. By submitting a pull
request you agree to license your contribution under that licence.