Scale data in Comparer

Open
#490 3 comments 0 reactions 0 assignees View on GitHub

@ecomodeller is already working on this.

Since Oct 16, 2025.

  • #528 by @ecomodeller — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by locating the Python definitions of Comparer and ComparerCollection and inspect how primary variables, auxiliary data, units, and comparisons are represented. Review linked pull request #528 before making changes, and check whether Timeseries is included in the intended scope. Done means scale(factor=None, *, offset=None, new_unit=None) follows the stated unit and collection constraints.

Written by the indexing model from the issue text.

Description

enhancement

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)
Dominant language
Python
Stars
56
Forks
9
Avg merge
57m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DHI/modelskill

All issues in DHI/modelskill

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.