[Feature] Data Dimension Fields#416
[Feature] Data Dimension Fields#416FlorianDeconinck wants to merge 46 commits intoNOAA-GFDL:developfrom
Conversation
romanc
left a comment
There was a problem hiding this comment.
Looking good to me - just a bunch of nitpicks inline.
Fix docstrings and clean up code (per review)
| _type_registrar: dict[str, _DataDimensionsFieldDescriptor] = {} | ||
|
|
||
| @classmethod | ||
| def register( |
There was a problem hiding this comment.
generally: is there ever a time where we add data dimensions to a quantity-factory but do not want the registered in the Data-Dim-Field?
If not, should we bundle these up? would require more args to adding ddims. but might make it less error-prone?
There was a problem hiding this comment.
It's a good point. I am a bit worried about tying those two API closer. In my mind, this system is far from perfect and probably needs something on top to string it together.
@romanc: opinion?
There was a problem hiding this comment.
Aaaaaaaaaaand I have a use case: TranslateTest uses one QuantityFactory per rank in serial mode 😭
…data_dimnesion_fields
…est to confirm data is modified
|
Requires #431 merged first |
Description
The
gt4pyfrontend requires the data dimensions to be statically defined as part of the type for the stencil definition. This means that all dimension sizes need to be known when importing code. This is impractical when:We had introduced a
FieldBundleto fix this issue, but encountered a series of issues with orchestration.Building on the same idea of deferred types (see
internal.deferred_typeanddsl.stencil), we introduceDataDimensionFieldsthat expose adeclare(static typing) and aregister(dynamic sizing) function, solving the above, with a new series of simpler but orchestration worthy functions to access indexation:def index(name: str): allows to get an index of a dimension by name if it was given in themappingdef size(): gives the size of a dimension for loops rangeExtra code
When modifying
stencilI ran into amypyissue leading to the clean up of how the global debugger is instantiated.How has this been tested?
New unit tests + is developed against
pyFV3(PR/Branch TBD)TODO before merging
FieldBundleChecklist