Skip to content

Rename Outlet's min_crest_level to min_upstream_level#1788

Merged
visr merged 5 commits intomainfrom
min_crest_level
Sep 2, 2024
Merged

Rename Outlet's min_crest_level to min_upstream_level#1788
visr merged 5 commits intomainfrom
min_crest_level

Conversation

@visr
Copy link
Copy Markdown
Member

@visr visr commented Sep 2, 2024

The breaking part of #1771, with added automatic migration.

@visr visr added the breaking A change that breaks existing models label Sep 2, 2024
@evetion
Copy link
Copy Markdown
Member

evetion commented Sep 2, 2024

@visr I've added some migration specific changes here in 6ebc208 (#1788), feel free to review. In the future we should update schemas incrementally (from 0-1, 1-2, instead of 0-2, 1-2), but this works for now.

@visr visr merged commit f34646f into main Sep 2, 2024
@visr visr deleted the min_crest_level branch September 2, 2024 13:54
visr added a commit that referenced this pull request Sep 3, 2024
#1792)

Fixes #1771, the remaining part after #1788 was merged. I split out
#1789 as a separate issue, though in this PR a lot of the preparatory
work is already done (all changes related to TabulatedRatingCurve).

This is breaking due to #1791 because of adding new optional columns.
It is also breaking that TabulatedRatingCurve and Pump now only support
one outflow edge. As far as I know this wasn't used anywhere though. We
cannot easily support that anymore since we now look at downstream
levels. Users should instead use separate Pumps or
TabulatedRatingCurves, which can share the same upstream Basin, but go
to different downstream nodes.

I decided to start the reduction factors for reaching these limits from
2 centimeters away. There was one existing level based reduction factor,
the level difference in the Outlet, which I also adjusted from 10 to 2
centimeter. I feel like 10 centimeter would be too much in areas where
the level is controlled up to centimeter accuracies.
visr added a commit that referenced this pull request Sep 5, 2024
The migration function from #1788 was wrong because I didn't know that
Ribasim Python would already add the new optional column by the time it
got to the migration. This now drops that one first, to avoid ending up
with `min_upstream_level` twice in one dataframe.

This also makes the other functions a bit simpler by allowing errors
when dropping columns that are no longer needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A change that breaks existing models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants