Skip to main content

FEWS-3di coupling

Project description

fews-3di

Program to start 3Di simulations from FEWS.

Installation and usage

We can be installed using python 3.6+ with:

$ pip install fews-3di

The script is called run-fews-3di, you can pass --help to get usage instructions and --verbose to get more verbose output in case of problems.

run-fews-3di looks for a run_info.xml in the current directory by default, but you can pass a different file in a different location with --settings.

Several input files are needed, they should be in the input directory relative to the run_info.xml, like input/evaporation.nc. Output is stored in the output directory relative to the run_info.xml.

Development instructions (only for the programmers, not for regular use)

We use python’s build-in “virtualenv” to get a nice isolated directory. You only need to run this once:

$ python3 -m venv .

A virtualenv puts its commands in the bin directory. So bin/pip, bin/pytest, etc. Set up the dependencies like this:

$ bin/pip install -r requirements.txt

There will be a script you can run like this:

$ bin/run-fews-3di

It runs the main() function in fews-3di/scripts.py, adjust that if necessary. The script is configured in setup.py (see entry_points).

In order to get nicely formatted python files without having to spend manual work on it, run the following command periodically:

$ bin/black fews_3di

Run the tests regularly. This also checks with pyflakes, black and it reports coverage. Pure luxury:

$ bin/pytest

The tests are also run automatically on “github actions” for “master” and for pull requests. So don’t just make a branch, but turn it into a pull request right away:

  • Prepend the title with “[WIP]”, work in progress. That way you make clear it isn’t ready yet to be merged.

  • Important: it is easy to give feedback on pull requests. Little comments on the individual lines, for instance. So use it to get early feedback, if you think that’s useful.

  • On your pull request page, you also automatically get the feedback from the automated tests.

There’s also coverage reporting on coveralls.io.

If you need a new dependency (like requests), add it in setup.py in install_requires. Local development tools, like “black”, can be added to the requirements.txt directoy. In both cases, run install again to actuall install your dependency:

$ bin/pip install -r requirements.txt

Changelog of fews-3di

0.4 (2020-04-30)

  • Reading and storing saved states added.

0.3.3 (2020-04-24)

  • Another release mechanism fix.

0.3 (2020-04-23)

  • Release mechanism fix.

0.2 (2020-04-23)

  • Added lateral upload.

  • Added rain upload.

  • Added evaporation upload.

  • Simulation is actually being run now.

  • Added processing of the results.

  • Added usage instructions.

0.1 (2020-04-09)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fews-3di-0.4.tar.gz (510.5 kB view hashes)

Uploaded Source

Built Distribution

fews_3di-0.4-py3-none-any.whl (509.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page