Skip to content

Commit

Permalink
Mesh model (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
hboisgon authored Aug 21, 2023
1 parent 3e83585 commit 1ebbcfb
Show file tree
Hide file tree
Showing 12 changed files with 692 additions and 171 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9','3.10','3.11']
Expand Down
19 changes: 17 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,13 @@ Components and attributes
:toctree: _generated

MeshModel.mesh
MeshModel.mesh_names
MeshModel.mesh_grids
MeshModel.mesh_datasets
MeshModel.mesh_gdf
MeshModel.crs
MeshModel.region
MeshModel.bounds

General methods
---------------
Expand All @@ -338,6 +343,7 @@ General methods
:toctree: _generated

MeshModel.set_mesh
MeshModel.get_mesh
MeshModel.read_mesh
MeshModel.write_mesh

Expand All @@ -350,10 +356,11 @@ Setup methods

MeshModel.setup_config
MeshModel.setup_region
MeshModel.setup_mesh2d
MeshModel.setup_mesh2d_from_rasterdataset
MeshModel.setup_mesh2d_from_raster_reclass
MeshModel.setup_maps_from_rasterdataset
MeshModel.setup_maps_from_raster_reclass
MeshModel.setup_mesh_from_rasterdataset
MeshModel.setup_mesh_from_raster_reclass


=========
Expand All @@ -371,6 +378,14 @@ Grid
workflows.grid.grid_from_raster_reclass
workflows.grid.grid_from_geodataframe

Mesh
====

.. autosummary::
:toctree: _generated

workflows.mesh.create_mesh2d


Basin mask
==========
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Added

Changed
-------
- Updated ``MeshModel`` and related methods to support multigrids instead of one single 2D grid. PR #412
- possibility to ``load`` the data in the model read_ functions for netcdf files (default for read_grid in r+ mode). (PR #460)
- Internal model components (e.g. `Models._maps`, `GridModel._grid``) are now initialized with None and should not be accessed directly,
call the corresponding model property (e.g. `Model.maps`, `GridModel.grid`) instead. (PR #473)
Expand Down
5 changes: 3 additions & 2 deletions docs/user_guide/model_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ While a generalized model class can readily be used, it can also be tailored to

.. NOTE::

As of version 0.6.0, the grid model (distributed grid model), lumped model (semi-distributed and lumped models), mesh model (unstructured grid models) have been implemented. Other model classes such as network models will follow in future versions.
As of version 0.6.0, the grid model (distributed grid model), lumped model (semi-distributed and lumped models), mesh model (unstructured grid(s) models) have been implemented. Other model classes such as network models will follow in future versions.

The table below lists the base model components common to all model classes.
All base model attributes and methods can be found the :ref:`API reference <model_api>`
Expand Down Expand Up @@ -112,9 +112,10 @@ For each generalized model class, the respective computational unit components e
| :py:func:`~LumpedModel.write_response_units`
* - mesh
- :ref:`MeshModel <mesh_model_api>`
- Static mesh (unstructured grid) data
- Static mesh (unstructured grid(s)) data
- | :py:attr:`~MeshModel.mesh`
| :py:func:`~MeshModel.set_mesh`
| :py:func:`~MeshModel.get_mesh`
| :py:func:`~MeshModel.read_mesh`
| :py:func:`~MeshModel.write_mesh`
Expand Down
2 changes: 2 additions & 0 deletions docs/user_guide/model_region.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Geospatial region

Based on a raster file: ``{'grid': '/path/to/raster_file'}``

Based on a mesh file: ``{'mesh': '/path/to/mesh_file'}``

Hydrographic region
^^^^^^^^^^^^^^^^^^^

Expand Down
Loading

0 comments on commit 1ebbcfb

Please sign in to comment.