simulation_evaluation

A tool-spec compliant research tool to create sophisticated simulation result reports

https://github.com/kit-hyd/simulation_evaluation

Science Score: 65.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
    Organization kit-hyd has institutional domain (hyd.iwg.kit.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

A tool-spec compliant research tool to create sophisticated simulation result reports

Basic Info
  • Host: GitHub
  • Owner: KIT-HYD
  • License: cc0-1.0
  • Language: Python
  • Default Branch: main
  • Size: 2.26 MB
Statistics
  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

toolsimulationevaluation

Docker Image CI

This is a containerized Python tool following the Tool Specification for reusable research software using Docker.

Data: CAMELS-DE: hydrometeorological time series and attributes for 1582 catchments in Germany A. Dolich et al. https://doi.org/10.5281/zenodo.13837553

Model code and software: Hy2DL: Hybrid Hydrological modeling using Deep Learning methods Eduardo Acuña Espinoza et al. https://github.com/KIT-HYD/Hy2DL/tree/v1.1

Description

The simulation evaluation tool is designed to assess the performance of hydrological simulations against observed hydrological data. It automates the process of loading data from multiple catchments, computing key evaluation metrics, and generating visualizations for a comprehensive analysis. The tool outputs an interactive HTML report containing performance summaries, time series plots, and statistical comparisons. The tool also outputs a .csv file conatining all the metrics for the cathcments.

Key features

1. Data loading and preprocessing

  • Supports loading both simulation and observation data from CSV or Parquet files.
  • Allows flexible structure
    • Separate files for observed and simulated data
    • A single file containing both observations and simulations
  • Uses wildcards to match multiple files within directories.

2. Performance metrics

  • For each catchment, the tool calculates the most frequently used hydrological performance metrics, such as:
    • Nash-Sutcliffe Efficiency (NSE)
    • Kling-Gupta Efficiency (KGE)
    • Coefficient of determination (R2)
    • Mean Squared Error (MSE)
    • Root Mean Squared Error (RMSE)

3. Output generation

  • Saves results in .csv and .json formats:
    • metrics_summary.csv - A summary of computed metrics for all cathcments
    • metrics_summary.json - JSON representation for programmatic access
  • Generates an HTML report containing:
    • Time series plots for catcments
    • Performance metric tables

How generic?

Tools using this template can be run by the toolbox-runner. That is only convenience, the tools implemented using this template are independent of any framework.

The main idea is to implement a common file structure inside container to load inputs and outputs of the tool. The template shares this structures with the R template, NodeJS template and Octave template, but can be mimiced in any container.

Each container needs at least the following structure:

/ |- in/ | |- parameters.json |- out/ | |- ... |- src/ | |- tool.yml | |- run.py

  • parameters.json are parameters. Whichever framework runs the container, this is how parameters are passed.
  • tool.yml is the tool specification. It contains metadata about the scope of the tool, the number of endpoints (functions) and their parameters
  • run.py is the tool itself, or a Python script that handles the execution. It has to capture all outputs and either print them to console or create files in /out

How to build the image?

You can build the image from within the root of this repo by docker build -t tbr_python_tempate .

Use any tag you like. If you want to run and manage the container with toolbox-runner they should be prefixed by tbr_ to be recognized.

Alternatively, the contained .github/workflows/docker-image.yml will build the image for you on new releases on Github. You need to change the target repository in the aforementioned yaml.

How to run?

This template installs the json2args python package to parse the parameters in the /in/parameters.json. This assumes that the files are not renamed and not moved and there is actually only one tool in the container. For any other case, the environment variables PARAM_FILE can be used to specify a new location for the parameters.json and TOOL_RUN can be used to specify the tool to be executed. The run.py has to take care of that.

To invoke the docker container directly run something similar to: docker run --rm -it -v /path/to/local/in:/in -v /path/to/local/out:/out -e TOOL_RUN=foobar tbr_python_template

Then, the output will be in your local out and based on your local input folder. Stdout and Stderr are also connected to the host.

With the toolbox runner, this is simplyfied:

```python from toolboxrunner import listtools tools = list_tools() # dict with tool names as keys

foobar = tools.get('foobar') # it has to be present there... foobar.run(resultpath='./', fooint=1337, foo_string="Please change me") `` The example above will create a temporary file structure to be mounted into the container and then create a.tar.gz` on termination of all inputs, outputs, specifications and some metadata, including the image sha256 used to create the output in the current working directory.

What about real tools, no foobar?

Yeah.

  1. change the tool.yml to describe your actual tool
  2. add any pip install or apt-get install needed to the dockerfile
  3. add additional source code to /src
  4. change the run.py to consume parameters and data from /in and useful output in out
  5. build, run, rock!

Owner

  • Name: Hydrology @KIT
  • Login: KIT-HYD
  • Kind: organization
  • Location: Germany

Hydrology group @KIT

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.0.0
title: Simulation evaluation tool
message: >-
  Please replace this citation information with appropriate
  metadata for your tool
type: software
authors:
  - given-names: Mirko
    family-names: Mälicke
    email: mirko.maelicke@KIT.edu
    affiliation: >-
      Institute for Water and Environment, Hydrology,
      Karlsruhe Institute for Technology (KIT)
    orcid: 'https://orcid.org/0000-0002-0424-2651'
  - given-names: Balazs
    family-names: Bischof
    email: balazs.bischof@kit.edu
    affiliation: >-
      Institute for Water and Environment, Hydrology,
      Karlsruhe Institute for Technology (KIT) 
    orcid: 'https://orcid.org/0000-0002-0424-2651'
repository-code: 'https://github.com/VForWaTer/simulation_evaluation'
url: 'https://vforwater.github.io/tool-specs/'
abstract: >-
  This is a Github repository template for scientific data
  (pre-)processing tools following the tool specs
  (https://vforwater.github.io/tool-specs/) for
  containerized scientific tools. You can use this
  repository as a starting point for scientific tools.
keywords:
  - docker
  - tool-spec
  - V-For-WaTer
  - discharge
  - LSTM
  - evaluation
license: CC-BY-4.0
version: '0.1'
date-released: '2025-02-25'

GitHub Events

Total
  • Issues event: 1
  • Delete event: 1
  • Push event: 7
  • Pull request event: 2
  • Create event: 3
Last Year
  • Issues event: 1
  • Delete event: 1
  • Push event: 7
  • Pull request event: 2
  • Create event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 1
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 29 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 29 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • BalazsBis (1)
Pull Request Authors
  • BalazsBis (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

.github/workflows/docker-image.yml actions
  • actions/checkout v3 composite
  • docker/build-push-action v3 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
  • docker/setup-buildx-action v2 composite
  • docker/setup-qemu-action v2 composite
  • softprops/action-gh-release v1 composite
Dockerfile docker
  • python 3.12 build