fluxpark 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. fluxpark-0.1.0/LICENSE.txt +33 -0
  2. fluxpark-0.1.0/PKG-INFO +63 -0
  3. fluxpark-0.1.0/pyproject.toml +49 -0
  4. fluxpark-0.1.0/setup.cfg +4 -0
  5. fluxpark-0.1.0/src/fluxpark/__init__.py +43 -0
  6. fluxpark-0.1.0/src/fluxpark/config/__init__.py +3 -0
  7. fluxpark-0.1.0/src/fluxpark/config/fluxpark_config.py +117 -0
  8. fluxpark-0.1.0/src/fluxpark/io/__init__.py +4 -0
  9. fluxpark-0.1.0/src/fluxpark/io/raster_tools.py +408 -0
  10. fluxpark-0.1.0/src/fluxpark/io/vector_tools.py +80 -0
  11. fluxpark-0.1.0/src/fluxpark/postprocessing/__init__.py +9 -0
  12. fluxpark-0.1.0/src/fluxpark/postprocessing/post_process.py +201 -0
  13. fluxpark-0.1.0/src/fluxpark/postprocessing/write_output.py +159 -0
  14. fluxpark-0.1.0/src/fluxpark/prepgrids/__init__.py +9 -0
  15. fluxpark-0.1.0/src/fluxpark/prepgrids/interpolation.py +218 -0
  16. fluxpark-0.1.0/src/fluxpark/prepgrids/prep_grids.py +215 -0
  17. fluxpark-0.1.0/src/fluxpark/setup/__init__.py +27 -0
  18. fluxpark-0.1.0/src/fluxpark/setup/core_initialization.py +531 -0
  19. fluxpark-0.1.0/src/fluxpark/submodels/__init__.py +0 -0
  20. fluxpark-0.1.0/src/fluxpark/submodels/etref.py +55 -0
  21. fluxpark-0.1.0/src/fluxpark/submodels/interception.py +78 -0
  22. fluxpark-0.1.0/src/fluxpark/submodels/rootwateruptake.py +97 -0
  23. fluxpark-0.1.0/src/fluxpark/submodels/soilevaporation.py +97 -0
  24. fluxpark-0.1.0/src/fluxpark/utils/__init__.py +3 -0
  25. fluxpark-0.1.0/src/fluxpark/utils/common.py +9 -0
  26. fluxpark-0.1.0/src/fluxpark/workflow/__init__.py +4 -0
  27. fluxpark-0.1.0/src/fluxpark/workflow/loopstate.py +40 -0
  28. fluxpark-0.1.0/src/fluxpark/workflow/runner.py +359 -0
  29. fluxpark-0.1.0/src/fluxpark.egg-info/PKG-INFO +63 -0
  30. fluxpark-0.1.0/src/fluxpark.egg-info/SOURCES.txt +32 -0
  31. fluxpark-0.1.0/src/fluxpark.egg-info/dependency_links.txt +1 -0
  32. fluxpark-0.1.0/src/fluxpark.egg-info/requires.txt +13 -0
  33. fluxpark-0.1.0/src/fluxpark.egg-info/top_level.txt +1 -0
  34. fluxpark-0.1.0/tests/test_import.py +10 -0
