earthkit.data.data.wrappers¶
Submodules¶
Classes¶
A simple implementation of the Data interface that provides default implementations |
Functions¶
|
Returns the input object with the appropriate earthkit-data wrapper. |
Package Contents¶
- class earthkit.data.data.wrappers.ObjectWrapperData(data, *args, **kwargs)¶
Bases:
earthkit.data.data.SimpleDataA simple implementation of the Data interface that provides default implementations for some methods.
- property available_types: list[str]¶
- Abstractmethod:
Return the list of available types that this data object can be converted to.
- Type:
list[str]
- abstractmethod describe()¶
Provide a description of the data object.
- is_stream()¶
Return False as this data object is not a stream.
- property path: str | list[str] | None¶
Return the path(s) of the data object.
- Returns:
The path(s) of the data object.
- Return type:
str|List[str]|None
- to(to_type, *args, **kwargs)¶
Convert the data object into another type.
- Parameters:
to_type (
strorAny) – The type to convert to. It can be a str or an object that can be used to determine the target type. In the latter case, the object can be an earthkit-data object or an object that earthkit-data supports as an input. If no suitable conversion method is found, a NotImplementedError will be raised.*args – Positional arguments to pass to the conversion method.
**kwargs – Keyword arguments to pass to the conversion method.
- Returns:
The converted data object in the target type.
- Return type:
Any- Raises:
NotImplementedError – If conversion to the target type is not implemented.
- to_array(*args, **kwargs)¶
Convert into an array of a given array-like type.
This method is not implemented for this data object and raises NotImplementedError.
- to_featurelist(*args, **kwargs)¶
Convert into a featurelist.
This method is not implemented for this data object and raises NotImplementedError.
- to_fieldlist(*args, **kwargs)¶
Convert into a fieldlist.
This method is not implemented for this data object and raises NotImplementedError.
- to_geopandas(**kwargs)¶
Convert into a GeoPandas dataframe.
This method is not implemented for this data object and raises NotImplementedError.
- to_numpy(*args, **kwargs)¶
Convert into a numpy array.
This method is not implemented for this data object and raises NotImplementedError.
- to_pandas(*args, **kwargs)¶
Convert into a pandas dataframe.
This method is not implemented for this data object and raises NotImplementedError.
- to_target(target, *args, **kwargs)¶
Write the data to a target.
- Parameters:
target (
str) – The target to write to. Seeto_target()for more details on the supported targets.*args – Positional arguments to pass to the
to_target()**kwargs – Keyword arguments to pass to the
to_target(). Cannot specifydatain kwargs.
See also
- to_value(*args, **kwargs)¶
Convert into a single value.
This method is not implemented for this data object and raises NotImplementedError.
- to_xarray(*args, **kwargs)¶
Convert into an Xarray dataset.
This method is not implemented for this data object and raises NotImplementedError.
- earthkit.data.data.wrappers.from_object(data, *args, **kwargs)¶
Returns the input object with the appropriate earthkit-data wrapper. i.e. so that an xarray object can be handled as an earkit-data object.