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
Copy file name to clipboardExpand all lines: docs/dev/sdd.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,19 +143,21 @@ Loaders and writers can be registered for any component class and format. The re
143
143
144
144
The conversion layer uses `cattrs` to transform between the product's `xarray`/`attrs`-based object model and plain Python data structures suitable for serialization. This layer is format-agnostic and handles structural transformations common across formats.
145
145
146
-
**Unstructuring (write path)**: A `cattrs` converter with appropriate hooks will convert components to nested dictionaries organized by block, handling tasks like
146
+
**Unstructuring (write time)**: A `cattrs` converter with appropriate unstructuring hooks converts components to a form suitable for serialization, handling transformations like:
147
147
148
-
-Organizing fields into blocks according to their `block` metadata from DFN files
149
-
- Converting child components to binding records for parent component name files
150
-
-Sliceing time-varying (period block) arrays by stress period
151
-
- Converting `Path` objects to records (`FILEOUT` etc)
148
+
-Grouping fields into blocks according to their `block` metadata from DFNs
149
+
- Converting child components to binding tables for parent component name files
150
+
-Slicing time-varying arrays by stress period, returned in a period-indexed `dict`
151
+
- Converting `Path` objects to tuples (`<name>`, `FILEIN`/`FILEOUT`, `<path>`)
152
152
153
-
**Structuring (read path)**: The reverse transformation turns dictionaries of primitives into component instances. A `cattrs` converter with appropriate hooks will, among other things,
153
+
The unstructuring phase aims to avoid a) unnecessary copies and b) materializing data in memory.
154
154
155
-
- Instantiate child components from binding records
156
-
- Convert sparse list-input representations to arrays
157
-
- Reconstruct time-varying array variables from indexed blocks
158
-
- Guarantee `xarray` objects have proper dimensions/coordinates
155
+
**Structuring (load time)**: A `cattrs` converter with appropriate structuring hooks converts dictionaries of primitives into component instances, including:
156
+
157
+
- Instantiating child components from bindings
158
+
- Converting sparse list input data representations to arrays
159
+
- Reconstructing time-varying array variables from indexed blocks
160
+
- Guaranteeing `xarray` objects have proper dimensions/coordinates
0 commit comments