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

Error when the toml or database can't be found. #1773

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

evetion
Copy link
Member

@evetion evetion commented Aug 28, 2024

Fixes #1652

@evetion
Copy link
Member Author

evetion commented Aug 28, 2024

Interesting, these tests pass locally. It seems I have an empty gitignored database.gpkg in ribasim_qgis tests data folder. @visr can you confirm the existence of said file?

@visr
Copy link
Member

visr commented Aug 28, 2024

Yeah I think I gitignored it. This was created when we started testing if that TOML is valid in Ribasim Python, which produced the GeoPackage. I assume that should be fixed now that you split the reading and writing context var?

@evetion
Copy link
Member Author

evetion commented Aug 28, 2024

This was created when we started testing if that TOML is valid in Ribasim Python, which produced the GeoPackage. I assume that should be fixed now that you split the reading and writing context var?

Hmm, I don't follow. An empty file was created previously? Anyway, I propose to either commit the empty geopackage file or to touch the file from the test?

edit: Touched the file.

@visr
Copy link
Member

visr commented Aug 28, 2024

Ok sounds good. It's a bit odd that read works with an empty database but not no database.

@evetion
Copy link
Member Author

evetion commented Aug 28, 2024

Ok sounds good. It's a bit odd that read works with an empty database but not no database.

There's some complexity in the FileModel, it can use a spring cleaning as I mentioned in another issue. Initialization also passes some of these codepaths, so an empty db is almost identical to initializing an empty model. Which actually makes some sense 😉

@evetion evetion requested a review from visr August 29, 2024 11:28
@visr visr merged commit 7ec16c7 into main Aug 29, 2024
28 of 29 checks passed
@visr visr deleted the feat/error-on-non-existing-files branch August 29, 2024 11:43
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.

Error if model database is not found on ribasim.Model.read
2 participants