hydromodpy 0.3.0__py3-none-any.whl

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 (79) hide show
  1. bin/linux/mf6 +0 -0
  2. bin/linux/mfnwt +0 -0
  3. bin/linux/mp6 +0 -0
  4. bin/linux/mp7 +0 -0
  5. bin/linux/mt3dusgs +0 -0
  6. bin/mac/mf6 +0 -0
  7. bin/mac/mfnwt +0 -0
  8. bin/mac/mp6 +0 -0
  9. bin/mac/mp7 +0 -0
  10. bin/mac/mt3dusgs +0 -0
  11. bin/win/mf6.exe +0 -0
  12. bin/win/mfnwt.exe +0 -0
  13. bin/win/mp6.exe +0 -0
  14. bin/win/mp7.exe +0 -0
  15. bin/win/mt3d-usgs_1.1.0_64.exe +0 -0
  16. hydromodpy/__init__.py +127 -0
  17. hydromodpy/display/__init__.py +0 -0
  18. hydromodpy/display/export_vtuvtk.py +1225 -0
  19. hydromodpy/display/visualization_results.py +885 -0
  20. hydromodpy/display/visualization_watershed.py +400 -0
  21. hydromodpy/modeling/__init__.py +0 -0
  22. hydromodpy/modeling/downslope.py +143 -0
  23. hydromodpy/modeling/gr4j/__init__.py +8 -0
  24. hydromodpy/modeling/gr4j/calibre_gr4j.py +95 -0
  25. hydromodpy/modeling/gr4j/ennash.py +13 -0
  26. hydromodpy/modeling/gr4j/etp_turc.py +87 -0
  27. hydromodpy/modeling/gr4j/gr4j_cal.py +204 -0
  28. hydromodpy/modeling/gr4j/test_example_run_gr4j.py +322 -0
  29. hydromodpy/modeling/masstransfer.py +139 -0
  30. hydromodpy/modeling/modflow.py +1375 -0
  31. hydromodpy/modeling/modpath.py +754 -0
  32. hydromodpy/modeling/mt3dms.py +410 -0
  33. hydromodpy/modeling/netcdf.py +386 -0
  34. hydromodpy/modeling/timeseries.py +553 -0
  35. hydromodpy/pyhelp/__init__.py +274 -0
  36. hydromodpy/pyhelp/bilan.py +225 -0
  37. hydromodpy/pyhelp/daily_output.py +148 -0
  38. hydromodpy/pyhelp/help_example.py +144 -0
  39. hydromodpy/pyhelp/help_example_cli.py +64 -0
  40. hydromodpy/pyhelp/main_cdf.py +94 -0
  41. hydromodpy/pyhelp/managers.py +684 -0
  42. hydromodpy/pyhelp/output.py +522 -0
  43. hydromodpy/pyhelp/prepare_inputs.py +52 -0
  44. hydromodpy/pyhelp/preprocessing.py +254 -0
  45. hydromodpy/pyhelp/processing.py +240 -0
  46. hydromodpy/pyhelp/pyhelp_csv_manager.py +32 -0
  47. hydromodpy/pyhelp/pyhelp_era5.py +155 -0
  48. hydromodpy/pyhelp/pyhelp_grid.py +139 -0
  49. hydromodpy/pyhelp/pyhelp_netcdf.py +235 -0
  50. hydromodpy/pyhelp/pyhelp_netcdf_writer.py +170 -0
  51. hydromodpy/pyhelp/utils.py +93 -0
  52. hydromodpy/pyhelp/weather_reader.py +104 -0
  53. hydromodpy/tools/__init__.py +10 -0
  54. hydromodpy/tools/folder_root.py +151 -0
  55. hydromodpy/tools/log_manager.py +265 -0
  56. hydromodpy/tools/toolbox.py +1045 -0
  57. hydromodpy/watershed/__init__.py +0 -0
  58. hydromodpy/watershed/climatic.py +551 -0
  59. hydromodpy/watershed/driasclimat.py +368 -0
  60. hydromodpy/watershed/driaseau.py +279 -0
  61. hydromodpy/watershed/geographic.py +524 -0
  62. hydromodpy/watershed/geology.py +196 -0
  63. hydromodpy/watershed/hydraulic.py +405 -0
  64. hydromodpy/watershed/hydrography.py +134 -0
  65. hydromodpy/watershed/hydrometry.py +103 -0
  66. hydromodpy/watershed/intermittency.py +149 -0
  67. hydromodpy/watershed/oceanic.py +242 -0
  68. hydromodpy/watershed/piezometry.py +413 -0
  69. hydromodpy/watershed/safransurfex.py +204 -0
  70. hydromodpy/watershed/settings.py +173 -0
  71. hydromodpy/watershed/sim2.py +774 -0
  72. hydromodpy/watershed/subbasin.py +199 -0
  73. hydromodpy/watershed/transport.py +72 -0
  74. hydromodpy/watershed_root.py +1154 -0
  75. hydromodpy-0.3.0.dist-info/METADATA +219 -0
  76. hydromodpy-0.3.0.dist-info/RECORD +79 -0
  77. hydromodpy-0.3.0.dist-info/WHEEL +5 -0
  78. hydromodpy-0.3.0.dist-info/licenses/LICENSE +277 -0
  79. hydromodpy-0.3.0.dist-info/top_level.txt +1 -0
bin/linux/mf6 ADDED
Binary file
bin/linux/mfnwt ADDED
Binary file
bin/linux/mp6 ADDED
Binary file
bin/linux/mp7 ADDED
Binary file
bin/linux/mt3dusgs ADDED
Binary file
bin/mac/mf6 ADDED
Binary file
bin/mac/mfnwt ADDED
Binary file
bin/mac/mp6 ADDED
Binary file
bin/mac/mp7 ADDED
Binary file
bin/mac/mt3dusgs ADDED
Binary file
bin/win/mf6.exe ADDED
Binary file
bin/win/mfnwt.exe ADDED
Binary file
bin/win/mp6.exe ADDED
Binary file
bin/win/mp7.exe ADDED
Binary file
Binary file
hydromodpy/__init__.py ADDED
@@ -0,0 +1,127 @@
1
+ """Public entry points for HydroModPy."""
2
+
3
+ import logging
4
+ import os
5
+ import sys
6
+ from importlib import metadata
7
+ from pathlib import Path
8
+
9
+ _bootstrap_logger = logging.getLogger("hydromodpy")
10
+
11
+
12
+ def _ensure_proj_data_from_env() -> None:
13
+ """Force PROJ to use the database that ships with the active environment."""
14
+ try:
15
+ from pyproj import datadir
16
+ except Exception: # pyproj optional in some contexts
17
+ return
18
+
19
+ proj_dir = datadir.get_data_dir()
20
+ if not proj_dir:
21
+ _bootstrap_logger.debug("pyproj.datadir returned an empty path; PROJ env unchanged.")
22
+ return
23
+
24
+ env_proj_path = Path(proj_dir).expanduser()
25
+ try:
26
+ env_proj_resolved = env_proj_path.resolve()
27
+ except OSError:
28
+ env_proj_resolved = env_proj_path
29
+
30
+ proj_db = env_proj_resolved / "proj.db"
31
+ if not proj_db.exists():
32
+ _bootstrap_logger.debug(
33
+ "pyproj datadir %s does not contain proj.db; PROJ environment variables unchanged.",
34
+ env_proj_resolved,
35
+ )
36
+ return
37
+
38
+ env_root = Path(sys.prefix)
39
+
40
+ def _within_env(path: Path) -> bool:
41
+ try:
42
+ path.resolve().relative_to(env_root.resolve())
43
+ return True
44
+ except Exception:
45
+ return False
46
+
47
+ current_proj_data = os.environ.get("PROJ_DATA")
48
+ if current_proj_data:
49
+ try:
50
+ current_path = Path(current_proj_data).expanduser()
51
+ current_resolved = current_path.resolve()
52
+ except OSError:
53
+ current_path = Path(current_proj_data)
54
+ current_resolved = current_path
55
+
56
+ if current_resolved == env_proj_resolved:
57
+ _bootstrap_logger.debug(
58
+ "PROJ_DATA already targets the environment-specific directory %s; keeping as-is.",
59
+ current_proj_data,
60
+ )
61
+ os.environ.setdefault("PROJ_LIB", current_proj_data)
62
+ return
63
+
64
+ if current_path.exists() and _within_env(current_resolved):
65
+ _bootstrap_logger.debug(
66
+ "PROJ_DATA=%s already points inside the active environment (%s); keeping user setting.",
67
+ current_proj_data,
68
+ env_root,
69
+ )
70
+ os.environ.setdefault("PROJ_LIB", current_proj_data)
71
+ return
72
+
73
+ reason = (
74
+ "does not exist on disk" if not current_path.exists() else "points outside the active environment"
75
+ )
76
+ _bootstrap_logger.warning(
77
+ "PROJ_DATA=%s %s; switching HydroModPy to %s instead.",
78
+ current_proj_data,
79
+ reason,
80
+ env_proj_resolved,
81
+ )
82
+
83
+ os.environ["PROJ_DATA"] = str(env_proj_resolved)
84
+ os.environ["PROJ_LIB"] = str(env_proj_resolved)
85
+ _bootstrap_logger.debug("PROJ_DATA/PROJ_LIB set to %s via pyproj.datadir", env_proj_resolved)
86
+
87
+
88
+ _ensure_proj_data_from_env()
89
+
90
+ try:
91
+ __version__ = metadata.version("hydromodpy")
92
+ except metadata.PackageNotFoundError:
93
+ import tomllib
94
+
95
+ _pyproject = Path(__file__).resolve().parents[1] / "pyproject.toml"
96
+ with _pyproject.open("rb") as fh:
97
+ __version__ = tomllib.load(fh)["project"]["version"]
98
+
99
+ __author__ = "Alexandre Gauvain, Ronan Abhervé, Jean-Raynald de Dreuzy"
100
+ __email__ = "alexandre.gauvain.ag@gmail.com, ronan.abherve@gmail.com, jean-raynald.de-dreuzy@univ-rennes.fr"
101
+
102
+ # Initialize logging system
103
+ from hydromodpy.tools.log_manager import LogManager
104
+ _log_manager = LogManager(mode="verbose", log_dir=None, overwrite=False)
105
+ # Public access to log manager for users
106
+ log_manager = _log_manager
107
+
108
+ # Import main class
109
+ from hydromodpy.watershed_root import Watershed
110
+
111
+ # Import submodules for convenience
112
+ from hydromodpy import watershed
113
+ from hydromodpy import modeling
114
+ from hydromodpy import display
115
+ from hydromodpy import tools
116
+ from hydromodpy import pyhelp
117
+
118
+ __all__ = [
119
+ "Watershed",
120
+ "watershed",
121
+ "modeling",
122
+ "display",
123
+ "tools",
124
+ "pyhelp",
125
+ "log_manager",
126
+ "__version__",
127
+ ]
File without changes