plans 1.1.0.post1.dev0__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.
- plans/__init__.py +41 -0
- plans/analyst.py +3092 -0
- plans/config.py +103 -0
- plans/data/.gitkeep +2 -0
- plans/data/fields.csv +61 -0
- plans/data/files.csv +26 -0
- plans/data/tools.csv +2 -0
- plans/datasets/__init__.py +42 -0
- plans/datasets/chrono.py +540 -0
- plans/datasets/core.py +6224 -0
- plans/datasets/spatial.py +1298 -0
- plans/geo.py +1397 -0
- plans/hydrology/__init__.py +42 -0
- plans/hydrology/core.py +723 -0
- plans/hydrology/downscaled.py +1024 -0
- plans/hydrology/upscaled.py +3890 -0
- plans/parsers/__init__.py +40 -0
- plans/parsers/flare.py +484 -0
- plans/parsers/inmet.py +587 -0
- plans/parsers/snirh.py +219 -0
- plans/project.py +964 -0
- plans/qutils.py +3648 -0
- plans/root.py +2256 -0
- plans/tools/__init__.py +0 -0
- plans/tools/analysis_climate_series_lulc.py +231 -0
- plans/tools/analysis_dto.py +193 -0
- plans/tools/analysis_lulc_parameters.py +269 -0
- plans/tools/analysis_lulc_series.py +220 -0
- plans/tools/analysis_soils_parameters.py +253 -0
- plans/tools/core.py +559 -0
- plans/tools/demo.py +168 -0
- plans/viewer.py +414 -0
- plans-1.1.0.post1.dev0.dist-info/METADATA +120 -0
- plans-1.1.0.post1.dev0.dist-info/RECORD +37 -0
- plans-1.1.0.post1.dev0.dist-info/WHEEL +5 -0
- plans-1.1.0.post1.dev0.dist-info/licenses/LICENSE +674 -0
- plans-1.1.0.post1.dev0.dist-info/top_level.txt +1 -0
plans/config.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2025 The Project Authors
|
|
4
|
+
# See pyproject.toml for authors/maintainers.
|
|
5
|
+
# See LICENSE for license details.
|
|
6
|
+
"""
|
|
7
|
+
{Short module description (1-3 sentences)}
|
|
8
|
+
todo docstring
|
|
9
|
+
|
|
10
|
+
Features
|
|
11
|
+
--------
|
|
12
|
+
todo docstring
|
|
13
|
+
|
|
14
|
+
* {feature 1}
|
|
15
|
+
* {feature 2}
|
|
16
|
+
* {feature 3}
|
|
17
|
+
* {etc}
|
|
18
|
+
|
|
19
|
+
Overview
|
|
20
|
+
--------
|
|
21
|
+
todo docstring
|
|
22
|
+
{Overview description}
|
|
23
|
+
|
|
24
|
+
Examples
|
|
25
|
+
--------
|
|
26
|
+
todo docstring
|
|
27
|
+
{Examples in rST}
|
|
28
|
+
|
|
29
|
+
Print a message
|
|
30
|
+
|
|
31
|
+
.. code-block:: python
|
|
32
|
+
|
|
33
|
+
# print message
|
|
34
|
+
print("Hello world!")
|
|
35
|
+
# [Output] >> 'Hello world!'
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
"""
|
|
39
|
+
# IMPORTS
|
|
40
|
+
# ***********************************************************************
|
|
41
|
+
# import modules from other libs
|
|
42
|
+
|
|
43
|
+
# Native imports
|
|
44
|
+
# =======================================================================
|
|
45
|
+
from pathlib import Path
|
|
46
|
+
|
|
47
|
+
# ... {develop}
|
|
48
|
+
|
|
49
|
+
# External imports
|
|
50
|
+
# =======================================================================
|
|
51
|
+
import pandas as pd
|
|
52
|
+
|
|
53
|
+
# ... {develop}
|
|
54
|
+
|
|
55
|
+
# Project-level imports
|
|
56
|
+
# =======================================================================
|
|
57
|
+
# import {module}
|
|
58
|
+
# ... {develop}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# CONSTANTS
|
|
62
|
+
# ***********************************************************************
|
|
63
|
+
# define constants in uppercase
|
|
64
|
+
|
|
65
|
+
DATA_DIR = Path(__file__).parent / "data"
|
|
66
|
+
FILE_FIELDS = DATA_DIR / "fields.csv"
|
|
67
|
+
FILE_FILES = DATA_DIR / "files.csv"
|
|
68
|
+
# ... {develop}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# FUNCTIONS
|
|
72
|
+
# ***********************************************************************
|
|
73
|
+
def parse_files():
|
|
74
|
+
df = pd.read_csv(FILE_FILES, sep=";")
|
|
75
|
+
df["ext"] = df["structure"].apply(lambda x: ".tif" if "raster" in x else ".csv")
|
|
76
|
+
df["file_name"] = df["name"] + df["ext"]
|
|
77
|
+
return df
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def parse_fields():
|
|
81
|
+
return pd.read_csv(FILE_FIELDS, sep=";")
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# CLASSES
|
|
85
|
+
# ***********************************************************************
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# ... {develop}
|
|
89
|
+
|
|
90
|
+
# CLASSES -- Module-level
|
|
91
|
+
# =======================================================================
|
|
92
|
+
# ... {develop}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# SCRIPT
|
|
96
|
+
# ***********************************************************************
|
|
97
|
+
# standalone behaviour as a script
|
|
98
|
+
if __name__ == "__main__":
|
|
99
|
+
|
|
100
|
+
# Script section
|
|
101
|
+
# ===================================================================
|
|
102
|
+
print("Hello world!")
|
|
103
|
+
# ... {develop}
|
plans/data/.gitkeep
ADDED
plans/data/fields.csv
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name;description;units;dtype;category;tex;system;subsystem;project_info;parameters_info;climate_series;qobs_series;lulc_attributes;soils_attributes;dist_area_hist;simulation_series;lulc_series;climate_series_lulc_{scenario}
|
|
2
|
+
field;Field or attribute name;unitless;str;;;;;x;x;;;;;;;;
|
|
3
|
+
value;Set value of field;unitless;misc;;;;;x;x;;;;;;;;
|
|
4
|
+
id;Identification number;unitless;uint16;;;;;;;;;x;x;;;;
|
|
5
|
+
name;Name;unitless;str;;;;;h;;;;x;x;;;x;
|
|
6
|
+
alias;Alias;unitless;str;;;;;h;;;;x;x;;;;
|
|
7
|
+
color;Color;unitless;str;;;;;;;;;x;x;;;;
|
|
8
|
+
source;Source for reference;unitless;str;;;;;h;;;;;;;;;
|
|
9
|
+
description;Brief description;unitless;str;;;;;h;;;;;;;;;
|
|
10
|
+
folder_base;(optional) System path to base / parent folder of project;unitless;str;;;;;h;;;;;;;;;
|
|
11
|
+
datetime;Date-time label;unitless;str;variable;t;time;;;;x;x;;;;x;x;x
|
|
12
|
+
ppt;Precipitation;mm/{dt};float32;variable;P;flow;input;;;x;;;;;x;;x
|
|
13
|
+
pet;Potential Evapotranspiration;mm/{dt};float32;variable;E_{\text{pot}};flow;output;;;x;;;;;x;;x
|
|
14
|
+
dt;Simulation time step;min;float32;parameter;\Delta t;time;;;h;;;;;;;;
|
|
15
|
+
c0;Canopy storage initial conditions;mm;float32;initial condition;C_{0};storage;canopy;;h;;;;;;;;
|
|
16
|
+
s0;Surface storage initial conditions;mm;float32;initial condition;S_{0};storage;surface;;h;;;;;;;;
|
|
17
|
+
v0;Vadose zone initial conditions;mm;float32;initial condition;V_{0};storage;vadose zone;;h;;;;;;;;
|
|
18
|
+
g0;Phreatic zone initial conditions;mm;float32;initial condition;G_{0};storage;phreatic zone;;h;;;;;;;;
|
|
19
|
+
ck;Canopy residence time;d;float32;parameter;C_{k};storage;canopy;;h;;;w;;;;;
|
|
20
|
+
ca;Activation level for canopy flow;mm;float32;parameter;C_{a};storage;canopy;;h;;;w;;;;;
|
|
21
|
+
sk;Surface residence time;d;float32;parameter;S_{k};storage;surface;;h;;;w;;;;;
|
|
22
|
+
soa;Activation level for overland flow;mm;float32;parameter;S_{o, a};storage;surface;;h;;;w;;;;;
|
|
23
|
+
soc;Fragmentation level for overland flow;mm;float32;parameter;S_{o, c};storage;surface;;h;;;w;;;;;
|
|
24
|
+
sua;Activation level for subsurface flow;mm;float32;parameter;S_{u, a};storage;surface;;h;;;w;;;;;
|
|
25
|
+
suc;Fragmentation level for subsurface flow;mm;float32;parameter;S_{u, c};storage;surface;;h;;;w;;;;;
|
|
26
|
+
sux;Subsurface storage capacity;mm;float32;parameter;\hat{S_{u}};storage;surface;;h;;;w;;;;;
|
|
27
|
+
kv;Soil hydraulic conductivity;mm/d;float32;parameter;K_{V};flow;vadose zone;;h;;;;w;;;;
|
|
28
|
+
gk;Phreatic zone residence time;d;float32;parameter;G_{k};storage;phreatic zone;;h;;;;w;;;;
|
|
29
|
+
gx;Phreatic zone storage capacity;mm;float32;parameter;\hat{G};storage;phreatic zone;;h;;;;w;;;;
|
|
30
|
+
dea;Deficit activation level for ET (root zone);mm;float32;parameter;D_{e, a};flow;phreatic zone;;h;;;w;;;;;
|
|
31
|
+
gex;ET capacity of capilar zone;mm;float32;parameter;\hat{G_{e}};storage;vadose zone;;h;;;;w;;;;
|
|
32
|
+
kq;Channel water celerity;m/d;float32;parameter;K_{Q};flow;channels;;h;;;;;;;;
|
|
33
|
+
qobs;Streamflow observed at basin outlet;mm/{dt};float32;variable;Q_{\text{obs}};flow;channels;;;;x;;;;x;;
|
|
34
|
+
distance;Distance to basin outlet;m;float32;boundary condition;X;flow;channels;;;;;;;x;;;
|
|
35
|
+
f_area;Area fraction of basin;unitless;float32;boundary condition;A;flow;channels;;;;;;;x;;;
|
|
36
|
+
lower;Lower bound value of field;misc;float32;;;;;;x;;;;;;;;
|
|
37
|
+
upper;Upper bound value of field;misc;float32;;;;;;x;;;;;;;;
|
|
38
|
+
hw;Weight for HAND in TSI superposition;unitless;float32;parameter;H_{w};storage;phreatic zone;;h;;;;;;;;
|
|
39
|
+
hx;HAND upper threshold in TSI superposition;m;float32;parameter;\hat{H};storage;phreatic zone;;h;;;;;;;;
|
|
40
|
+
et;Evapotranspiration flow (ET);mm/{dt};float32;variable;E;flow;output;;;;;;;;x;;
|
|
41
|
+
ec;Canopy evaporation flow;mm/{dt};float32;variable;E_{c};flow;output;;;;;;;;x;;
|
|
42
|
+
es;Surface evaporation flow;mm/{dt};float32;variable;E_{s};flow;output;;;;;;;;x;;
|
|
43
|
+
eg;Phreatic zone transpiration flow;mm/{dt};float32;variable;E_{g};flow;output;;;;;;;;x;;
|
|
44
|
+
c;Canopy storage level;mm;float32;variable;C;storage;canopy;;;;;;;;x;;
|
|
45
|
+
s;Surface storage level;mm;float32;variable;S;storage;surface;;;;;;;;x;;
|
|
46
|
+
v;Vadose zone storage level;mm;float32;variable;V;storage;vadose zone;;;;;;;;x;;
|
|
47
|
+
g;Phreatic zone level;mm;float32;variable;G;storage;phreatic zone;;;;;;;;x;;
|
|
48
|
+
psf;Canopy stem flow;mm/{dt};float32;variable;P_{sf};flow;canopy;;;;;;;;x;;
|
|
49
|
+
ptf;Canopy spill flow (throughfall);mm/{dt};float32;variable;P_{tf};flow;canopy;;;;;;;;x;;
|
|
50
|
+
ps;Surface effective precipitation (psf + ptf);mm/{dt};float32;variable;P_{s};flow;surface;;;;;;;;x;;
|
|
51
|
+
qo;Overland flow (runoff);mm/{dt};float32;variable;Q_{o};flow;surface;;;;;;;;x;;
|
|
52
|
+
qu;Underland flow (subsurface flow);mm/{dt};float32;variable;Q_{u};flow;surface;;;;;;;;x;;
|
|
53
|
+
qh;Hillslope flow (qo + qu);mm/{dt};float32;variable;Q_{h};flow;surface;;;;;;;;x;;
|
|
54
|
+
qc;Channel flow at basin outlet (routed qh);mm/{dt};float32;variable;Q_{c};flow;channels;;;;;;;;x;;
|
|
55
|
+
qb;Groundwater base flow;mm/{dt};float32;variable;Q_{b};flow;phreatic zone;;;;;;;;x;;
|
|
56
|
+
qn;Infiltration flow (drainage to mineral soil);mm/{dt};float32;variable;Q_{n};flow;surface;;;;;;;;x;;
|
|
57
|
+
qv;Recharge flow (percolation to phreatic zone);mm/{dt};float32;variable;Q_{v};flow;vadose zone;;;;;;;;x;;
|
|
58
|
+
d;Soil saturation deficit (gx - g);mm;float32;variable;D;storage;phreatic zone;;;;;;;;x;;
|
|
59
|
+
dv;Vadose zone saturation deficit (d - v);mm;float32;variable;D_{v};storage;vadose zone;;;;;;;;x;;
|
|
60
|
+
q;Streamflow or discharge at basin outlet;mm/{dt};float32;variable;Q;flow;output;;;;;;;;x;;
|
|
61
|
+
id_lulc_raster;Identification number for land use map;unitless;uint16;;;;;;;;;;;;;x;x
|
plans/data/files.csv
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
workflow;structure;title;name;folder;dtype;units
|
|
2
|
+
input - optional;raster;Digital Elevation Model;dem;{project}/data/topo;float32;m
|
|
3
|
+
input - required;raster;Height Above Nearest Drainage;hand;{project}/data/topo;float32;m
|
|
4
|
+
input - required;raster;Topographic Wetness Index;twi;{project}/data/topo;float32;index
|
|
5
|
+
intermediate;raster;Topographic Saturation Index;tsi;{project}/data/topo;uint8;index
|
|
6
|
+
input - required;quali raster;Local Drain Direction;ldd;{project}/data/topo;uint8;id
|
|
7
|
+
input - required;quali raster;Soils Map;soils;{project}/data/soils;uint8;id
|
|
8
|
+
input - optional;raster;Slope;slope;{project}/data/topo;float32;degrees
|
|
9
|
+
input - optional;raster;Hill Shade;hillshade;{project}/data/topo;uint8;unitless
|
|
10
|
+
input - optional;raster;Flow Accumulation;flowacc;{project}/data/topo;float32;m^2
|
|
11
|
+
input - required;attribute table;Soils Attributes;soils_attributes;{project}/data/soils;;
|
|
12
|
+
input - required;attribute table;Land Use Attributes;lulc_attributes;{project}/data/lulc/{scenario};;
|
|
13
|
+
input - required;time series;Climate Series;climate_series;{project}/data/climate/{scenario};;
|
|
14
|
+
intermediate;raster;Distance To Outlet;dto;{project}/data/topo;float32;m
|
|
15
|
+
input - optional;time series;Streamflow Series;qobs_series;{project}/data/basins/{basin};;
|
|
16
|
+
input - required;raster;Basin Area;basin;{project}/data/basins/{basin};uint8;unitless
|
|
17
|
+
intermediate;table;Distance vs Area Histogram;dist_area_hist;{project}/data/basins/{basin};;
|
|
18
|
+
input - optional;raster;Upslope Area;uparea;{project}/data/topo;float32;m^2
|
|
19
|
+
input - required;info table;Parameters Info;parameters_info;{project}/data;;
|
|
20
|
+
input - required;info table;Project Info;project_info;{project}/data;;
|
|
21
|
+
input - required;time quali raster;Land Use Map;lulc_{date};{project}/data/lulc/{scenario};uint8;id
|
|
22
|
+
output;time series;Simulation Series;simulation_series;{project}/outputs/{id};;
|
|
23
|
+
intermediate;time raster;Land Use Parameter Map;lulc_{date}_{parameter};{project}/data/lulc/{scenario}/parameters;float32;misc
|
|
24
|
+
intermediate;raster;Soils Parameter Map;soils_{parameter};{project}/data/soils/parameters;float32;misc
|
|
25
|
+
intermediate;time series;Climate and Land Use Series;climate_series_lulc_{scenario};{project}/data/climate/{scenario};;
|
|
26
|
+
intermediate;time series;Land Use Series;lulc_series;{project}/data/lulc/{scenario};;
|
plans/data/tools.csv
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2025 The Project Authors
|
|
4
|
+
# See pyproject.toml for authors/maintainers.
|
|
5
|
+
# See LICENSE for license details.
|
|
6
|
+
"""
|
|
7
|
+
{Short package description (1-3 sentences)}
|
|
8
|
+
todo docstring
|
|
9
|
+
|
|
10
|
+
Features
|
|
11
|
+
--------
|
|
12
|
+
todo docstring
|
|
13
|
+
|
|
14
|
+
* ``core`` module provides Lorem ipsum dolor sit amet.
|
|
15
|
+
* ``chrono`` module provides Lorem ipsum dolor sit amet.
|
|
16
|
+
* ``spatial`` module provides Lorem ipsum dolor sit amet.
|
|
17
|
+
|
|
18
|
+
Overview
|
|
19
|
+
--------
|
|
20
|
+
todo docstring
|
|
21
|
+
{Overview description}
|
|
22
|
+
|
|
23
|
+
Examples
|
|
24
|
+
--------
|
|
25
|
+
todo docstring
|
|
26
|
+
{Examples in rST}
|
|
27
|
+
|
|
28
|
+
Print a message
|
|
29
|
+
|
|
30
|
+
.. code-block:: python
|
|
31
|
+
|
|
32
|
+
# print message
|
|
33
|
+
print("Hello world!")
|
|
34
|
+
# [Output] >> 'Hello world!'
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
# EXPOSE MODULES FROM PACKAGE
|
|
38
|
+
# ***********************************************************************
|
|
39
|
+
# todo [docstring]
|
|
40
|
+
from .core import *
|
|
41
|
+
from .spatial import *
|
|
42
|
+
from .chrono import *
|