tstore.tsdf package#
Submodules#
tstore.tsdf.geopandas module#
TSDF class wrapping a GeoPandas dataframe of TSArray objects.
tstore.tsdf.pandas module#
TSDF class wrapping a Pandas dataframe of TSArray objects.
tstore.tsdf.reader module#
Created on Mon Jun 12 15:48:39 2023.
@author: ghiggi
tstore.tsdf.ts_class module#
Created on Mon Jun 12 22:17:59 2023.
@author: ghiggi
- class tstore.tsdf.ts_class.TS(df: DataFrame | GeoDataFrame | DataFrame | DataFrame | Table, time_var='time')[source]#
Bases:
objectTS object.
- change_backend(new_backend)[source]#
Return a new TS object with the dataframe converted to a different backend.
- property current_backend#
Return the backend of the wrapped dataframe.
- static from_disk(fpath, partitions, backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'] = 'dask', columns=None, start_time=None, end_time=None, inclusive=None, split_row_groups=False, calculate_divisions=True, ignore_metadata_file=False, **kwargs)[source]#
Read a time series from disk into a Dask.DataFrame.
tstore.tsdf.ts_dtype module#
Created on Mon Jun 12 16:23:54 2023.
@author: ghiggi
- class tstore.tsdf.ts_dtype.TSDtype(ts_class=None)[source]#
Bases:
ExtensionDtypeAn ExtensionDtype for TS time series data.
- classmethod construct_from_string(string: str)[source]#
Construct an TSDtype from a string.
Example:#
>>> TSDtype.construct_from_string("TS[pandas]") TS['pandas']
- property name: str#
A string representation of the dtype.
- property ts_class: str#
The TS object class.
tstore.tsdf.tsarray module#
Created on Sun Jun 11 22:47:54 2023.
@author: ghiggi
- class tstore.tsdf.tsarray.TSArray(data, copy: bool = False)[source]#
Bases:
ExtensionArrayAn ExtensionArray for TS objects, holding the array-based implementations.
- property dtype#
An instance of TSDtype.
- property nbytes: int#
The number of bytes needed to store this object in memory.
- property ts_class#
TS inner class.
tstore.tsdf.tsdf module#
Module defining the TSDF abstract wrapper for a dataframe of TSArray objects.
- class tstore.tsdf.tsdf.TSDF(*args, **kwargs)[source]#
Bases:
TSWrapperWrapper for a DataFrame of TSArray objects.
- change_ts_backend(new_backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'], ts_cols: list[str] | None = None) TSDF[source]#
Return a new TSDF object with dataframes wrapped in internal TS objects converted to a different backend.
- Parameters:
new_backend (Backend) – New backend to use for the TS objects.
ts_cols (Optional[list[str]]) – List of columns to convert. If None, convert all TS columns.
- static from_tstore(base_dir: str, backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'] = 'dask') TSDF[source]#
Read TStore into TSDF object.
- get_ts_backend(ts_col: str) Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'][source]#
Return the current backend of a wrapped dataframe.
- to_tslong(backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'] = 'dask') TSLong[source]#
Convert the wrapper into a TSLong object.
- to_tstore(base_dir, partitioning=None, tstore_structure='id-var', overwrite=True)[source]#
Write TStore from TSDF object.
tstore.tsdf.writer module#
Created on Mon Jun 12 15:49:54 2023.
@author: ghiggi
Module contents#
TSDF package.
- class tstore.tsdf.TSDF(*args, **kwargs)[source]#
Bases:
TSWrapperWrapper for a DataFrame of TSArray objects.
- change_ts_backend(new_backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'], ts_cols: list[str] | None = None) TSDF[source]#
Return a new TSDF object with dataframes wrapped in internal TS objects converted to a different backend.
- Parameters:
new_backend (Backend) – New backend to use for the TS objects.
ts_cols (Optional[list[str]]) – List of columns to convert. If None, convert all TS columns.
- static from_tstore(base_dir: str, backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'] = 'dask') TSDF[source]#
Read TStore into TSDF object.
- get_ts_backend(ts_col: str) Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'][source]#
Return the current backend of a wrapped dataframe.
- to_tslong(backend: Literal['dask', 'geopandas', 'pandas', 'polars', 'pyarrow'] = 'dask') TSLong[source]#
Convert the wrapper into a TSLong object.
- to_tstore(base_dir, partitioning=None, tstore_structure='id-var', overwrite=True)[source]#
Write TStore from TSDF object.