DeutscherWetterdienst / downloader

A simple python module and command line tool to download NWP GRIB2 data from DWD's Open Data File Server https://opendata.dwd.de.
Apache License 2.0
19 stars 3 forks source link

Recommendations for better coding #2

Closed meteoDaniel closed 3 years ago

meteoDaniel commented 4 years ago

Hey guys from @DeutscherWetterdienst, nice to have some open source activities from you on github.

I am working on meteorological data for several years now and you can enjoy some of my code in https://github.com/earthobservations/wetterdienst and in https://github.com/earthobservations/GribMagic. My primary motivation is to share knowledge about coding with as much meteorologist as possible to improve meteorological programming. Unfortunately it courses are rare at the university.

So let me start with some recommendations:

  1. Try to understand this as your coding rules: https://12factor.net/
  2. Use a powerful IDE like pycharm to benefit from many built in tools like formatting code
  3. Use docstrings (for every function) """ """" instead of comments
  4. Write Tests.
  5. use python fire instead of click
  6. Re-think your directory structure

You are welcome to contribute or Fork from GribMagic. It is still under development but shares some nice features and a powerful download which is much faster than your downloader due to parallelisation and an asynchron download function. The idea behind gribMagic is to define what you want in a yaml config. A simple docker call will download all data defined in the config.