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

typo in allowed columns for setup_pipes #173

Closed
2 tasks done
jeroenwinkelhorst opened this issue Oct 8, 2024 · 3 comments · Fixed by #193
Closed
2 tasks done

typo in allowed columns for setup_pipes #173

jeroenwinkelhorst opened this issue Oct 8, 2024 · 3 comments · Fixed by #193
Labels
bug Something isn't working

Comments

@jeroenwinkelhorst
Copy link

jeroenwinkelhorst commented Oct 8, 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

fm.setup_pipes(region={"geom": "input/region.shp"}, pipes_fn=fn_conduit_preproc, friction_type="Manning")

fn_conduit_preproc contains pipe geometry with the columns ['branchid', 'width', 'height', 'invlev_up', 'invlev_dn',
'frictionvalue', 'shape', 'geometry']

Current behaviour

column invlev_dn is dropped and replace with a default value

Desired behaviour

use the values in the column invlev_dn

Additional context

variable _allowed_columns contains a type "inlev_dn" should be "invlev_dn"

@jeroenwinkelhorst jeroenwinkelhorst added the bug Something isn't working label Oct 8, 2024
@jeroenwinkelhorst jeroenwinkelhorst changed the title typo in allowed columns typo in allowed columns for setup_pipes Oct 8, 2024
@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Oct 16, 2024

@jeroenwinkelhorst could you share a reproducible example that shows the unexpected behavior? That makes it easier to debug and we could also directly add it as a test upon fixing the bug. If you have a suggestion what exactly to change in the code, you are also welcome to do a suggestion or open a PR.

@jeroenwinkelhorst
Copy link
Author

jeroenwinkelhorst commented Oct 18, 2024

Hi Jelmer, an reproducable example is too much effort for this small bug. In https://github.com/Deltares/hydromt_delft3dfm/blob/main/hydromt_delft3dfm/dflowfm.py in the function setup_pipes() you must change the last value in the _variable _allowed_columns

Current:

        # filter for allowed columns
        br_type = "pipe"
        _allowed_columns = [
            "geometry",
            "branchid",
            "branchtype",
            "branchorder",
            "material",
            "spacing",
            "branchid",
            "frictionvalue",
            "shape",  # circle or rectangle
            "diameter",  # circle
            "width",  # rectangle
            "height",  # rectangle
            "invlev_up",
            "inlev_dn",
        ]

Fixed:

        # filter for allowed columns
        br_type = "pipe"
        _allowed_columns = [
            "geometry",
            "branchid",
            "branchtype",
            "branchorder",
            "material",
            "spacing",
            "branchid",
            "frictionvalue",
            "shape",  # circle or rectangle
            "diameter",  # circle
            "width",  # rectangle
            "height",  # rectangle
            "invlev_up",
            "invlev_dn",
        ]

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Oct 18, 2024

This is already very helpful, thanks!

This was referenced Oct 18, 2024
@veenstrajelmer veenstrajelmer linked a pull request Oct 18, 2024 that will close this issue
5 tasks
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

Successfully merging a pull request may close this issue.

2 participants