/ds-aa-hti-hurricanes

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Haiti Anticipatory Action: hurricanes

Generic badge

Directory structure

The code in this repository is organized as follows:

├── analysis      # Main repository of analytical work for the AA pilot
├── docs          # .Rmd files or other relevant documentation
├── exploration   # Experimental work not intended to be replicated
├── src           # Code to run any relevant data acquisition/processing pipelines
|
├── .gitignore
├── README.md
└── requirements.txt

Reproducing this analysis

Create a directory where you would like the data to be stored, and point to it using an environment variable called AA_DATA_DIR.

Next create a new virtual environment

Install the GloFAS branch of the toolbox with

pip install git+https://github.com/OCHA-DAP/pa-aa-toolbox.git@feature/glofas#egg=aa-toolbox

and install the requirements with:

pip install -r requirements.txt

Finally, install any code in src using the command:

pip install -e .

To run the pipeline that downloads and processes the data, execute:

python src/main.py

To see runtime options, execute:

python src/main.py -h

If you would like to instead receive the processed data from our team, please contact us.

Development

All code is formatted according to black and flake8 guidelines. The repo is set-up to use pre-commit. Before you start developing in this repository, you will need to run

pre-commit install

The markdownlint hook will require Ruby to be installed on your computer.

You can run all hooks against all your files using

pre-commit run --all-files

It is also strongly recommended to use jupytext to convert all Jupyter notebooks (.ipynb) to Markdown files (.md) before committing them into version control. This will make for cleaner diffs (and thus easier code reviews) and will ensure that cell outputs aren't committed to the repo (which might be problematic if working with sensitive data).