Read warehouses in Warehouses.load_dict (symmetric with serialization)#436
Merged
rp- merged 1 commit intoJun 13, 2026
Merged
Conversation
load_dict read only data["airports"], silently dropping data["warehouses"], so unit/FARP/ship warehouse state was lost on every save->load round-trip while the serializer still wrote it. Read the warehouses sub-dict symmetrically. Closes pydcs#428.
si0phia
approved these changes
Jun 12, 2026
si0phia
left a comment
There was a problem hiding this comment.
I see no conflicts from these line changes
rp-
pushed a commit
that referenced
this pull request
Jun 15, 2026
update_warehouses() runs on every Mission.save(). It unconditionally overwrote the warehouse entry for every ship-with-parking and every FARP with a fresh default, discarding any customized warehouse configuration (coalition, size, inventory, suppliers, operating levels, ...) on every save. Guard each write so existing entries are preserved and only missing ones get a default -- gap-fill, matching the docstring's stated intent. #436 fixed the symmetric read side (load_dict dropped the serialized "warehouses" sub-dict); this fixes the write side. Closes #427.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warehouses.load_dict reads only data["airports"] and silently drops
data["warehouses"], so unit/FARP/ship warehouse state is lost on every
save->load round-trip even though the serializer writes it. This is the read-side
mirror of the write-side gap in #427 -- together, unit warehouse state survives
neither save nor reload.
Read the warehouses sub-dict symmetrically with the airports loop.
Adds a round-trip test that loads a payload with a warehouse entry and asserts it
survives.
Closes #428.