Skip to main content

Compare results from simulations with observations.

Project description

ModelSkill: Flexible Model skill evaluation.

Python version Python package PyPI version Downloads

ModelSkill is a python package for scoring MIKE models (other models can be evaluated as well).

Contribute with new ideas in the discussion, report an issue or browse the documentation.

Use cases

ModelSkill would like to be your companion during the different phases of a MIKE modelling workflow.

  • Model setup - exploratory phase
  • Model calibration
  • Model validation and reporting - communicate your final results

Installation

From pypi:

> pip install modelskill

Or the development version:

> pip install https://github.com/DHI/modelskill/archive/main.zip

Example notebooks

Workflow

  1. Define ModelResults
  2. Define Observations
  3. Match Observations and ModelResults
  4. Do plotting, statistics, reporting using the Comparer

Read more about the workflow in the getting started guide.

Example of use

Start by defining model results and observations:

>>> import modelskill as ms
>>> mr = ms.DfsuModelResult("HKZN_local_2017_DutchCoast.dfsu", name="HKZN_local", item=0)
>>> HKNA = ms.PointObservation("HKNA_Hm0.dfs0", item=0, x=4.2420, y=52.6887, name="HKNA")
>>> EPL = ms.PointObservation("eur_Hm0.dfs0", item=0, x=3.2760, y=51.9990, name="EPL")
>>> c2 = ms.TrackObservation("Alti_c2_Dutch.dfs0", item=3, name="c2")

Then, connect observations and model results, and extract data at observation points:

>>> cc = ms.match([HKNA, EPL, c2], mr)

With the comparer object, cc, all sorts of skill assessments and plots can be made:

>>> cc.skill().round(2)
               n  bias  rmse  urmse   mae    cc    si    r2
observation                                                
HKNA         385 -0.20  0.35   0.29  0.25  0.97  0.09  0.99
EPL           66 -0.08  0.22   0.20  0.18  0.97  0.07  0.99
c2           113 -0.00  0.35   0.35  0.29  0.97  0.12  0.99

Overview of observation locations

ms.plotting.spatial_overview([HKNA, EPL, c2], mr, figsize=(7,7))

map

Scatter plot

>>> ms.load_style('MOOD')  # optional
>>> cc.plot.scatter()

scatter

Timeseries plot

Timeseries plots can either be static and report-friendly (matplotlib) or interactive with zoom functionality (plotly).

cc["HKNA"].plot.timeseries(width=1000, backend="plotly")

timeseries

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

modelskill-1.4.0a3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelskill-1.4.0a3-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file modelskill-1.4.0a3.tar.gz.

File metadata

  • Download URL: modelskill-1.4.0a3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for modelskill-1.4.0a3.tar.gz
Algorithm Hash digest
SHA256 95a2493eb658c4ef11ae0d3d3366502a9af7b334083b67b0b79599cb6d0a7c7d
MD5 f839618b44a90d27d092c55c15af4973
BLAKE2b-256 574b0608b5548de7eb20da370c1e65ce79a2594998b2a970e08f2f7e1445791b

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelskill-1.4.0a3.tar.gz:

Publisher: python-publish.yml on DHI/modelskill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file modelskill-1.4.0a3-py3-none-any.whl.

File metadata

  • Download URL: modelskill-1.4.0a3-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for modelskill-1.4.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 95e67ca881c4df1cbce87585195d607c1751fa8bdb05b13d5ac4f54128383b97
MD5 f034641013d61d743e91ee6bd4c51b2c
BLAKE2b-256 d933284423d48dc1a4f5300f32ab6a8d07de0e45e4e5106661468175ba8b21dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for modelskill-1.4.0a3-py3-none-any.whl:

Publisher: python-publish.yml on DHI/modelskill

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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