Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write ribasim_version to TOML and warn in core if it is different #1181

Merged
merged 2 commits into from
Feb 26, 2024

Conversation

visr
Copy link
Member

@visr visr commented Feb 26, 2024

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 we model.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:

┌ Warning: The Ribasim version in the TOML config file does not match the used Ribasim CLI version.
│   config.ribasim_version = "2024.2.1"
│   ribasim_version = "2024.2.0"
└ @ Ribasim d:\Ribasim\core\src\main.jl:63

Upgrade information

Add a top level key to your TOML with the Ribasim version you are using.

ribasim_version = "2024.2.1"

@visr visr requested a review from Hofer-Julian February 26, 2024 14:21
Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

A few small comments, apart from that ready to go from my side

core/src/main.jl Outdated Show resolved Hide resolved
core/src/main.jl Outdated Show resolved Hide resolved
docs/contribute/release.qmd Show resolved Hide resolved
@Hofer-Julian Hofer-Julian merged commit c5ae83d into main Feb 26, 2024
21 checks passed
@Hofer-Julian Hofer-Julian deleted the toml-ribasim-version branch February 26, 2024 15:49
@visr visr added the breaking A change that breaks existing models label Feb 26, 2024
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.

Add ribasim_version to TOML
2 participants