imas.backends.netcdf.nc2ids.LazyArrayStructContext¶
- class imas.backends.netcdf.nc2ids.LazyArrayStructContext(nc2ids, index, size)¶
Bases:
LazyContextLazyArrayStructContext is a subclass of LazyContext that provides a context for handling structured arrays in a lazy manner. It is initialized with a NetCDF to IDS mapping object, an index, and a size.
Methods
__init__(nc2ids, index, size)Initialize the instance with nc2ids, index, and size.
get_child(child)Retrieves and sets the appropriate context or value for a given child node based on its metadata.
Returns the current context.
iterate_to_index(index)Iterates to a specified index and returns a LazyContext object.
- get_child(child)¶
Retrieves and sets the appropriate context or value for a given child node based on its metadata.
- Parameters:
- child¶
The child IDS node which should be lazy loaded.
- get_context()¶
Returns the current context.
This method returns the current instance of the class, which is expected to have a ‘size’ attribute as required by IDSStructArray.
- Returns:
The current instance of the class.
- iterate_to_index(index: int) LazyContext¶
Iterates to a specified index and returns a LazyContext object.
- Parameters:
- Returns:
A LazyContext object initialized with the updated index.
- Return type: