Skip to content

Conversation

deltamarnix
Copy link
Contributor

@deltamarnix deltamarnix commented Aug 25, 2025

Fixes #493

v0 to v1 upgrade now also checks for csv.column.map and updates it in the new output variable output.csv.column.map.

"lateral.river.lake.locs" and "lateral.river.reservoir.locs" become "reservoir_location__count"

Issue addressed

Fixes #

Explanation

Explain how you addressed the bug/feature request, what choices you made and why.

Checklist

  • Updated tests or added new tests
  • Branch is up to date with main
  • Tests & pre-commit hooks pass
  • Updated documentation if needed

Additional Notes (optional)

Add any additional notes or information that may be helpful.

@deltamarnix deltamarnix requested a review from Copilot August 25, 2025 07:36
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the v0 to v1 upgrade logic to handle CSV column map references that point to lake or reservoir locations, converting them to the new "reservoir_location__count" format.

  • Adds handling for "lateral.river.lake.locs" and "lateral.river.reservoir.locs" map references in CSV output configuration
  • Updates test data files to reflect the new mapping format
  • Refactors code style by removing unnecessary .keys() calls and using walrus operator

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
hydromt_wflow/version_upgrade.py Adds logic to convert lake/reservoir location maps to "reservoir_location__count"
tests/data/wflow_v0x/sbm/wflow_sbm_v1.toml Updates test data with expected v1 format output
examples/data/wflow_upgrade/sbm/wflow_sbm_v0x.toml Updates example data with v0 format input for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@deltamarnix deltamarnix requested a review from hboisgon August 25, 2025 14:50
Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good! I forgot but could you do the same for output.netcdf_scalar? (netcdf in v0)

Fixes #439

v0 to v1 upgrade now also checks for csv.column.map and updates it in
the new output variable output.csv.column.map.

"lateral.river.lake.locs" and "lateral.river.reservoir.locs" become "reservoir_location__count"
@deltamarnix deltamarnix force-pushed the fix/493-update-csv-map-locs branch from 0ff633a to c6065ec Compare August 29, 2025 12:46
@deltamarnix deltamarnix requested a review from hboisgon August 29, 2025 12:46
Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry one more thing I didn't see before... but for the rest it would be good to merge!

Copy link

sonarqubecloud bot commented Sep 1, 2025

Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@deltamarnix deltamarnix merged commit 38080d1 into main Sep 2, 2025
7 of 9 checks passed
@deltamarnix deltamarnix deleted the fix/493-update-csv-map-locs branch September 2, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mapping outputs to lakes and reservoirs locs in upgrade_to_v1_wflow
2 participants