finam.Info#
- class finam.Info(time=None, grid=None, meta=None, mask=Mask.FLEX, **meta_kwargs)[source]#
Bases:
object
Data info containing grid specification and metadata
- Parameters:
time (datetime or None, optional) – time specification, default: None
grid (Grid or NoGrid or None, optional) – grid specification, default: None
meta (dict, optional) – dictionary of metadata, default: None
mask (
Mask
value or valid boolean mask forMasked arrays
, optional) –**meta_kwargs – additional metadata by name, will overwrite entries in
meta
- Variables:
- Attributes:
fill_value
Fill value for masked data.
grid
Grid: data grid.
grid_shape
tuple: shape of the data grid.
is_masked
bool: whether data is set to be masked.
mask
Mask or ndarray: data mask.
time
datetime: current time.
Methods
accepts
(incoming, fail_info[, ...])Tests whether this info can accept/is compatible with an incoming info.
as_dict
()Returns a
dict
containing all metadata in this Info.copy
()Copies the info object
copy_with
([use_none])Copies the info object and sets variables and meta values according to the kwargs
- property time#
current time.
- Type:
datetime
- property fill_value#
Fill value for masked data.
- copy_with(use_none=True, **kwargs)[source]#
Copies the info object and sets variables and meta values according to the kwargs
- Parameters:
use_none (bool) – whether properties with None value should also be transferred
**kwargs – key values pairs for properties to change
- accepts(incoming, fail_info, incoming_donwstream=False)[source]#
Tests whether this info can accept/is compatible with an incoming info.
Tested attributes are: “grid”, “mask” and “units”
- Parameters:
incoming (Info) – Incoming/source info to check. This is the info from upstream.
fail_info (dict) – Dictionary that will be filled with failed properties; name: (source, target).
incoming_donwstream (bool, optional) – Whether the incoming info is from downstream data. Default: False
- Returns:
Whether the incoming info is accepted
- Return type: