-
Notifications
You must be signed in to change notification settings - Fork 4
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
CrossDefModel not working as expected #199
Comments
Ad.2: Ad.3: |
@arthurvd
Full file (with a .txt thrown at the end because github doesn't want me to share .ini files ;)) I will check out Ad.3 and the seperate issue after my lunch break, but thanks for your thoughts so far! |
Ad.3 Concerning Ad.2:
I'm curious to hear more about your thoughts on the issue :) |
Question 2 has now been answered+fixed under #205.
Yes: if a model is valid for D-HYDRO, then HYDROLIB-core should not complain. This was a bug.
I can see more need for this indeed, I've opened a dedicated issue about bypassing validation, so we can clearly answer that there: #207. |
All questions answered/fixed, or split off into separate issues. Closing this issue. |
Describe the bug
Perhaps this is just another case where I'm just missing one detail on how to use the model/method, but I'm having trouble with the whole model -> dataframe -> model process for crosssection definitions.
I've been trying to adapt the way of working from the developers training and the tutorial in the docs: https://deltares.github.io/HYDROLIB-core/0.2.0/tutorials/dataframe_handling/
Based on this, and some testing, I think this should be the code:
So far I tried 3 different models, and have 3 different results.
1. A small dummy model (1 branch, 2 profiles, 0 structures)
The workflow works in this situation.
2. Model from Oosterwolde area (from one of our own projects)
We know this model works in DHydro itself, but I can't even open it with hydrolib. It goes something like this:
(I also tried to get to the CrossDefModel via fm.geometry.crossdeffile.definition but that also doesn't work.)
In this case, I think it's clear it has to do with the data of the source model. Perhaps the validation is too strict, since the model itself is fine in DHydro. It is therefore annoying that this doesn't work.
3. Model from the developer training
I can read the cross section def from this model, but I cannot convert it back to a model
Both when using
fm.geometry.crossdeffile.definition
andCrossDefModel()
I get an error when I doCrossDefModel(definition=cross_def.to_dict("records"))
Perhaps interesting, this is how the dataframe looks at that point
Expected behavior
I would expect that getting to the cross section definitions, either by reading the ini directly, or through fm.geometry, would give me crosssection definition model. I also expect to be able to convert that model to Pandas and then back again.
Version info (please complete the following information):
I hope someone can give some pointers. Am I using the methods correctly? Where do these issues come from?
Also, best wishes for the new year! :)
The text was updated successfully, but these errors were encountered: