Contribution & Development

Contribution

There are different ways in which you can contribute to this library:

  • by handing in a PR which describes the feature/issue that was solved including tests for newly added features

  • by using our library and reporting bugs to us either by mail or by creating a new Issue

  • by letting us know either via issue or discussion what function or data source we may include into this library describing possible solutions or acquisition methods/endpoints/APIs

Development

  1. Clone the library and install the environment.

    This setup procedure will outline how to install the library and the minimum dependencies required to run the whole test suite. If, for some reason, you are not available to install all the packages, just leave out some of the “extras” dependency tags.

git clone https://github.com/earthobservations/wetterdienst
cd wetterdienst

# Prerequisites
brew install --cask firefox
brew install git python geckodriver

# Option 1: Basic
git clone https://github.com/earthobservations/wetterdienst
cd wetterdienst
python3 -m venv .venv
source .venv/bin/activate
pip install --requirement=requirements.txt
python setup.py develop

# (Option 2: Install package with extras)
pip install ".[sql,export,restapi,explorer]"

# Option 3: Install package with extras using poetry.
poetry install --extras=sql --extras=export --extras=restapi --extras=explorer
poetry shell
  1. For running the whole test suite, you will need to have Firefox and geckodriver installed on your machine. Install them like:

    # macOS
    brew install --cask firefox
    brew install geckodriver
    
    # Other OS
    # You can also get installers and/or release archives for Linux, macOS
    # and Windows at
    #
    # - https://www.mozilla.org/en-US/firefox/new/
    # - https://github.com/mozilla/geckodriver/releases
    

    If this does not work for some reason and you would like to skip ui-related tests on your machine, please invoke the test suite with:

    poe test -m "not ui"
    
  2. Edit the source code, add corresponding tests and documentation for your changes. While editing, you might want to continuously run the test suite by invoking:

    poe test
    

    In order to run only specific tests, invoke:

    # Run tests by module name or function name.
    poe test -k test_cli
    
    # Run tests by tags.
    poe test -m "not (remote or slow)"
    
  3. Before committing your changes, please als run those steps in order to make the patch adhere to the coding standards used here.

poe format  # black code formatting
poe lint    # lint checking
poe export  # export of requirements (for Github Dependency Graph)
  1. Push your changes and submit them as pull request

    Thank you in advance!

Note

If you need to extend the list of package dependencies, invoke:

# Add package to runtime dependencies.
poetry add new-package

# Add package to development dependencies.
poetry add --dev new-package

Known Issues

MAC ARM64 (M1)

You need to install pandas, numpy and scipy as follows before continuing with the regular setup:

pip install pandas --no-use-pep517
pip install numpy --no-use-pep517
pip install --no-binary :all: --no-use-pep517 scipy

Further additional libraries are affected and have to be installed in a similar manner:

# SQL related
brew install postgresql
brew link openssl (and export ENVS as given)
pip install psycopg2-binary --no-use-pep517

LINUX ARM (Raspberry Pi)

Running wetterdienst on Raspberry Pi, you need to install numpy and lxml prior to installing wetterdienst running the following lines:

sudo apt-get install libatlas-base-dev
sudo apt-get install python3-lxml