Repository navigation
Modelly 1.4.1
A patch release: three operations that grew quadratically with the size of a run now grow
linearly, one recorder returns the same rows as the others, and the documentation has a
navigation that fits the screen. Results are unchanged; no core operation is slower than 1.4.0
(python -m modelly.dev perf, the 17 operations paired against the 1.4.0 build).
Performance
ParquetDataRecorderrewrote its whole file every 1000 rows, so a run's writes were
quadratic in its rows. The buffer now grows with the file, holds one DataFrame per snapshot
instead of one dict per row, andsummary()reads the row count from the file footer. 2000
agents recorded for 200 steps take 1.0 s instead of 7.9 s, and twice the steps take twice
the time (single runs on this machine; the frames are identical to 1.4.0's, dtypes included,
overwrites and small buffers too).- Adding or removing a cell of a discrete space visited every cell to reset the empty-cell
index, even when it had never been built; it now does only when the index exists, which
detaches the same cells, so random draws are unchanged.Network.remove_cellno longer
scans its KD-tree list per cell. Removing half of a 32,000-node network takes 0.14 s instead
of 7.9 s. run_batchandrun_gridhand each worker a sixteenth of its share at a time instead of one
task: 20,000 short tasks on eight workers spent 0.49 s in hand-offs, now 0.01 s. Small
batches still go one task at a time; results and their order are unchanged.
Fixed
JSONDataRecorderreturned a numpy dataset as one row per snapshot holding the nested list
of values. It now gives one row per agent withagent_id, the fields andtime, as the
memory, Parquet and SQL recorders do, andsave_to_jsonwrites those records; a snapshot of
no agents adds no row.Networkdrops a cell replaced byadd_cellat the same coordinate from its KD-tree, so
find_nearest_cellcannot return it.
Documentation
- Six header sections (Get started, Examples, Guides, Performance, API, Releases) instead of
six links and a More menu of 29 that ran past the bottom of the window; every page shows its
section's navigation in the sidebar. No page moved.