CFA Array Wrapper Classes
- class cfapyx.wrappers.CFAOptionsMixin[source]
Bases:
object
Simple container for CFA options properties.
- property cfa_options
Relates private option variables to the
cfa_options
parameter of the backend.
- class cfapyx.wrappers.FragmentArrayWrapper(fragment_info, fragment_space, shape, units, dtype, cfa_options={}, named_dims=None)[source]
Bases:
ArrayLike
,CFAOptionsMixin
,ActiveOptionsContainer
FragmentArrayWrapper behaves like an Array that can be indexed or referenced to return a Dask-like array object. This class is essentially a constructor for the partitions that feed into the returned Dask-like array into Xarray.
- __init__(fragment_info, fragment_space, shape, units, dtype, cfa_options={}, named_dims=None)[source]
Initialisation method for the FragmentArrayWrapper class
- Parameters:
fragment_info – (dict) The information relating to each fragment with the fragment coordinates in
fragment space
as the key. Each fragment is described by the following: -shape
- The shape of the fragment inarray space
. -location
- The file from which this fragment originates. -address
- The variable and group name relating to this variable. -extent
- The slice object to apply to the fragment on retrieval (usually get the whole array) -global_extent
- The slice object that equates to a particular fragment out of the whole array (inarray space
).fragment_space – (tuple) The coordinate system that refers to individual fragments. Each coordinate eg. i, j, k refers to the number of fragments in each of the associated dimensions.
shape – (tuple) The total shape of the array in
array space
units – (obj) The units of the values represented in this Array-like class.
dtype – (obj) The datatype of the values represented in this Array-like class.
cfa_options – (dict) The set of options defining some specific decoding behaviour.
named_dims – (list) The set of dimension names that apply to this Array object.
- Returns:
None
- __array__()[source]
Non-lazy array construction, this will occur as soon as the instance is
indexed
or any otherarray
behaviour is attempted. Construction of a Dask-like array occurs here based on the decoded fragment info and any other specified settings.
- __weakref__
list of weak references to the object
- class cfapyx.wrappers.CFAPartition(filename, address, aggregated_units=None, aggregated_calendar=None, global_extent=None, **kwargs)[source]
Bases:
ArrayPartition
Wrapper object for a CFA Partition, extends the basic ArrayPartition with CFA-specific methods.
- __init__(filename, address, aggregated_units=None, aggregated_calendar=None, global_extent=None, **kwargs)[source]
Wrapper object for the ‘array’ section of a fragment. Contains some metadata to ensure the correct fragment is selected, but generally just serves the fragment array to dask when required.
- Parameters:
filename – (str) The path to a Fragment file from which this partition object will access data from. The partition may represent all or a subset of the data from the Fragment file.
address – (str) The address of the data variable within the Fragment file, may include a group hierarchy structure.
aggregated_units – (obj) The expected units for the received data. If the units of the received data are not equal to the
aggregated_units
then the data is ‘post-processed’ using the cfunitsconform
function.aggregated_calendar – None