Write ribasim_version
to TOML and warn in core if it is different
#1181
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1178
At first I tried to add
ribasim_version
to the Python data model, but struggled to get it to write to the TOML even if it had its default values. But then I thought, when wemodel.write
, with Ribasim Python version X, we should always set that key to X. Therefore there is no point in having it be part of the data model.This does some hardcoded current version numbers in our test TOML files. I guess we could script a way around that, but updating the version number is a documented find and replace action already anyway, so it doesn't matter much.
The warning from the core looks like this:
Upgrade information
Add a top level key to your TOML with the Ribasim version you are using.