gensor 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gensor-0.2.2 → gensor-0.2.4}/PKG-INFO +1 -1
- {gensor-0.2.2 → gensor-0.2.4}/gensor/core/base.py +4 -1
- {gensor-0.2.2 → gensor-0.2.4}/gensor/core/dataset.py +5 -1
- {gensor-0.2.2 → gensor-0.2.4}/gensor/core/indexer.py +2 -2
- {gensor-0.2.2 → gensor-0.2.4}/pyproject.toml +1 -1
- {gensor-0.2.2 → gensor-0.2.4}/LICENSE +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/README.md +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/analysis/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/analysis/outliers.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/analysis/stats.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/config.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/core/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/core/timeseries.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/db/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/db/connection.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/exceptions.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/io/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/io/read.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/log.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/parse/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/parse/plain.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/parse/utils.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/parse/vanessen.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/processing/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/processing/compensation.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/processing/smoothing.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/processing/transform.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/testdata/Barodiver_220427183008_BY222.csv +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/testdata/PB01A_moni_AV319_220427183019_AV319.csv +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/testdata/PB02A_plain.csv +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/gensor/testdata/__init__.py +0 -0
- {gensor-0.2.2 → gensor-0.2.4}/py.typed +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import uuid
|
|
4
|
+
from copy import deepcopy
|
|
4
5
|
from typing import Any, Literal, TypeVar
|
|
5
6
|
|
|
6
7
|
import pandas as pd
|
|
@@ -107,7 +108,9 @@ class BaseTimeseries(pyd.BaseModel):
|
|
|
107
108
|
result = ts_attr(*args, **kwargs)
|
|
108
109
|
# If the result is a Series, return a new Timeseries; otherwise, return the result
|
|
109
110
|
if isinstance(result, pd.Series):
|
|
110
|
-
return self.model_copy(
|
|
111
|
+
return self.model_copy(
|
|
112
|
+
update={"ts": deepcopy(result)}, deep=True
|
|
113
|
+
)
|
|
111
114
|
|
|
112
115
|
return result
|
|
113
116
|
|
|
@@ -36,6 +36,10 @@ class Dataset(pyd.BaseModel, Generic[T]):
|
|
|
36
36
|
def __getitem__(self, index: int) -> T | None:
|
|
37
37
|
"""Retrieve a Timeseries object by its index in the dataset.
|
|
38
38
|
|
|
39
|
+
!!! warning
|
|
40
|
+
Using index will return the reference to the timeseries. If you need a copy,
|
|
41
|
+
use .filter() instead of Dataset[index]
|
|
42
|
+
|
|
39
43
|
Parameters:
|
|
40
44
|
index (int): The index of the Timeseries to retrieve.
|
|
41
45
|
|
|
@@ -46,7 +50,7 @@ class Dataset(pyd.BaseModel, Generic[T]):
|
|
|
46
50
|
IndexError: If the index is out of range.
|
|
47
51
|
"""
|
|
48
52
|
try:
|
|
49
|
-
return self.timeseries[index]
|
|
53
|
+
return self.timeseries[index]
|
|
50
54
|
except IndexError:
|
|
51
55
|
raise IndexOutOfRangeError(index, len(self)) from None
|
|
52
56
|
|
|
@@ -18,12 +18,12 @@ class TimeseriesIndexer:
|
|
|
18
18
|
self.indexer = indexer
|
|
19
19
|
|
|
20
20
|
def __getitem__(self, key: str) -> Any:
|
|
21
|
-
"""Allows using the indexer (e.g., loc) and wraps the result in
|
|
21
|
+
"""Allows using the indexer (e.g., loc) and wraps the result in the parent Timeseries."""
|
|
22
22
|
|
|
23
23
|
result = self.indexer[key]
|
|
24
24
|
|
|
25
25
|
if isinstance(result, pd.Series):
|
|
26
|
-
return self.parent.model_copy(update={"ts": result}, deep=
|
|
26
|
+
return self.parent.model_copy(update={"ts": result}, deep=False)
|
|
27
27
|
|
|
28
28
|
if isinstance(result, (int | float | str | pd.Timestamp | np.float64)):
|
|
29
29
|
return result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|