-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves ribasim_lumping from scripts to src, adds pyproject.toml and readme. For the other packages we now all switch to using hatchling building, and adding them all as editable dependencies to pixi. Only ribasim_lumping doesn't load yet due to #122. Though this is good to merge.
- Loading branch information
Showing
37 changed files
with
5,359 additions
and
188 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Helpers for building Bokeh dashboards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.0.1" | ||
__version__ = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,27 @@ | ||
[build-system] | ||
requires = ["setuptools>=61"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "peilbeheerst_model" | ||
description = "functions to derive a Ribasim network from a hydro-dataset" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Guy Dupuits", email = "[email protected]" }, | ||
{ name = "Jerom Aerts", email = "[email protected]" }, | ||
{ name = "Ron Bruijns", email = "[email protected]" }, | ||
{ name = "Jerom Aerts", email = "[email protected]" }, | ||
{ name = "Ron Bruijns", email = "[email protected]" }, | ||
] | ||
license = { text = "MIT" } | ||
|
||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"geopandas", | ||
"numpy", | ||
"pandas", | ||
"pydantic", | ||
"shapely", | ||
"tqdm", | ||
] | ||
dependencies = ["geopandas", "numpy", "pandas", "pydantic", "shapely", "tqdm"] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
tests = ["pytest"] | ||
|
||
[tool.setuptools] | ||
zip-safe = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "peilbeheerst_model.__version__" } | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["peilbeheerst_model"] | ||
|
||
[tool.hatch.version] | ||
path = "peilbeheerst_model/__init__.py" | ||
|
||
[project.urls] | ||
Documentation = "https://deltares.github.io/Ribasim-NL/Peilbeheerst-model" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# PyCharm .idea-folder | ||
.idea/* | ||
|
||
# Windows command-files | ||
*.cmd | ||
*.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ribasim-lumping | ||
|
||
This python package is used to develop an aggregated Ribasim network (Deltares, https://github.com/Deltares/Ribasim). Documentation: https://deltares.github.io/Ribasim/ | ||
|
||
This code was integrated into the Ribasim-NL repository after development in https://github.com/harm-nomden-sweco/ribasim_lumping. | ||
|
||
### Objective | ||
This python-package provides functions to translate a D-Hydro or a HyDAMO network into a simplified (aggregated/lumped) Ribasim-network: | ||
- The user provides a list of locations where the network should be split, resulting into sub-networks which are called 'basins''; | ||
- For these basins relations regarding waterlevel-watersurface-watervolume are calculated; | ||
- Exchange of watervolume (flow) between basins takes place via these split locations. | ||
- Stage-discharge relations are generated to define flow-rates between basins. | ||
|
||
### Dependencies | ||
Most important dependencies: | ||
- NETWORKX (https://networkx.org/, Hagberg et al., 2008) | ||
- UGRID (https://github.com/Deltares/UGridPy) | ||
- XUGRID (https://github.com/Deltares/xugrid) | ||
|
||
### Installation | ||
We will make this package accessible via pypi. It is recommended to clone this repository because it is under development and it includes some example notebooks. We are still working on tests and test data, etc. | ||
|
||
### Development, contributions and licences | ||
This package is developed by Sweco (contributors: Harm Nomden and Tessa Andringa) when working on a TKI-project (top consortia for knowledge and innovation) within the NHI programme (Dutch Hydrological Instruments programme). This focuses on the development, testing and application of the new Ribasim-model (https://tkideltatechnologie.nl/project/oppervlaktewatermodule-nhi/). | ||
It is possible to contribute, create issues, start discussions. We will respond as soon as possible. | ||
This package is developed under the MIT license. Reference to this package: Ribasim-Lumping (Sweco, 2023). | ||
|
||
### References: | ||
Aric A. Hagberg, Daniel A. Schult and Pieter J. Swart, “Exploring network structure, dynamics, and function using NetworkX”, in Proceedings of the 7th Python in Science Conference (SciPy2008), Gäel Varoquaux, Travis Vaught, and Jarrod Millman (Eds), (Pasadena, CA USA), pp. 11–15, Aug 2008 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "ribasim_lumping" | ||
description = "Aggregate a HyDAMO or D-Hydro network into a simplified Ribasim network" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Harm Nomden", email = "[email protected]" }, | ||
{ name = "Tessa Andringa", email = "[email protected]" }, | ||
] | ||
license = { text = "MIT" } | ||
|
||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"contextily", | ||
"geopandas", | ||
"matplotlib", | ||
"networkx", | ||
"numpy", | ||
"pandas", | ||
"pydantic", | ||
"ribasim", | ||
"shapely", | ||
"xarray", | ||
"xugrid", | ||
] | ||
dynamic = ["version"] | ||
|
||
[tool.hatch.version] | ||
path = "ribasim_lumping/__init__.py" |
2 changes: 2 additions & 0 deletions
2
scripts/ribasim_lumping/__init__.py → ...basim_lumping/ribasim_lumping/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
__version__ = "0.1.0" | ||
|
||
from ribasim_lumping.ribasim_lumping import create_ribasim_lumping_network | ||
|
||
__all__ = ["create_ribasim_lumping_network"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
[build-system] | ||
requires = ["setuptools>=61"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "ribasim_nl" | ||
description = "functions to work with python classes you typically find in hydro-datasets" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "Daniel Tollenaar", email = "[email protected]" }, | ||
{ name = "Martijn Visser", email = "[email protected]" } | ||
{ name = "Martijn Visser", email = "[email protected]" } | ||
] | ||
license = { text = "MIT" } | ||
|
||
|
@@ -21,15 +21,8 @@ dynamic = ["version"] | |
[project.optional-dependencies] | ||
tests = ["pytest"] | ||
|
||
[tool.setuptools] | ||
zip-safe = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "ribasim_nl.__version__" } | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["ribasim_nl"] | ||
|
||
[tool.hatch.version] | ||
path = "ribasim_nl/__init__.py" | ||
|
||
[project.urls] | ||
Documentation = "https://deltares.github.io/Ribasim-NL" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters