mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #1580] veh_spawn_intensities: handle empty tables, count MudMin>0, guard carve overwrites/paths, and write JSON atomically (VEH-SPAWN-INTENSITIES-AGG-AND-IO) #1600
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1600
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1580
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/veh-spawn-intensities-agg-and-io📝 Commits (1)
bbdd853veh_spawn_intensities: handle empty tables, count MudMin>0, guard carve overwrites/paths, and write JSON atomically📊 Changes
2 files changed (+138 additions, -14 deletions)
View changed files
📝
tests/test_veh_spawn_intensities.py(+74 -0)📝
tools/veh_spawn_intensities.py(+64 -14)📄 Description
Item ID:
VEH-SPAWN-INTENSITIES-AGG-AND-IO(new item; coordination issue #14 is at GitHub's 2,500-comment cap with no open successor at PR time — confirmed 0 open PRs touchtools/veh_spawn_intensities.py)Summary
VehSpawnIntensitiestables inaggregate():max(len(sig) for sig in signatures)previously crashed withValueError: max() iterable argument is empty; usingdefault=0returns a valid zero-entry aggregate.MudMin > 0as well asMudMax > 0inbands_with_mud: matches the documented rule (MudMin/MudMaxabove zero) instead of checking onlyMudMax.--jsonbefore scanning:inputis a carve directory, guard<input>/index.jsonand.bin/.bk2streams (including hardlink/case aliases viasame_report_path) so--jsoncan never overwrite carve inputs.--jsonpaths (previously""was silently ignored and" "created a literal" "file) and existing directories before reading or printing stdout.--jsonatomically before printing stdout and catchRecursionError: stage viaNamedTemporaryFile+file_mode.published_mode+replace_retry.replacewithallow_nan=False, cleaning up temp files on failure so existing reports are never truncated and failed runs emit no misleading stdout JSON.Testing
python3 -W error -I tests/test_veh_spawn_intensities.py -v: 12/12 passedpython3 -W error -I tests/test_text_write_line_endings.py -v: 3/3 passedpython3 -I scripts/check_no_game_data.py tools/veh_spawn_intensities.py tests/test_veh_spawn_intensities.py: passedpython3 -m compileall -q make_game.py tools tests: passedmain:tools/veh_spawn_intensities.py: all 3 new tests fail (FAILED (failures=4, errors=2)).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.