Skip to content

Commit

Permalink
Update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Apr 6, 2024
1 parent 2c91101 commit 33c74ac
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
2 changes: 2 additions & 0 deletions ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ channels:
dependencies:
- dask
- distributed
- numpy
- pandas
- polars
- pyarrow
- pytest
- pytest-cov
- pytest-mock
- pytest-sugar
- pyyaml
2 changes: 2 additions & 0 deletions ci/environment_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ channels:
dependencies:
- dask
- distributed
- numpy
- pandas
- polars
- pyarrow
- pytest
- pytest-cov
- pytest-mock
- pytest-sugar
- pyyaml
8 changes: 7 additions & 1 deletion docs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ name: build-doc-tstore
channels:
- conda-forge
dependencies:
- dask
- distributed
- docutils
- jupyter
- nbsphinx==0.9.3
- numpy
- pandas
- pandoc
- pip
- polars
- pyarrow
- python>=3.9
- pyyaml
- sphinx-book-theme==1.1.0
- sphinx-gallery
- sphinx-mdinclude==0.5.3
- sphinx==7.2.6
- sphinxcontrib-youtube
- ts-store
- pip:
- ts-store
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies = [
"distributed",
"polars",
"geopandas",
"pyyaml",
]
dynamic = ["version"]

Expand Down
5 changes: 2 additions & 3 deletions tstore/archive/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def check_start_end_time(start_time, end_time):
if end_time is not None:
end_time = check_time(end_time)
# Check start_time and end_time are chronological
if start_time is not None and end_time is not None:
if start_time > end_time:
raise ValueError("Provide start_time occurring before of end_time")
if start_time is not None and end_time is not None and start_time > end_time:
raise ValueError("Provide start_time occurring before of end_time")
return (start_time, end_time)
19 changes: 8 additions & 11 deletions tstore/tsdf/extensions/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ def get_tabular_object_type(obj):
"""Get inner class of the TS object."""
if isinstance(obj, dd.DataFrame):
return "dask.DataFrame"
elif isinstance(obj, pd.DataFrame):
if isinstance(obj, pd.DataFrame):
return "dask.Series"
elif isinstance(obj, pd.DataFrame):
if isinstance(obj, pd.DataFrame):
return "pandas.DataFrame"
elif isinstance(obj, pd.Series):
if isinstance(obj, pd.Series):
return "pandas.Series"
else:
return type(obj).__name__
return type(obj).__name__


class TSArray(ExtensionArray):
Expand Down Expand Up @@ -82,10 +81,9 @@ def __getitem__(self, index: int) -> "TSArray" | Any:
"""Select a subset of self."""
if isinstance(index, int):
return self._data[index]
else:
# Check index for TestGetitemTests
index = pd.core.indexers.check_array_indexer(self, index)
return type(self)(self._data[index])
# Check index for TestGetitemTests
index = pd.core.indexers.check_array_indexer(self, index)
return type(self)(self._data[index])

# TestSetitemTests
def __setitem__(self, index: int, value: TS) -> None:
Expand Down Expand Up @@ -124,8 +122,7 @@ def _from_sequence(cls, data, dtype=None, copy: bool = False):
if not isinstance(dtype, TSDtype):
msg = f"'{cls.__name__}' only supports 'TSDtype' dtype"
raise ValueError(msg)
else:
return cls(data, copy=copy)
return cls(data, copy=copy)

# Required for all ExtensionArray subclasses
@classmethod
Expand Down
3 changes: 1 addition & 2 deletions tstore/tsdf/extensions/ts_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ def __eq__(self, other: Any) -> bool:
"""Test TS equality."""
if isinstance(other, str):
return self.name == other
else:
return isinstance(other, type(self)) and self.ts_class == other.ts_class
return isinstance(other, type(self)) and self.ts_class == other.ts_class

# Required for pickle compat (see GH26067)
def __setstate__(self, state) -> None:
Expand Down

0 comments on commit 33c74ac

Please sign in to comment.