Skip to content

Commit 540b42a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4b9edd2 commit 540b42a

File tree

3 files changed

+38
-37
lines changed

3 files changed

+38
-37
lines changed

tstore/tests/conftest.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def create_geometry_list(size: int) -> list[Point]:
9898
return points
9999

100100

101-
@pytest.fixture()
101+
@pytest.fixture
102102
def helpers() -> type[Helpers]:
103103
"""Return the class of helper functions."""
104104
return Helpers
@@ -109,20 +109,20 @@ def helpers() -> type[Helpers]:
109109
## DataFrames
110110

111111

112-
@pytest.fixture()
112+
@pytest.fixture
113113
def dask_dataframe(helpers) -> dd.DataFrame:
114114
"""Create a Dask DataFrame with a dummy time series (with time index)."""
115115
return helpers.create_dask_dataframe()
116116

117117

118-
@pytest.fixture()
118+
@pytest.fixture
119119
def dask_dataframe_no_index(dask_dataframe: dd.DataFrame) -> dd.DataFrame:
120120
"""Create a Dask DataFrame with a dummy time series (without time index)."""
121121
df_dask = dask_dataframe.reset_index()
122122
return df_dask
123123

124124

125-
@pytest.fixture()
125+
@pytest.fixture
126126
def geopandas_dataframe(helpers) -> gpd.GeoDataFrame:
127127
"""Create a GeoPandas DataFrame with dummy attributes."""
128128
gdf = gpd.GeoDataFrame()
@@ -132,35 +132,35 @@ def geopandas_dataframe(helpers) -> gpd.GeoDataFrame:
132132
return gdf
133133

134134

135-
@pytest.fixture()
135+
@pytest.fixture
136136
def pandas_dataframe(dask_dataframe: dd.DataFrame) -> pd.DataFrame:
137137
"""Create a Pandas DataFrame with a dummy time series (with time index)."""
138138
df_pd = dask_dataframe.compute()
139139
return df_pd
140140

141141

142-
@pytest.fixture()
142+
@pytest.fixture
143143
def pandas_dataframe_no_index(dask_dataframe_no_index: dd.DataFrame) -> pd.DataFrame:
144144
"""Create a Pandas DataFrame with a dummy time series (without time index)."""
145145
df_pd = dask_dataframe_no_index.compute()
146146
return df_pd
147147

148148

149-
@pytest.fixture()
149+
@pytest.fixture
150150
def pyarrow_dataframe(pandas_dataframe: pd.DataFrame) -> pa.Table:
151151
"""Create an PyArrow Table with a dummy time series (without index)."""
152152
df_pyarrow = pa.Table.from_pandas(pandas_dataframe)
153153
return df_pyarrow
154154

155155

156-
@pytest.fixture()
156+
@pytest.fixture
157157
def polars_dataframe(pyarrow_dataframe: pa.Table) -> pl.DataFrame:
158158
"""Create a Polars DataFrame with a dummy time series (without index)."""
159159
df_pl = pl.from_arrow(pyarrow_dataframe)
160160
return df_pl
161161

162162

163-
@pytest.fixture()
163+
@pytest.fixture
164164
def pandas_dataframe_arrow_dtypes(pyarrow_dataframe: pa.Table) -> pd.DataFrame:
165165
"""Create a Pandas DataFrame with Arrow dtypes (with index)."""
166166
df_pd = pyarrow_dataframe.to_pandas(types_mapper=pd.ArrowDtype)
@@ -170,42 +170,42 @@ def pandas_dataframe_arrow_dtypes(pyarrow_dataframe: pa.Table) -> pd.DataFrame:
170170
## Series
171171

172172

173-
@pytest.fixture()
173+
@pytest.fixture
174174
def pandas_series(pandas_dataframe: pd.DataFrame) -> pd.Series:
175175
"""Create a dummy Pandas Series of floats (with index)."""
176176
series = pandas_dataframe["var3"]
177177
return series
178178

179179

180-
@pytest.fixture()
180+
@pytest.fixture
181181
def pandas_series_no_index(pandas_series: pd.Series) -> pd.Series:
182182
"""Create a dummy Pandas Series of floats (without index)."""
183183
series = pandas_series.reset_index(drop=True)
184184
return series
185185

186186

187-
@pytest.fixture()
187+
@pytest.fixture
188188
def dask_series(pandas_series: pd.Series) -> dd.DataFrame:
189189
"""Create a Dask Series from a Pandas Series (with index)."""
190190
series = dd.from_pandas(pandas_series)
191191
return series
192192

193193

194-
@pytest.fixture()
194+
@pytest.fixture
195195
def dask_series_no_index(pandas_series_no_index: pd.Series) -> dd.DataFrame:
196196
"""Create a Dask Series from a Pandas Series (without index)."""
197197
series = dd.from_pandas(pandas_series_no_index)
198198
return series
199199

200200

201-
@pytest.fixture()
201+
@pytest.fixture
202202
def polars_series(pandas_series: pd.Series) -> pl.Series:
203203
"""Create a Polars Series from a Pandas Series (without index)."""
204204
series = pl.from_pandas(pandas_series)
205205
return series
206206

207207

208-
@pytest.fixture()
208+
@pytest.fixture
209209
def pyarrow_series(pandas_series: pd.Series) -> pa.Array:
210210
"""Create a PyArrow Array from a Pandas Series (without index)."""
211211
series = pa.Array.from_pandas(pandas_series)
@@ -215,7 +215,7 @@ def pyarrow_series(pandas_series: pd.Series) -> pa.Array:
215215
## Stored data
216216

217217

218-
@pytest.fixture()
218+
@pytest.fixture
219219
def parquet_timeseries(tmp_path: Path, dask_dataframe: dd.DataFrame) -> Path:
220220
"""Create a Parquet file with a dummy time series."""
221221
filepath = tmp_path / "test.parquet"
@@ -244,7 +244,7 @@ def parquet_timeseries(tmp_path: Path, dask_dataframe: dd.DataFrame) -> Path:
244244
return filepath
245245

246246

247-
@pytest.fixture()
247+
@pytest.fixture
248248
def tstore_path(tmp_path: Path, pandas_long_dataframe: pd.DataFrame) -> Path:
249249
"""Store a Pandas long DataFrame as a TStore."""
250250
# TODO: Rewrite without using tstore to not depend on implementation
@@ -277,7 +277,7 @@ def tstore_path(tmp_path: Path, pandas_long_dataframe: pd.DataFrame) -> Path:
277277
return dirpath
278278

279279

280-
@pytest.fixture()
280+
@pytest.fixture
281281
def geo_tstore_path(
282282
tmp_path: Path,
283283
pandas_long_dataframe: pd.DataFrame,
@@ -318,14 +318,14 @@ def geo_tstore_path(
318318
## Long DataFrames
319319

320320

321-
@pytest.fixture()
321+
@pytest.fixture
322322
def dask_long_dataframe(pandas_long_dataframe: pd.DataFrame) -> dd.DataFrame:
323323
"""Create a long Dask DataFrame."""
324324
df_dask = dd.from_pandas(pandas_long_dataframe)
325325
return df_dask
326326

327327

328-
@pytest.fixture()
328+
@pytest.fixture
329329
def pandas_long_dataframe(helpers) -> pd.DataFrame:
330330
"""Create a long Pandas DataFrame."""
331331
store_ids = np.arange(1, 4 + 1)
@@ -343,14 +343,14 @@ def pandas_long_dataframe(helpers) -> pd.DataFrame:
343343
return df
344344

345345

346-
@pytest.fixture()
346+
@pytest.fixture
347347
def polars_long_dataframe(pandas_long_dataframe: pd.DataFrame) -> pl.DataFrame:
348348
"""Create a long Polars DataFrame."""
349349
df_pl = pl.from_pandas(pandas_long_dataframe, include_index=True)
350350
return df_pl
351351

352352

353-
@pytest.fixture()
353+
@pytest.fixture
354354
def pyarrow_long_dataframe(pandas_long_dataframe: pd.DataFrame) -> pa.Table:
355355
"""Create a long Pyarrow Table."""
356356
df_pa = pa.Table.from_pandas(pandas_long_dataframe, preserve_index=True)
@@ -360,7 +360,7 @@ def pyarrow_long_dataframe(pandas_long_dataframe: pd.DataFrame) -> pa.Table:
360360
## TSLong
361361

362362

363-
@pytest.fixture()
363+
@pytest.fixture
364364
def dask_tslong(dask_long_dataframe: pd.DataFrame) -> tstore.tslong.TSLongDask:
365365
"""Create a Dask TSLong object."""
366366
tslong = tstore.TSLong.wrap(
@@ -373,7 +373,7 @@ def dask_tslong(dask_long_dataframe: pd.DataFrame) -> tstore.tslong.TSLongDask:
373373
return tslong
374374

375375

376-
@pytest.fixture()
376+
@pytest.fixture
377377
def pandas_tslong(pandas_long_dataframe: pd.DataFrame) -> tstore.tslong.TSLongPandas:
378378
"""Create a Pandas TSLong object."""
379379
tslong = tstore.TSLong.wrap(
@@ -386,7 +386,7 @@ def pandas_tslong(pandas_long_dataframe: pd.DataFrame) -> tstore.tslong.TSLongPa
386386
return tslong
387387

388388

389-
@pytest.fixture()
389+
@pytest.fixture
390390
def polars_tslong(polars_long_dataframe: pl.DataFrame) -> tstore.tslong.TSLongPolars:
391391
"""Create a Polars TSLong object."""
392392
tslong = tstore.TSLong.wrap(
@@ -399,7 +399,7 @@ def polars_tslong(polars_long_dataframe: pl.DataFrame) -> tstore.tslong.TSLongPo
399399
return tslong
400400

401401

402-
@pytest.fixture()
402+
@pytest.fixture
403403
def pyarrow_tslong(pyarrow_long_dataframe: pa.Table) -> tstore.tslong.TSLongPyArrow:
404404
"""Create a PyArrow TSLong object."""
405405
tslong = tstore.TSLong.wrap(
@@ -415,7 +415,7 @@ def pyarrow_tslong(pyarrow_long_dataframe: pa.Table) -> tstore.tslong.TSLongPyAr
415415
### TSLong with geometry data
416416

417417

418-
@pytest.fixture()
418+
@pytest.fixture
419419
def dask_geo_tslong(
420420
dask_long_dataframe: dd.DataFrame,
421421
geopandas_dataframe: gpd.GeoDataFrame,
@@ -432,7 +432,7 @@ def dask_geo_tslong(
432432
return tslong
433433

434434

435-
@pytest.fixture()
435+
@pytest.fixture
436436
def pandas_geo_tslong(
437437
pandas_long_dataframe: dd.DataFrame,
438438
geopandas_dataframe: gpd.GeoDataFrame,
@@ -449,7 +449,7 @@ def pandas_geo_tslong(
449449
return tslong
450450

451451

452-
@pytest.fixture()
452+
@pytest.fixture
453453
def polars_geo_tslong(
454454
polars_long_dataframe: dd.DataFrame,
455455
geopandas_dataframe: gpd.GeoDataFrame,
@@ -466,7 +466,7 @@ def polars_geo_tslong(
466466
return tslong
467467

468468

469-
@pytest.fixture()
469+
@pytest.fixture
470470
def pyarrow_geo_tslong(
471471
pyarrow_long_dataframe: dd.DataFrame,
472472
geopandas_dataframe: gpd.GeoDataFrame,
@@ -486,7 +486,7 @@ def pyarrow_geo_tslong(
486486
## TSArrays
487487

488488

489-
@pytest.fixture()
489+
@pytest.fixture
490490
def dask_tsarray(helpers) -> tstore.TSArray:
491491
"""Create a TSArray of TS objects."""
492492
return helpers.create_dask_tsarray(size=4)
@@ -495,7 +495,7 @@ def dask_tsarray(helpers) -> tstore.TSArray:
495495
## Pandas Series
496496

497497

498-
@pytest.fixture()
498+
@pytest.fixture
499499
def pandas_series_of_ts(dask_tsarray: tstore.TSArray) -> pd.Series:
500500
"""Create a Pandas Series of TS objects from a TSArray."""
501501
df_series = pd.Series(dask_tsarray)
@@ -505,7 +505,7 @@ def pandas_series_of_ts(dask_tsarray: tstore.TSArray) -> pd.Series:
505505
## TSDF DataFrames
506506

507507

508-
@pytest.fixture()
508+
@pytest.fixture
509509
def pandas_tsdf_dataframe(helpers) -> pd.DataFrame:
510510
"""Create a Pandas dataframe with TSArray columns."""
511511
pd_series_of_ts_1 = pd.Series(helpers.create_dask_tsarray(size=4, columns_slice=slice(0, 2)))
@@ -525,7 +525,7 @@ def pandas_tsdf_dataframe(helpers) -> pd.DataFrame:
525525
return df
526526

527527

528-
@pytest.fixture()
528+
@pytest.fixture
529529
def geopandas_tsdf_dataframe(
530530
helpers,
531531
pandas_tsdf_dataframe: pd.DataFrame,
@@ -544,7 +544,7 @@ def geopandas_tsdf_dataframe(
544544
## TSDF
545545

546546

547-
@pytest.fixture()
547+
@pytest.fixture
548548
def tsdf_ts_dask(pandas_tsdf_dataframe) -> tstore.tsdf.TSDF:
549549
"""Create a TSDF object with Dask TS objects."""
550550
tsdf = tstore.TSDF.wrap(
@@ -555,7 +555,7 @@ def tsdf_ts_dask(pandas_tsdf_dataframe) -> tstore.tsdf.TSDF:
555555
return tsdf
556556

557557

558-
@pytest.fixture()
558+
@pytest.fixture
559559
def geo_tsdf_ts_dask(geopandas_tsdf_dataframe) -> tstore.tsdf.TSDF:
560560
"""Create a GeoPandas TSDF object with Dask TS objects."""
561561
tsdf = tstore.TSDF.wrap(

tstore/tests/test_tslong.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_creation(
126126
class TestCreationArgs:
127127
"""Test the creation of a TSLong object with various arguments."""
128128

129-
@pytest.fixture()
129+
@pytest.fixture
130130
def base_kwargs(self, backend: Backend, request) -> dict:
131131
"""Return a template of keyword arguments for the TSLong wrapper."""
132132
dataframe_fixture_name = f"{backend}_long_dataframe"

tutorials/00-key-concepts.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"from os import path\n",
1414
"\n",
1515
"import pandas as pd\n",
16+
"\n",
1617
"import tstore\n",
1718
"from tstore.tslong.pandas import open_tslong, to_tstore"
1819
]

0 commit comments

Comments
 (0)