|
| 1 | +.. mermaid:: |
| 2 | + |
| 3 | + flowchart TD |
| 4 | + A[shot, run] --> root |
| 5 | + R[Reference shot\nReference run] --> root |
| 6 | + V[Version in memory e.g. 3.38.1] --> VOX |
| 7 | + X[XML path e.g. IDSRoot.xml] --> VOX |
| 8 | + VD[Version on disk memory e.g. 3.37.1] --> VOXD |
| 9 | + XD[XML path on disk memory e.g. 3.37.1] --> VOXD |
| 10 | + VOX{Version or XML\nin memory?} --> root |
| 11 | + VOXD{Version or XML\non disk?} --> root |
| 12 | + L[lazy] --> root |
| 13 | + root[IDSRoot] --> LZ{Lazy?} |
| 14 | + LZ -->|True| D[Loop over direct children with a name\nInitialize IDSToplevel with it] |
| 15 | + N[version is handled special here!] --> D |
| 16 | + LZ-->|False| E[Add name to children, nothing else] |
| 17 | + E -->|on getattr| F{attr style?} |
| 18 | + F -->|already initialized| G["return using super()"] |
| 19 | + F -->|No children| H["return []"] |
| 20 | + F -->|key in _children| I["Initialize IDSToplevel with key"] |
| 21 | + I --> T |
| 22 | + D -->|parent, key/name, ids XML element, backend_version, backend_xml_path| T[IDSToplevel init] |
| 23 | + T -->|"call super()"|K[Got parent, name, structure_xml] |
| 24 | + subgraph STRUCT["IDSStructure.__init__"] |
| 25 | + direction TB |
| 26 | + K --> B |
| 27 | + subgraph MIXIN["IDSMixin.__init__"] |
| 28 | + direction TB |
| 29 | + B[Got parent, name, structure_xml] --> J["Set internal vars on self:\n _name, _parent, _coordinates, _last_backend_xml_hash, _backend_name"] |
| 30 | + end |
| 31 | + J -->|For each XML child| M[Append name to _children] |
| 32 | + M --> O{child data_type} |
| 33 | + O -->|structure| P[Initialize childs IDSStructure] |
| 34 | + P -->|recurse, parent->child| K |
| 35 | + O -->|struct_array| Q[Initialize IDSStructArray] |
| 36 | + O -->|else| S["get_coordinates (can be {})"] |
| 37 | + S --> U["create_leaf_container(child name, child data_type, parent, coordinates, var_type=type)"] |
| 38 | + subgraph LEAF["create_leaf_container"] |
| 39 | + U --> W{Depending on\ndata_type} |
| 40 | + W --> Y[Determine ids_type, ndims from DD_TYPES] |
| 41 | + Y --> Z{ndins ==?} |
| 42 | + Z -->|ndins==0| AA["IDSPrimitive(name, ids_type, ndims, **kwargs)"] |
| 43 | + Z -->|ndins!=0 && ids_type==STR| AB["IDSPrimitive(name, ids_type, ndims, **kwargs)"] |
| 44 | + Z -->|ndins!=0 && ids_type!=STR| AC["IDSNumericArray(name, ids_type, ndims, **kwargs)"] |
| 45 | + end |
| 46 | + subgraph NUMERICARRAY["IDSNumericArray.__init__"] |
| 47 | + direction TB |
| 48 | + AC --> AD["No special init"] |
| 49 | +
|
| 50 | + end |
| 51 | + subgraph PRIMITIVE["IDSPrimitive.__init__"] |
| 52 | + direction TB |
| 53 | + AA --> AE |
| 54 | + AD --> AE |
| 55 | + AB --> AE["Same call signature, same case?"] |
| 56 | + AE -->|"Call super() IDSMixin init"| AF |
| 57 | + subgraph CHILDMIXIN["IDSMixin.__init__"] |
| 58 | + direction TB |
| 59 | + AF[Got parent, name, coordinates] --> AG["Set internal vars on self:\n _name, _parent, _coordinates, _last_backend_xml_hash, _backend_name"] |
| 60 | + end |
| 61 | + AG --> AH["Set internal vars on self:\n __value, _ids_type, _var_type, _ndims, _backend_type=None, _backend_ndims = None"] |
| 62 | + AH --> AI(["A child node has been generated\nPass to parent"]) |
| 63 | + end |
| 64 | + end |
0 commit comments