DHI / DHI/modelskill

Scale data in Comparer

Open
#490 3 comments 0 reactions 0 assignees Claimed by @ecomodeller View on GitHub
enhancement
Dominant language
Python
Stars
56
Forks
9
Avg merge
57m
Merged PRs (30d)
3

Description

I propose a new method `scale()` in `Comparer` and `ComparerCollection` that should scale all primary variables (not aux data) by a factor and set a new unit. The use case is e.g. that want to show all my plots, tables etc with "cm" unit instead of "meter" but all the data files are in meter so it is a bit cumbersome to change the units before the comparison (it would require me to load all the data in the dfsu).

* The ComparerCollection should only allow scale if unit is the same across all contained comparers.
* Signature should be `scale(factor=None, *, offset=None, new_unit=None)`
* The `new_unit` argument should be required if factor is not None and old unit is not undefined.
* Optionally, we could allow the same functionality on Timeseries (for completeness)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.