dissmodel 0.6.2__tar.gz → 0.6.4__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.
- {dissmodel-0.6.2/dissmodel.egg-info → dissmodel-0.6.4}/PKG-INFO +4 -5
- {dissmodel-0.6.2 → dissmodel-0.6.4}/README.md +3 -4
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/cli.py +45 -11
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/backend.py +2 -2
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/raster.py +1 -1
- {dissmodel-0.6.2 → dissmodel-0.6.4/dissmodel.egg-info}/PKG-INFO +4 -5
- {dissmodel-0.6.2 → dissmodel-0.6.4}/pyproject.toml +2 -2
- {dissmodel-0.6.2 → dissmodel-0.6.4}/LICENSE +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/MANIFEST.in +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/core/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/core/environment.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/core/model.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/config.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/model_executor.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/registry.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/runner.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/schemas.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/testing.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/executor/utils.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/band_spec.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/cellular_automaton.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/raster_grid.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/raster_model.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/raster/sync_model.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/cellular_automaton.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/fill.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/neighborhood.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/spatial_model.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/sync_model.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/geo/vector/vector_grid.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/_dispatch.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/_storage.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/_utils.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/_xarray.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/convert.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/io/vector.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/visualization/__init__.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/visualization/_utils.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/visualization/chart.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/visualization/map.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/visualization/raster_map.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel/visualization/widgets.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel.egg-info/SOURCES.txt +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel.egg-info/dependency_links.txt +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel.egg-info/requires.txt +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/dissmodel.egg-info/top_level.txt +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/setup.cfg +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/setup.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/tests/test_public_api.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/tests/test_scheduler.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/tests/test_viz_fallback.py +0 -0
- {dissmodel-0.6.2 → dissmodel-0.6.4}/tests/test_widgets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dissmodel
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Discrete Spatial Modeling framework for raster and vector simulations
|
|
5
5
|
Author: Sérgio Costa, Nerval Santos Junior
|
|
6
6
|
Maintainer: Sérgio Costa
|
|
@@ -66,8 +66,8 @@ Dynamic: license-file
|
|
|
66
66
|
[](https://opensource.org/licenses/MIT)
|
|
67
67
|
[](https://www.python.org/)
|
|
68
68
|
[](https://pypi.org/project/dissmodel/)
|
|
69
|
-
[](https://github.com/DisSModel/dissmodel/actions)
|
|
70
|
+
[](https://github.com/DisSModel)
|
|
71
71
|
[](https://joss.theoj.org/papers/46522bc30d2dbec6b509d2dc487170ec)
|
|
72
72
|
|
|
73
73
|
> *"Science should not need to be rewritten to go into production."*
|
|
@@ -283,8 +283,7 @@ DisSModel is a core framework. To maintain a clean and specialized environment,
|
|
|
283
283
|
| [`dissmodel-ca`](https://github.com/DisSModel/dissmodel-ca) | Classic Cellular Automata (Game of Life, Forest Fire, Growth) | `pip install "git+https://github.com/DisSModel/dissmodel-ca.git"` |
|
|
284
284
|
| [`dissmodel-sysdyn`](https://github.com/DisSModel/dissmodel-sysdyn) | System Dynamics (SIR, Predator-Prey, Lorenz) | `pip install "git+https://github.com/DisSModel/dissmodel-sysdyn.git"` |
|
|
285
285
|
| [`brmangue-dissmodel`](https://github.com/DisSModel/brmangue-dissmodel) | BR-MANGUE coastal flooding and mangrove succession model (raster + vector, validated against TerraME) | `pip install "git+https://github.com/DisSModel/brmangue-dissmodel.git"` |
|
|
286
|
-
| [`disslucc
|
|
287
|
-
| [`disslucc-discrete`](https://github.com/DisSModel/disslucc-discrete) | Land Use and Cover Change models, discrete allocation (CLUE-inspired) | `pip install "git+https://github.com/DisSModel/disslucc-discrete.git"` |
|
|
286
|
+
| [`disslucc`](https://github.com/LambdaGeo/disslucc) | Land Use and Cover Change models, continuous and discrete allocation (CLUE-inspired), raster-only | `pip install "git+https://github.com/LambdaGeo/disslucc.git"` |
|
|
288
287
|
|
|
289
288
|
### 🛠 Implementation Templates
|
|
290
289
|
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.python.org/)
|
|
6
6
|
[](https://pypi.org/project/dissmodel/)
|
|
7
|
-
[](https://github.com/DisSModel/dissmodel/actions)
|
|
8
|
+
[](https://github.com/DisSModel)
|
|
9
9
|
[](https://joss.theoj.org/papers/46522bc30d2dbec6b509d2dc487170ec)
|
|
10
10
|
|
|
11
11
|
> *"Science should not need to be rewritten to go into production."*
|
|
@@ -221,8 +221,7 @@ DisSModel is a core framework. To maintain a clean and specialized environment,
|
|
|
221
221
|
| [`dissmodel-ca`](https://github.com/DisSModel/dissmodel-ca) | Classic Cellular Automata (Game of Life, Forest Fire, Growth) | `pip install "git+https://github.com/DisSModel/dissmodel-ca.git"` |
|
|
222
222
|
| [`dissmodel-sysdyn`](https://github.com/DisSModel/dissmodel-sysdyn) | System Dynamics (SIR, Predator-Prey, Lorenz) | `pip install "git+https://github.com/DisSModel/dissmodel-sysdyn.git"` |
|
|
223
223
|
| [`brmangue-dissmodel`](https://github.com/DisSModel/brmangue-dissmodel) | BR-MANGUE coastal flooding and mangrove succession model (raster + vector, validated against TerraME) | `pip install "git+https://github.com/DisSModel/brmangue-dissmodel.git"` |
|
|
224
|
-
| [`disslucc
|
|
225
|
-
| [`disslucc-discrete`](https://github.com/DisSModel/disslucc-discrete) | Land Use and Cover Change models, discrete allocation (CLUE-inspired) | `pip install "git+https://github.com/DisSModel/disslucc-discrete.git"` |
|
|
224
|
+
| [`disslucc`](https://github.com/LambdaGeo/disslucc) | Land Use and Cover Change models, continuous and discrete allocation (CLUE-inspired), raster-only | `pip install "git+https://github.com/LambdaGeo/disslucc.git"` |
|
|
226
225
|
|
|
227
226
|
### 🛠 Implementation Templates
|
|
228
227
|
|
|
@@ -12,6 +12,16 @@ else:
|
|
|
12
12
|
|
|
13
13
|
# ── Parameter helpers ─────────────────────────────────────────────────────────
|
|
14
14
|
|
|
15
|
+
# [model] keys that are registration metadata for dissmodel-configs, not
|
|
16
|
+
# simulation input -- never merged into record.parameters. Matches the
|
|
17
|
+
# convention documented in docs/api/executor/cli.md ("class", "package")
|
|
18
|
+
# and used by dissmodel-configs entries in the wild (executor_module, name,
|
|
19
|
+
# description, the dissmodel version constraint).
|
|
20
|
+
_SPEC_METADATA_KEYS = frozenset({
|
|
21
|
+
"executor_module", "name", "class", "description", "package", "dissmodel",
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
|
|
15
25
|
def _parse_params(param_list: list[str] | None) -> dict:
|
|
16
26
|
"""Parse KEY=VALUE strings into a typed dict."""
|
|
17
27
|
params: dict[str, int | float | bool | str] = {}
|
|
@@ -32,11 +42,41 @@ def _parse_params(param_list: list[str] | None) -> dict:
|
|
|
32
42
|
|
|
33
43
|
|
|
34
44
|
def _load_toml(path: str) -> tuple[dict, dict]:
|
|
35
|
-
"""
|
|
45
|
+
"""
|
|
46
|
+
Load parameters and full spec from a TOML file.
|
|
47
|
+
|
|
48
|
+
`params` merges two layers of the [model] table, in increasing
|
|
49
|
+
precedence: (1) every key that isn't registration metadata
|
|
50
|
+
(_SPEC_METADATA_KEYS) or [model.parameters] itself -- e.g.
|
|
51
|
+
land_use_types, [[model.potential]], [model.static] -- the same
|
|
52
|
+
values the platform stores in ExperimentRecord.resolved_spec and
|
|
53
|
+
merges into ExperimentRecord.parameters before calling run() (see
|
|
54
|
+
ModelExecutor.run()'s docstring: "Receives record with
|
|
55
|
+
resolved_spec and parameters already merged"); then (2)
|
|
56
|
+
[model.parameters] itself, which wins on overlap. Before this,
|
|
57
|
+
local --toml runs skipped layer (1) entirely, so a model.toml
|
|
58
|
+
following the dissmodel-configs registration convention (spec
|
|
59
|
+
fields at the [model] level, only truly run-specific values under
|
|
60
|
+
[model.parameters] -- see any models/*.toml in dissmodel-configs)
|
|
61
|
+
silently produced an incomplete record.parameters and any executor
|
|
62
|
+
reading those keys from record.parameters would fail validate()
|
|
63
|
+
even though the values were right there in the file. --param CLI
|
|
64
|
+
overrides are applied by the caller on top of this, unchanged.
|
|
65
|
+
"""
|
|
36
66
|
with open(path, "rb") as f:
|
|
37
67
|
config = tomllib.load(f)
|
|
38
|
-
model
|
|
39
|
-
|
|
68
|
+
model = config.get("model", {})
|
|
69
|
+
|
|
70
|
+
# land_use_types may be declared as a dict-table
|
|
71
|
+
# ([model.land_use_types] types = [...]) instead of a plain list --
|
|
72
|
+
# normalize before merging into params, same as _build_record did
|
|
73
|
+
# for `spec` alone before this function grew that merge.
|
|
74
|
+
land_use_types = model.get("land_use_types")
|
|
75
|
+
if isinstance(land_use_types, dict):
|
|
76
|
+
model["land_use_types"] = land_use_types.get("types", [])
|
|
77
|
+
|
|
78
|
+
spec_extra = {k: v for k, v in model.items() if k not in _SPEC_METADATA_KEYS and k != "parameters"}
|
|
79
|
+
params = {**spec_extra, **model.get("parameters", {})}
|
|
40
80
|
return params, model
|
|
41
81
|
|
|
42
82
|
|
|
@@ -64,14 +104,8 @@ def _build_record(args):
|
|
|
64
104
|
from dissmodel.executor.schemas import DataSource, ExperimentRecord
|
|
65
105
|
|
|
66
106
|
toml_path = getattr(args, "toml", None)
|
|
67
|
-
params, spec = _load_local_params(toml_path)
|
|
68
|
-
params = {**params, **_parse_params(args.param)} # CLI overrides TOML
|
|
69
|
-
|
|
70
|
-
# land_use_types lives under spec, not parameters
|
|
71
|
-
if "land_use_types" in spec:
|
|
72
|
-
lu = spec["land_use_types"]
|
|
73
|
-
if isinstance(lu, dict):
|
|
74
|
-
spec["land_use_types"] = lu.get("types", [])
|
|
107
|
+
params, spec = _load_local_params(toml_path) # params already carries the merged [model] spec (see _load_toml)
|
|
108
|
+
params = {**params, **_parse_params(args.param)} # CLI overrides TOML+spec
|
|
75
109
|
|
|
76
110
|
record = ExperimentRecord(
|
|
77
111
|
model_name = "local",
|
|
@@ -607,8 +607,8 @@ class RasterBackend:
|
|
|
607
607
|
-------
|
|
608
608
|
np.ndarray int
|
|
609
609
|
"""
|
|
610
|
-
result = np.zeros(self.shape, dtype=int)
|
|
611
|
-
m = mask.astype(np.int8)
|
|
610
|
+
result: np.ndarray = np.zeros(self.shape, dtype=int)
|
|
611
|
+
m: np.ndarray = mask.astype(np.int8)
|
|
612
612
|
for dr, dc in neighborhood:
|
|
613
613
|
result += self.shift2d(m, dr, dc)
|
|
614
614
|
return result
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dissmodel
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Discrete Spatial Modeling framework for raster and vector simulations
|
|
5
5
|
Author: Sérgio Costa, Nerval Santos Junior
|
|
6
6
|
Maintainer: Sérgio Costa
|
|
@@ -66,8 +66,8 @@ Dynamic: license-file
|
|
|
66
66
|
[](https://opensource.org/licenses/MIT)
|
|
67
67
|
[](https://www.python.org/)
|
|
68
68
|
[](https://pypi.org/project/dissmodel/)
|
|
69
|
-
[](https://github.com/DisSModel/dissmodel/actions)
|
|
70
|
+
[](https://github.com/DisSModel)
|
|
71
71
|
[](https://joss.theoj.org/papers/46522bc30d2dbec6b509d2dc487170ec)
|
|
72
72
|
|
|
73
73
|
> *"Science should not need to be rewritten to go into production."*
|
|
@@ -283,8 +283,7 @@ DisSModel is a core framework. To maintain a clean and specialized environment,
|
|
|
283
283
|
| [`dissmodel-ca`](https://github.com/DisSModel/dissmodel-ca) | Classic Cellular Automata (Game of Life, Forest Fire, Growth) | `pip install "git+https://github.com/DisSModel/dissmodel-ca.git"` |
|
|
284
284
|
| [`dissmodel-sysdyn`](https://github.com/DisSModel/dissmodel-sysdyn) | System Dynamics (SIR, Predator-Prey, Lorenz) | `pip install "git+https://github.com/DisSModel/dissmodel-sysdyn.git"` |
|
|
285
285
|
| [`brmangue-dissmodel`](https://github.com/DisSModel/brmangue-dissmodel) | BR-MANGUE coastal flooding and mangrove succession model (raster + vector, validated against TerraME) | `pip install "git+https://github.com/DisSModel/brmangue-dissmodel.git"` |
|
|
286
|
-
| [`disslucc
|
|
287
|
-
| [`disslucc-discrete`](https://github.com/DisSModel/disslucc-discrete) | Land Use and Cover Change models, discrete allocation (CLUE-inspired) | `pip install "git+https://github.com/DisSModel/disslucc-discrete.git"` |
|
|
286
|
+
| [`disslucc`](https://github.com/LambdaGeo/disslucc) | Land Use and Cover Change models, continuous and discrete allocation (CLUE-inspired), raster-only | `pip install "git+https://github.com/LambdaGeo/disslucc.git"` |
|
|
288
287
|
|
|
289
288
|
### 🛠 Implementation Templates
|
|
290
289
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dissmodel"
|
|
7
|
-
version = "0.6.
|
|
7
|
+
version = "0.6.4"
|
|
8
8
|
description = "Discrete Spatial Modeling framework for raster and vector simulations"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -121,7 +121,7 @@ exclude = ["docs", "site", "build"]
|
|
|
121
121
|
pythonpath = ["."]
|
|
122
122
|
|
|
123
123
|
[tool.mypy]
|
|
124
|
-
python_version = "3.
|
|
124
|
+
python_version = "3.12"
|
|
125
125
|
ignore_missing_imports = true
|
|
126
126
|
exclude = ["tests/", "docs/", "examples/"]
|
|
127
127
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|