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

fixed typo in setup manholes parameters #187

Merged
merged 8 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Changed
-------
- Change default spacing in setup_channels from ``None`` to ``np.inf``. (PR #133)
- Added ``maxdist`` variable to setup_rivers and setup_channels. (PR #153)
- Renamed ``manhole_defaults_fn`` to ``manholes_defaults_fn`` in ``setup_manholes`` for consistency. (PR #187)

Fixed
-----
Expand Down
2 changes: 1 addition & 1 deletion examples/build_1d2dmodel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"\n",
"- [setup_rivers_from_dem](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_rivers_from_dem.html): We will derive the 1D rivers lines based on the *MERIT Hydro DEM* and that intersects with the region bounding box [12.4331, 46.4661, 12.5212, 46.5369]. River roughness will be a Manning constant of 25.0 and we will use data from *rivers_lin2019* database to prepare rectangular cross-sections. \n",
"- [setup_pipes](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_pipes.html): We will add pipes by assuming that they are located under the roads, with a standard length of 50 meters. The roads are defined in the *grip_roads* data and the standard length are defined in the argument spacing. Roughness will be a WhiteColeBrook constant of 0.003 and we will use a circular cross-sections of 0.5m. The pipes invert levels will be derived from the *MERIT Hydro DEM* assuming a constant depth of the pipe underground of 2 meters. \n",
"- [setup_manholes](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_manholes.html): For a pipe network, manholes are present at pipe connections. Here we do not have specific input data locations for our pipes, so manholes will be generated based on a set of standards specified in manhole_defaults_fn.\n",
"- [setup_manholes](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_manholes.html): For a pipe network, manholes are present at pipe connections. Here we do not have specific input data locations for our pipes, so manholes will be generated based on a set of standards specified in manholes_defaults_fn.\n",
"- [setup_1dboundary](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_1dboundary.html): Finally as a default, we will apply both upstream and downstream boundaries of our rivers with a constant waterlevel of -2.0 meter a.s.l\n",
"\n",
"- [setup_mesh2d](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_mesh2d.html): we will prepare a regular grid for the region bounding box [12.4331, 46.4661, 12.5212, 46.5369] of *500***500* meters resolution.\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/build_1dmodel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"- [global](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.html#hydromt_delft3dfm.DFlowFMModel): Our model will be defined in the projected CRS WGS84 EPSG 3857. TO ensure the 1D network is connected, we will allow snapping of 25 meters using argument network_snap_offset. The 1D computational grid for the open water system will be created at 40 meters distance using argument openwater_computation_node_distance. \n",
"- [setup_rivers_from_dem](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_rivers_from_dem.html): We will derive the 1D rivers lines based on the *MERIT Hydro DEM* and that intersects with the region bounding box [12.4331, 46.4661, 12.5212, 46.5369]. River roughness will be a Manning constant of 25.0 and we will use data from *rivers_lin2019* database to prepare rectangular cross-sections. \n",
"- [setup_pipes](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_pipes.html): We will add pipes by assuming that they are located under the roads, with a standard length of 50 meters. The roads are defined in the *grip_roads* data and the standard length are defined in the argument spacing. Roughness will be a WhiteColeBrook constant of 0.003 and we will use a circular cross-sections of 0.5m. The pipes invert levels will be derived from the *MERIT Hydro DEM* assuming a constant depth of the pipe underground of 2 meters. \n",
"- [setup_manholes](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_manholes.html): For a pipe network, manholes are present at pipe connections. Here we do not have specific input data locations for our pipes, so manholes will be generated based on a set of standards specified in manhole_defaults_fn.\n",
"- [setup_manholes](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_manholes.html): For a pipe network, manholes are present at pipe connections. Here we do not have specific input data locations for our pipes, so manholes will be generated based on a set of standards specified in manholes_defaults_fn.\n",
"- [setup_1dboundary](https://deltares.github.io/hydromt_delft3dfm/latest/_generated/hydromt_delft3dfm.DFlowFMModel.setup_1dboundary.html): Finally as a default, we will apply both upstream and downstream boundaries of our rivers with a constant waterlevel of -2.0 meter a.s.l\n",
"\n",
"Feel free to use the links of each components to know more about how each function works and what are all the available settings."
Expand Down
2 changes: 1 addition & 1 deletion examples/dflowfm_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ setup_pipes:

setup_manholes:
manholes_fn:
manhole_defaults_fn: manholes_defaults
manholes_defaults_fn: manholes_defaults
dem_fn: merit_hydro
bedlevel_shift: 0.5

Expand Down
2 changes: 1 addition & 1 deletion examples/dflowfm_build1d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ setup_pipes:

setup_manholes:
manholes_fn:
manhole_defaults_fn: manholes_defaults
manholes_defaults_fn: manholes_defaults
dem_fn: merit_hydro
bedlevel_shift: 0.5

Expand Down
10 changes: 5 additions & 5 deletions hydromt_delft3dfm/dflowfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ def _setup_crosssections(
def setup_manholes(
self,
manholes_fn: str = None,
manhole_defaults_fn: str = "manholes_defaults",
manholes_defaults_fn: str = "manholes_defaults",
bedlevel_shift: float = -0.5,
dem_fn: str = None,
snap_offset: float = 1e-3,
Expand All @@ -1330,7 +1330,7 @@ def setup_manholes(
Can only be used after all branches are setup.

The manholes are generated based on a set of standards specified in
``manhole_defaults_fn`` (default) and can be overwritten with manholes
``manholes_defaults_fn`` (default) and can be overwritten with manholes
read from ``manholes_fn``.

Use ``manholes_fn`` to set the manholes from a dataset of point locations.
Expand All @@ -1339,7 +1339,7 @@ def setup_manholes(

Manhole attributes ["area", "streetstoragearea", "storagetype", "streetlevel"]
are either taken from ``manholes_fn`` or filled in using defaults in
``manhole_defaults_fn``.
``manholes_defaults_fn``.
Manhole attribute ["bedlevel"] is always generated from invert levels of the
pipe/tunnel network plus a shift defined in ``bedlevel_shift``. This is needed
for numerical stability.
Expand Down Expand Up @@ -1414,7 +1414,7 @@ def setup_manholes(
self.set_branches(branches)

# add manhole attributes from defaults
defaults = self.data_catalog.get_dataframe(manhole_defaults_fn)
defaults = self.data_catalog.get_dataframe(manholes_defaults_fn)

# add defaults
manholes = workflows.update_data_columns_attributes(manholes, defaults)
Expand Down Expand Up @@ -3713,7 +3713,7 @@ def set_mesh(

def set_link1d2d(
self,
link1d2d: xr.Dataset(),
link1d2d: xr.Dataset,
):
"""
Add or replace the link1d2d in the model mesh.
Expand Down
4 changes: 1 addition & 3 deletions hydromt_delft3dfm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ def write_branches_gui(
return branchgui_fn


def read_crosssections(
gdf: gpd.GeoDataFrame, fm_model: FMModel
) -> tuple((gpd.GeoDataFrame, gpd.GeoDataFrame)):
def read_crosssections(gdf: gpd.GeoDataFrame, fm_model: FMModel) -> gpd.GeoDataFrame:
"""
Read crosssections from hydrolib-core crsloc and crsdef objects and add to branches.

Expand Down
2 changes: 1 addition & 1 deletion tests/data/dflowfm_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ setup_pipes:

setup_manholes:
manholes_fn:
manhole_defaults_fn: manholes_defaults
manholes_defaults_fn: manholes_defaults
dem_fn: merit_hydro
bedlevel_shift: 0.5

Expand Down
Loading