inventory_loader
Load a DASDAE inventory from an authoring directory.
The authoring format splits an inventory along its natural grain: small heterogeneous objects (acquisitions, interrogators, cables) live in YAML or JSON files matching the models, while long row-shaped track data lives in CSV files a field crew can maintain as a spreadsheet. A directory of these files is itself a loadable inventory, and to_yaml exports the single-file interchange artifact for shipping beside a data archive.
A table is matched to the model by name: <name>.csv fills the attribute <name> of the type its directory declares. path is the one reserved container stem – those directories address an optical path epoch rather than serializing an attribute, and each location code is a lineage in which an epoch runs until its successor begins.
The contract, in one line: file declares object_type, container agrees, name implies identity, envelope implies version. Every object file states what it is, its container checks that statement rather than supplying it, its name decides which entity it is, and the top-level inventory.yaml versions the whole document. An address restated inside a file must agree with the name; there is never a precedence rule between two spellings of one fact.
Loading is strict about near-misses and indifferent to clean misses: anything which claims to participate in a convention and gets it wrong raises, while anything which does not participate – photos, field notes, deployment logs – is ignored where it lies.
Functions
| Name | Description |
|---|---|
| carries_inventory | Return whether a directory holds anything under the blessed name. |
| find_inventory | Return the path of the inventory a directory carries, or None. |
| inventory | Load or create a DASDAE inventory. |
| load_directory | Load an inventory from a directory in the authoring format. |