@@ -0,0 +1,33 @@
1
+ FluxPark Custom License v1.0
2
+ SPDX-License-Identifier: Custom-MoistureMatters-1.0
3
+ Copyright © 2025 Bernard Voortman, Moisture Matters.
4
+
5
+ 1. License Grant
6
+ You are free to use, copy, modify and distribute FluxPark software, provided that you comply with all the restrictions below. This copyright notice and this list of conditions must be included in all copies or substantial portions of the software.
7
+
8
+ 2. Restrictions
9
+ a. No SaaS/Now-Casting
10
+ You may not offer FluxPark as a service (SaaS) or use it to generate recurring near-real-time outputs (for today, the past two months, or the coming month) in a repetitive manner—whether for commercial or non-commercial purposes.
11
+ b. No Sub-licensing
12
+ You may not sublicense the Software or impose additional restrictions on recipients without express written permission from Moisture Matters.
13
+ c. Attribution
14
+ In any distribution of the Software or in any publication, product, report or service that incorporates or is generated by FluxPark, you must include the following acknowledgment:
15
+ ```
16
+ FluxPark (Moisture Matters)
17
+ ```
18
+
19
+ 3. Commercial Licensing
20
+ If you need to use FluxPark in a SaaS/Now-Casting context, or require a warranty or indemnification, please contact support@moisturematters.nl for a Commercial License and Support Agreement.
21
+
22
+ 4. Disclaimer of Warranty
23
+ THIS SOFTWARE IS PROVIDED “AS IS” AND “AS-AVAILABLE” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
24
+
25
+ 5. Limitation of Liability
26
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
+
28
+ 6. Input Data
29
+ 6.1. All third-party datasets distributed with FluxPark remain subject to their original licenses.
30
+ 6.2. All proprietary datasets created by Moisture Matters and distributed as part of FluxPark are licensed under the terms of this FluxPark Custom License.
31
+
32
+ 7. Governing Law
33
+ This License shall be governed by the laws of The Netherlands, and any dispute shall be resolved in the courts of Utrecht.
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: fluxpark
3
+ Version: 0.1.0
4
+ Summary: Spatially-explicit hydrological model for simulating evaporation fluxes and groundwater recharge
5
+ Author-email: Bernard Voortman <bernard.voortman@moisture-matters.nl>
6
+ License: FluxPark Custom License v1.0
7
+ SPDX-License-Identifier: Custom-MoistureMatters-1.0
8
+ Copyright © 2025 Bernard Voortman, Moisture Matters.
9
+
10
+ 1. License Grant
11
+ You are free to use, copy, modify and distribute FluxPark software, provided that you comply with all the restrictions below. This copyright notice and this list of conditions must be included in all copies or substantial portions of the software.
12
+
13
+ 2. Restrictions
14
+ a. No SaaS/Now-Casting
15
+ You may not offer FluxPark as a service (SaaS) or use it to generate recurring near-real-time outputs (for today, the past two months, or the coming month) in a repetitive manner—whether for commercial or non-commercial purposes.
16
+ b. No Sub-licensing
17
+ You may not sublicense the Software or impose additional restrictions on recipients without express written permission from Moisture Matters.
18
+ c. Attribution
19
+ In any distribution of the Software or in any publication, product, report or service that incorporates or is generated by FluxPark, you must include the following acknowledgment:
20
+ ```
21
+ FluxPark (Moisture Matters)
22
+ ```
23
+
24
+ 3. Commercial Licensing
25
+ If you need to use FluxPark in a SaaS/Now-Casting context, or require a warranty or indemnification, please contact support@moisturematters.nl for a Commercial License and Support Agreement.
26
+
27
+ 4. Disclaimer of Warranty
28
+ THIS SOFTWARE IS PROVIDED “AS IS” AND “AS-AVAILABLE” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
29
+
30
+ 5. Limitation of Liability
31
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32
+
33
+ 6. Input Data
34
+ 6.1. All third-party datasets distributed with FluxPark remain subject to their original licenses.
35
+ 6.2. All proprietary datasets created by Moisture Matters and distributed as part of FluxPark are licensed under the terms of this FluxPark Custom License.
36
+
37
+ 7. Governing Law
38
+ This License shall be governed by the laws of The Netherlands, and any dispute shall be resolved in the courts of Utrecht.
39
+
40
+ Project-URL: Homepage, https://github.com/Moisture-Matters/fluxpark
41
+ Project-URL: Source, https://github.com/Moisture-Matters/fluxpark
42
+ Project-URL: Bug Tracker, https://github.com/Moisture-Matters/fluxpark/issues
43
+ Classifier: Development Status :: 4 - Beta
44
+ Classifier: Intended Audience :: Science/Research
45
+ Classifier: License :: Other/Proprietary License
46
+ Classifier: Programming Language :: Python :: 3
47
+ Classifier: Programming Language :: Python :: 3.9
48
+ Classifier: Topic :: Scientific/Engineering :: Hydrology
49
+ Requires-Python: >=3.9
50
+ Description-Content-Type: text/markdown
51
+ License-File: LICENSE.txt
52
+ Requires-Dist: numpy>=1.23.4
53
+ Requires-Dist: pandas>=1.5.1
54
+ Requires-Dist: scipy>=1.9.2
55
+ Requires-Dist: openpyxl>=3.0.0
56
+ Provides-Extra: test
57
+ Requires-Dist: pytest>=7.0; extra == "test"
58
+ Requires-Dist: pytest-cov; extra == "test"
59
+ Requires-Dist: flake8; extra == "test"
60
+ Provides-Extra: docs
61
+ Requires-Dist: sphinx; extra == "docs"
62
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
63
+ Dynamic: license-file
@@ -0,0 +1,49 @@
1
+ [project]
2
+ name = "fluxpark"
3
+ version = "0.1.0"
4
+ description = "Spatially-explicit hydrological model for simulating evaporation fluxes and groundwater recharge"
5
+ readme = "README.md"
6
+ requires-python = ">=3.9"
7
+ license = { file = "LICENSE.txt" }
8
+ authors = [
9
+ { name="Bernard Voortman", email="bernard.voortman@moisture-matters.nl" }
10
+ ]
11
+ dependencies = [
12
+ "numpy>=1.23.4",
13
+ "pandas>=1.5.1",
14
+ "scipy>=1.9.2",
15
+ "openpyxl>=3.0.0",
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Intended Audience :: Science/Research",
20
+ "License :: Other/Proprietary License",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Topic :: Scientific/Engineering :: Hydrology",
24
+ ]
25
+
26
+ [project.urls]
27
+ Homepage = "https://github.com/Moisture-Matters/fluxpark"
28
+ Source = "https://github.com/Moisture-Matters/fluxpark"
29
+ "Bug Tracker" = "https://github.com/Moisture-Matters/fluxpark/issues"
30
+
31
+ [project.optional-dependencies]
32
+ test = ["pytest>=7.0", "pytest-cov", "flake8"]
33
+ docs = ["sphinx", "sphinx-rtd-theme"]
34
+
35
+ [build-system]
36
+ requires = ["setuptools>=61.0"]
37
+ build-backend = "setuptools.build_meta"
38
+
39
+ [tool.setuptools.packages.find]
40
+ where = ["src"]
41
+
42
+ [tool.flake8]
43
+ max-line-length = 88
44
+ ignore = ["E203", "W503"]
45
+
46
+ [tool.pytest.ini_options]
47
+ testpaths = ["tests"]
48
+ python_files = ["test_*.py"] # only files with test_ prefix
49
+ python_functions = ["test_*"] # only functions with test_ prefix
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,43 @@
1
+ import importlib
2
+ import pkgutil
3
+ from importlib.metadata import version, PackageNotFoundError
4
+
5
+ try:
6
+ __version__ = version(__name__)
7
+ except PackageNotFoundError:
8
+ __version__ = "0.0.0" # for development
9
+
10
+
11
+ # import all modules dynamically
12
+ from . import config
13
+ from . import setup
14
+ from . import io
15
+ from . import postprocessing
16
+ from . import prepgrids
17
+ from . import submodels
18
+ from . import utils
19
+ from . import workflow
20
+ from .workflow.runner import FluxParkRunner
21
+
22
+ __all__ = [
23
+ "config",
24
+ "setup",
25
+ "io",
26
+ "postprocessing",
27
+ "prepgrids",
28
+ "utils",
29
+ "workflow",
30
+ "FluxParkRunner",
31
+ ]
32
+
33
+ for loader, module_name, is_pkg in pkgutil.iter_modules(submodels.__path__):
34
+ if module_name == "__init__":
35
+ continue # skip __init__.py
36
+
37
+ full_module_name = f"{submodels.__name__}.{module_name}"
38
+ module = importlib.import_module(full_module_name)
39
+
40
+ for attr in dir(module):
41
+ if not attr.startswith("_"):
42
+ globals()[attr] = getattr(module, attr)
43
+ __all__.append(attr)
@@ -0,0 +1,3 @@
1
+ from .fluxpark_config import FluxParkConfig
2
+
3
+ __all__ = ["FluxParkConfig"]
@@ -0,0 +1,117 @@
1
+ from dataclasses import dataclass
2
+ from pathlib import Path
3
+ from typing import Optional, Union
4
+
5
+
6
+ @dataclass
7
+ class FluxParkConfig:
8
+ """
9
+ Configuration settings for the FluxPark core simulation model.
10
+
11
+ This configuration object contains all general and spatial parameters
12
+ required to run the core model. It does not include any Nexus-specific logic.
13
+
14
+ Parameters
15
+ ----------
16
+ date_start : str
17
+ Start date of the simulation period (format: 'DD-MM-YYYY').
18
+ date_end : str
19
+ End date of the simulation period (format: 'DD-MM-YYYY').
20
+ mask : Optional[str]
21
+ Filename of the cutline raster mask used to clip input layers.
22
+ calc_epsg_code : int
23
+ EPSG code for the coordinate reference system used in calculations.
24
+ x_min : float
25
+ Minimum x-coordinate of the simulation extent.
26
+ x_max : float
27
+ Maximum x-coordinate of the simulation extent.
28
+ y_min : float
29
+ Minimum y-coordinate of the simulation extent.
30
+ y_max : float
31
+ Maximum y-coordinate of the simulation extent.
32
+ cellsize : float
33
+ Grid cell size (in map units) used for resampling input rasters.
34
+ evap_param_table : str
35
+ Filename of the Excel file containing evaporation parameters.
36
+ output_files : list[str] or str, default = "flagship"
37
+ List of output parameters to write to file or a string describing differnt
38
+ combinations of output (all, flagship).
39
+
40
+ indir : Union[str, Path], default='./input_data'
41
+ Root directory containing all input files.
42
+ indir_rasters : Optional[Union[str, Path]], default=None
43
+ Directory containing raster input files. If None, defaults to `indir/rasters`.
44
+ indir_masks : Optional[Union[str, Path]], default=None
45
+ Directory containing mask rasters. If None, defaults to `indir/masks`.
46
+ landuse_rastername : str, default="{year}_luse_ids.tif"
47
+ Filename pattern for the yearly land use raster.
48
+ root_soilm_scp_rastername : str, default="{year}_root_soilm_fc_scp_mm.tif"
49
+ Filename pattern for the soil moisture field capacity raster (saturated).
50
+ root_soilm_pwp_rastername : str, default="{year}_root_soilm_fc_pwp_mm.tif"
51
+ Filename pattern for the soil moisture wilting point raster.
52
+ impervdens_rastername : str, default="2018_impervdens.tif"
53
+ Filename of the imperviousness raster.
54
+ soil_cov_decid_rastername : str, default="forest_decid_soilcov_100m_3035.tif"
55
+ Filename of the deciduous forest cover raster.
56
+ soil_cov_conif_rastername : str, default="forest_conif_soilcov_100m_3035.tif"
57
+ Filename of the coniferous forest cover raster.
58
+ output_mapping : str, default="fluxpark_output_mapping.csv"
59
+ Filename of the mapping table from variables to parameters.
60
+ store_states : bool, default=False
61
+ If true, calculation parameters are added to the output list.
62
+ reset_cum_day : int, default=1
63
+ Day of the month when cumulative variables are reset.
64
+ reset_cum_month : int, default=1
65
+ Month when cumulative variables are reset.
66
+ mod_vegcover : bool, default=False
67
+ Whether to include dynamic vegetation cover in simulations.
68
+ only_yearly_output : bool, default=False
69
+ If True, only writes output at the end of the year (31 Dec).
70
+ parallel : bool, default=True
71
+ Whether to parallelize output writing.
72
+ max_workers : Optional[int], default=None
73
+ Maximum number of parallel workers (threads) to use.
74
+ outdir : Union[str, Path], default="./output_data"
75
+ Output directory where model results are stored.
76
+ intermediate_dir : Optional[Union[str, Path]], default=None
77
+ Optional intermediate directory for temporary files.
78
+ """
79
+
80
+ # Positional (non-default) arguments
81
+ date_start: str
82
+ date_end: str
83
+ mask: Optional[str]
84
+ calc_epsg_code: int
85
+ x_min: float
86
+ x_max: float
87
+ y_min: float
88
+ y_max: float
89
+ cellsize: float
90
+ evap_param_table: str
91
+
92
+ # Defaulted arguments
93
+ output_files: Union[str, list[str], list[int]] = "flagship"
94
+ indir: Union[str, Path] = "./input_data"
95
+ indir_rasters: Optional[Union[str, Path]] = None
96
+ indir_masks: Optional[Union[str, Path]] = None
97
+
98
+ landuse_rastername: str = "{year}_luse_ids.tif"
99
+ root_soilm_scp_rastername: str = "{year}_root_soilm_fc_scp_mm.tif"
100
+ root_soilm_pwp_rastername: str = "{year}_root_soilm_fc_pwp_mm.tif"
101
+ impervdens_rastername: str = "2018_impervdens.tif"
102
+ soil_cov_decid_rastername: str = "forest_decid_soilcov_100m_3035.tif"
103
+ soil_cov_conif_rastername: str = "forest_conif_soilcov_100m_3035.tif"
104
+ output_mapping: str = "fluxpark_output_mapping.csv"
105
+ store_states: bool = False
106
+
107
+ reset_cum_day: int = 1
108
+ reset_cum_month: int = 1
109
+
110
+ mod_vegcover: bool = False
111
+
112
+ only_yearly_output: bool = False
113
+ parallel: bool = True
114
+ max_workers: Optional[int] = None
115
+
116
+ outdir: Union[str, Path] = "./output_data"
117
+ intermediate_dir: Optional[Union[str, Path]] = None
@@ -0,0 +1,4 @@
1
+ from .raster_tools import GeoTiffReader, NetCDFReader, write_geotiff
2
+ from .vector_tools import write_point_layer
3
+
4
+ __all__ = ["GeoTiffReader", "NetCDFReader", "write_geotiff", "write_point_layer"]