You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Storage keys need a structured (branch, period) scheme: str(period) is lossy and separators collide with branch names #526
#523 / #525 fix the crash where get_known_periods/get_known_branch_periods split storage keys on every colon, but the underlying key scheme has deeper, pre-existing structural problems (surfaced in cross-family review of #525):
str(period) is lossy for day-anchored periods. Keys embed f"{branch_name}:{period}", and Period.__str__ drops the day for e.g. month:2027-11-15:2 / year:2027-11-15:2, so distinct valid periods can collide in the cache and the readers reconstruct date-shifted periods.
Branch names have no enforced grammar.Simulation.get_branch accepts arbitrary names; a branch name containing : breaks split(":", 1) parsing in the readers and in delete.
OnDiskStorage has the same defect class with _ as the separator ({branch}_{period} + unconstrained split("_")): a branch name like my_reform mis-parses, and complex-period colons produce awkward filenames.
The clean fix is structured keys — (branch_name, Period) tuples in memory and an escaped/encoded filename scheme on disk — rather than string round-trips. That is a storage-format refactor deserving its own design + review, hence this issue rather than a rider on #525.
On Windows this is a hard failure, not only an awkward file name. OnDiskStorage.put saves to {branch}_{period}.npy, and Windows does not allow : in a file name. So any period whose string form has a colon (year:2012:2, month:2012-01:3, day:2012-01-01:3, or a year that starts mid-year such as year:2012-03) cannot be stored on disk there:
That is from #582's Windows jobs (run 37336787831), whose tie tests store year:2012:2 and year:2014:3 on disk. The REPLACEMENTS_DIR path has the same problem: tempfile.mkstemp(prefix=f"{filename}.") also puts the period string in the file name.
#582 now keeps multi-unit periods in memory on Windows in those tests (can_store_on_disk in tests/fixtures/uprating_order.py), and points here. The encoded on-disk file-name scheme proposed above would fix it. Its round-trip test should run on the Windows CI jobs.
Activity
Reject lossy storage keys loudly at put time
Reject lossy storage keys loudly at put time
Fix storage key parsing for anchored year periods (#525)
Keep multi-unit periods off disk on Windows in the tie tests
MaxGhenis commentedon Oct 5, 2026
On Windows this is a hard failure, not only an awkward file name.
OnDiskStorage.putsaves to{branch}_{period}.npy, and Windows does not allow:in a file name. So any period whose string form has a colon (year:2012:2,month:2012-01:3,day:2012-01-01:3, or a year that starts mid-year such asyear:2012-03) cannot be stored on disk there:That is from #582's Windows jobs (run 37336787831), whose tie tests store
year:2012:2andyear:2014:3on disk. TheREPLACEMENTS_DIRpath has the same problem:tempfile.mkstemp(prefix=f"{filename}.")also puts the period string in the file name.#582 now keeps multi-unit periods in memory on Windows in those tests (
can_store_on_diskintests/fixtures/uprating_order.py), and points here. The encoded on-disk file-name scheme proposed above would fix it. Its round-trip test should run on the Windows CI jobs.Probe disk storage for the Windows guard; test an input on disk winni…
Keep multi-unit periods off disk on Windows in the tie tests
Probe disk storage for the Windows guard; test an input on disk winni…
Keep multi-unit periods off disk on Windows in the tie tests
Probe disk storage for the Windows guard; test an input on disk winni…
Break equal-start uprating ties the way auto-carry-over does (#582)