ECMWFCode4Earth / ml_drought

Machine learning to better predict and understand drought. Moving github.com/ml-clim
https://ml-clim.github.io/drought-prediction/
90 stars 18 forks source link

Our software engineering practices #10

Open tommylees112 opened 5 years ago

tommylees112 commented 5 years ago
  1. Run pytest and mypy locally before committing to github.

  2. Each function should have a descriptive name and perform one task. An exception is potentially pipeline type functions that run the process functions in a particular order

  3. Docstrings are standardized:

    • only have docstrings for functions the users will interact with
    • A description at the beginning
    • Input arguments (or the class attributes)
    • What the function returns
  4. Using static typing wherever possible

tommylees112 commented 5 years ago

(all credit to @gabrieltseng - more a note to self than anything else)

tommylees112 commented 5 years ago

Running pytest:

into the command line in the project root just type:

$ pytest

If there are issues with flake8 see here)

tommylees112 commented 5 years ago

Running mypy

$ mypy src
tommylees112 commented 5 years ago

When do you know if you're ready for a PR?