imas.backends.netcdf.nc2ids.LazyArrayStructContext

class imas.backends.netcdf.nc2ids.LazyArrayStructContext(nc2ids, index, size)

Bases: LazyContext

LazyArrayStructContext 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.

__init__(nc2ids, index, size)

Initialize the instance with nc2ids, index, and size.

Parameters:
nc2ids

The NetCDF to IDS mapping object.

index

The index within the NetCDF file.

size

The size of the data to be processed.

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.

get_context()

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:
index : int

The index to iterate to.

Returns:

A LazyContext object initialized with the updated index.

Return type:

LazyContext


Last update: 2026-01-28