Design pattern

Codebase description

The core codebase structure should remain as follows:

bsfit/
    nodes/
    pipes/
    requirements.txt
conf/
data/
Docs/
    source/
logs/
tutorials/
.gitignore
deploy.sh
main.py
README.md
setup.py

Source code design

The source code organizes arount two central components:

  1. nodes: they are python modules that organize semantically related functions.

  2. pipes (for pipelines): they are analyses that chain nodes to transform data and produce plots.

Docstrings

  1. Please use the Google Style Guide format.

Update docs

  1. Please edit docs/source/

  2. Go to the “Build & deploy” section

Build & deploy

Core steps:

  1. Develop your features on branch develop.

  2. Pull request to obtain validation of your changes on branch pre-prod (homologation).

  3. A code master (I for now) will commit your final changes on branch master (production).

In detail:

  1. On branch develop (to add features):

    After you’ve added a feature, run in the terminal:

    bash deploy.sh
    
  2. Pull request pre-prod branch (homologation, check docs rendering)

    After deploying sphinx/ to docs/, run in the terminal:

  3. Pull request to master (production branch for end-users)

    when: the entire codebase is clean

Unit-testing

Unit-test the package’s functions:

Run in the terminal:

pytest bsfit/test.py

Packaging

# install setuptools
pip install --upgrade setuptools wheel

# package in development mode then import
# run conda list bsfit or pip freeze to check
# that it is listed among dependencies
pip install -e .