Skip to content

Commit aa36f2e

Browse files
committed
Version: Increased supported version of numpy and pytables
1 parent b30d567 commit aa36f2e

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

cesnet_tszoo/configs/base_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def _set_default_values(self, default_values: dict[str, Number]) -> None:
451451

452452
elif self.default_values is None or math.isnan(self.default_values) or np.isnan(self.default_values):
453453
# If default_values is None or NaN, assign NaN to each feature
454-
self.default_values = {feature: np.NaN for feature in self.features_to_take_without_ids}
454+
self.default_values = {feature: np.nan for feature in self.features_to_take_without_ids}
455455
self.logger.debug("Assigned NaN as the default value for all features because 'default_values' is None or NaN.")
456456

457457
# Convert the default values into a NumPy array for consistent data handling

cesnet_tszoo/pytables_data/base_datasets/base_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def cleanup(self) -> None:
7171
def load_data_from_table(self, ts_row_ranges_to_take: np.ndarray, time_indices_to_take: np.ndarray, fillers_to_use: np.ndarray[Filler] | None) -> np.ndarray:
7272
"""Return data from table. Missing values are filled with `fillers_to_use` and `default_values`. """
7373

74-
result = np.full((len(ts_row_ranges_to_take), len(time_indices_to_take), len(self.features_to_take)), fill_value=np.NaN, dtype=np.float64)
74+
result = np.full((len(ts_row_ranges_to_take), len(time_indices_to_take), len(self.features_to_take)), fill_value=np.nan, dtype=np.float64)
7575
result[:, :, self.offset_exclude_feature_ids:] = self.default_values
7676

7777
full_missing_indices = np.arange(0, len(time_indices_to_take))
@@ -119,7 +119,7 @@ def load_data_from_table(self, ts_row_ranges_to_take: np.ndarray, time_indices_t
119119

120120
# Get valid times
121121
filtered_rows = rows[mask].view()
122-
filtered_rows[ID_TIME_COLUMN_NAME] -= first_time_index
122+
filtered_rows[ID_TIME_COLUMN_NAME] = filtered_rows[ID_TIME_COLUMN_NAME] - first_time_index
123123
existing_indices = filtered_rows[ID_TIME_COLUMN_NAME].view()
124124

125125
missing_values_mask = np.ones(len(time_indices_to_take), dtype=bool)

cesnet_tszoo/pytables_data/base_datasets/initializer_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def cleanup(self) -> None:
5454
def load_data_from_table(self, identifier_row_range_to_take: np.ndarray, idx: int) -> np.ndarray:
5555
"""Returns data from table. Missing values are filled fillers and `default_values`. Prepares fillers."""
5656

57-
result = np.full((len(self.time_period), len(self.features_to_take)), fill_value=np.NaN, dtype=np.float64)
57+
result = np.full((len(self.time_period), len(self.features_to_take)), fill_value=np.nan, dtype=np.float64)
5858
result[:, self.offset_exclude_feature_ids:] = self.default_values
5959

6060
expected_offset = np.uint32(len(self.time_period))
@@ -95,7 +95,7 @@ def load_data_from_table(self, identifier_row_range_to_take: np.ndarray, idx: in
9595

9696
# Get valid times
9797
filtered_rows = rows[mask].view()
98-
filtered_rows[ID_TIME_COLUMN_NAME] -= first_time_index
98+
filtered_rows[ID_TIME_COLUMN_NAME] = filtered_rows[ID_TIME_COLUMN_NAME] - first_time_index
9999
existing_indices = filtered_rows[ID_TIME_COLUMN_NAME].view()
100100

101101
missing_values_mask = np.ones(len(self.time_period), dtype=bool)

cesnet_tszoo/utils/scaler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def partial_fit(self, data: np.ndarray) -> None:
2828
def transform(self, data: np.ndarray):
2929
log_data = np.ma.log(data)
3030
31-
return log_data.filled(np.NaN)
31+
return log_data.filled(np.nan)
3232
"""
3333

3434
@abstractmethod
@@ -133,7 +133,7 @@ def transform(self, data: np.ndarray):
133133

134134
class LogScaler(Scaler):
135135
"""
136-
Tranforms data with natural logarithm. Zero or invalid values are set to `np.NaN`.
136+
Tranforms data with natural logarithm. Zero or invalid values are set to `np.nan`.
137137
138138
Corresponds to enum [`ScalerType.LOG_SCALER`][cesnet_tszoo.utils.enums.ScalerType] or literal `log_scaler`.
139139
"""
@@ -147,7 +147,7 @@ def partial_fit(self, data: np.ndarray) -> None:
147147
def transform(self, data: np.ndarray):
148148
log_data = np.ma.log(data)
149149

150-
return log_data.filled(np.NaN)
150+
return log_data.filled(np.nan)
151151

152152

153153
class L2Normalizer(Scaler):

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "cesnet_tszoo"
7-
version = "0.1.1"
7+
version = "0.1.2"
88
authors = [
99
{ name = "Milan Kureš", email = "[email protected]" },
1010
{ name = "Josef Koumar", email = "[email protected]" },
@@ -33,13 +33,13 @@ classifiers = [
3333
]
3434
requires-python = ">=3.10"
3535
dependencies = [
36-
"numpy<2.0",
36+
"numpy>= 2.0, ==2.*",
3737
"pandas",
3838
"scikit-learn",
39-
"tables>=3.8.0,<=3.9.2",
40-
"torch>=1.10",
39+
"tables >= 3.10.0",
40+
"torch >= 1.10",
4141
"tqdm",
42-
"nbformat>=4.2.0",
42+
"nbformat >= 4.2.0",
4343
"plotly",
4444
"PyYAML",
4545
"requests",

0 commit comments

Comments
 (0)