Releases: DisSModel/dissmodel
v0.4.0 — Load as first-class lifecycle phase + Xarray interoperability
What's new in 0.4.0
Breaking change — ModelExecutor.run signature
run(self, record) → run(self, data, record)
data is the direct return value of load(), injected by the platform.
Executors that called self.load(record) inside run() must remove that call
and receive the loaded data as the first argument instead.
Executor lifecycle orchestration
- New
dissmodel/executor/runner.pywithexecute_lifecycle— the canonical
validate → load → run → saveloop, shared by the CLI and the platform
job_runner. Each phase is timed independently and written to
record.metrics(time_load_secnow visible separately fromtime_run_sec). execute_lifecycleexported fromdissmodel.executor.ExecutorTestHarnessupdated to callload → run(data, record)in sequence
and to reject the old one-parameterrunsignature with a clear error message.
RasterBackend — Xarray interoperability
RasterBackend.to_xarray(time=None)— converts toxr.Datasetwith(y, x)
dimensions, spatial coordinates from rasterio Affine transform, and CRS as
spatial_ref(CF-1.8 / rioxarray convention).RasterBackend.from_xarray(ds)— builds a backend from anxr.Datasetor
xr.DataArray, recovering transform and CRS when available.RasterBackend.__init__now acceptstransformandcrskeyword arguments.
Tests
Full executor test suite added under tests/executor/:
test_runner, test_registry, test_cli, test_testing — with
_isolate_registry autouse fixture preventing cross-test registry pollution.
Removed
make_raster_grid()alias (deprecated since 0.3.0)regular_grid()alias (deprecated since 0.2.1)
Migration guide for executor authors:
# Before (0.3.x)
def run(self, record: ExperimentRecord):
data = self.load(record)
...
# After (0.4.0)
def run(self, data, record: ExperimentRecord):
# data injected by execute_lifecycle — no I/O here
...Full changelog: CHANGELOG.md
v0.3.0
What's Changed
Added
Sync models — automatic .past snapshot semantics (equivalent to TerraME's cs:synchronize()):
SyncSpatialModel— vector substrate, manages<col>_pastcolumns automaticallySyncRasterModel— raster substrate, manages<n>_pastarrays automatically- Both expose a public
synchronize()method
I/O — dissmodel.geo.raster.io
shapefile_to_raster_backend— load any vector file (Shapefile, GeoJSON, GPKG, ZIP) directly into aRasterBackend, with automatic"mask"bandsave_raster_backend— write arrays to GeoTIFF without aband_specload_geotiff/save_geotiffupdated with.zipsupport
RasterMap — new visualization options: scheme (equal_interval, quantiles), legend, auto_mask, save_frames
Map — headless fallback (saves PNGs), new figsize, interval, save_frames parameters
Fixed
RasterMap: multiple instances now maintain independent windows —plt.close("all")no longer closes other figuresMap:AttributeError: 'Map' object has no attribute 'fig'with StreamlitMap: no longer raisesRuntimeErrorwhen no display is availablemake_raster_grid()deprecated →raster_grid()(alias kept until v0.4.0)
Full changelog: CHANGELOG.md
v0.2.1
What's Changed
API improvements
parse_idxnow returnsGridPos(row, col)— a namedtuple that eliminates the
(col, row)vs(row, col)ambiguity. Tuple unpacking remains fully compatible,
so existing code continues to work without changes.regular_grid()renamed tovector_grid()for symmetry with the raster substrate.
The old name is kept as aDeprecationWarningalias and will be removed in v0.3.0.GridPosis now exported fromdissmodel.geo.vector.regular_grid.
Bug fixes
- Fixed
TypeError: parameter 'kwargs' not allowedinRasterModel.setup()and
RasterCellularAutomaton.setup()caused by a salabim incompatibility with**kwargs.
Documentation
- API reference split into
api/geo/vector.mdandapi/geo/raster.md. getting_started.mdexpanded with execution modes and substrate comparison table.visualization.mdupdated to coverRasterMap.core.mdexpanded with OOP modeling section and per-model time control example.CHANGELOG.mdupdated.
Upgrade notes
# before
from dissmodel.geo import regular_grid
gdf = regular_grid(dimension=(30, 30), resolution=1)
# after
from dissmodel.geo.vector.regular_grid import vector_grid
gdf = vector_grid(dimension=(30, 30), resolution=1)
# parse_idx
from dissmodel.geo.vector.regular_grid import parse_idx
pos = parse_idx("3-4")
pos.row # 3
pos.col # 4Full changelog: [CHANGELOG.md](https://github.com/lambdageo/dissmodel/blob/main/CHANGELOG.md)
Add Raster/NumPy Backend for Cellular Automata Models
This release introduces a RasterBackend that allows cellular automata models in DisSModel to run using NumPy arrays instead of iterating over GeoDataFrame rows.
The existing vector backend (GeoPandas + libpysal) remains unchanged. The raster backend is an optional execution engine behind the same API.
0.1.5
- Description:
## What's new in v0.1.5
- Consolidated all dependencies in `pyproject.toml`
- NumPy docstrings and type annotations across all modules
- All CA and SysDyn models refactored to English
- Fixed PATTERN fill ID convention (`row-col`)
- Performance: `neighbor_values()` in all CA rules
- Fixed `Environment` salabim animation crash in headless environments
- Added CLI, Streamlit and Jupyter notebook examples for all models
- MkDocs documentation with mkdocstrings
- CI workflow with pytest and mypy
0.1.4
Merge pull request #10 from profsergiocosta/doc Doc
0.1.3b_fix
Update pyproject.toml