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

friction values are not assigned to branches when a model is read #168

Open
2 tasks done
shartgring opened this issue Oct 2, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@shartgring
Copy link
Collaborator

shartgring commented Oct 2, 2024

Version checks

  • I have checked that this issue has not already been reported.
  • I have checked that this bug exists on the latest version.

Reproducible Example

The workflow for setting point cross-sections, which is used for cross-sections but also bridges and culverts, relies on the branches containing the columns ["frictionid", "frictiontype", "frictionvalue"]. In workflows.crosssections.py:

crosssections = crosssections.merge(
branches[["frictionid", "frictiontype", "frictionvalue"]],
left_on="branch_id",
right_index=True,
)

However, when a DFlowFM model is read using read_model, these attributes are not read, and only columns found in the branches.gui file are included. I looked at prepare_default_friction_and_crosssection() but I think it that we might be looking for something else

Current behaviour

When a model is read, no friction info is added to the branches. This info is used by other parts of the code

Desired behaviour

Either change workflows such that the friction info is not needed, or enhance model reading such that the friction of the branches can be inferred from a model. A possible (easy) solution is reading the branches geom, but this will then not work with DFlowFM models that are not built using hydromt_delft3dfm. Either way, I think there are multiple solutions and that therefore some extra thinking is required for finding the best solution

Additional context

No response

@shartgring shartgring added the bug Something isn't working label Oct 2, 2024
@shartgring
Copy link
Collaborator Author

See also the tests in #169 where this problem was found. Ideally, the tests of setup_bridges and setup_culverts should be able to run directly after reading the test model, without first calling the setup_channels method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant