diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f038357..bb98266 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] - python-version: [ "3.9", "3.10" ] + python-version: [ "3.9", "3.10", "3.11" ] steps: - uses: actions/checkout@v3 @@ -35,9 +35,9 @@ jobs: - name: Lint with ruff run: | # stop the build if there are Python syntax errors or undefined names - ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 . + ruff --output-format=github --select=E9,F63,F7,F82 --target-version=py37 . # default set of ruff rules with GitHub Annotations - ruff --format=github --target-version=py37 . + ruff --output-format=github --target-version=py37 . continue-on-error: true - name: List files in workspace run: | diff --git a/README.md b/README.md index 3f58797..35d493f 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ Secondly, it `does not require labeled datasets` where each point is labeled; instead, it only requires reference events defined as time points or intervals of time. Thirdly, it is designed to be `robust` through the use of a stacked ensemble learning metamodel that -combines deep learning models, including classic feed-forward -neural networks (FFNs) and state-of-the-art architectures like +combines deep learning models, from classic feed-forward +neural networks (FFNs) to the state-of-the-art architectures like transformers. By leveraging the collective strengths of multiple models, this ensemble approach can mitigate individual model weaknesses and biases, resulting in more robust predictions. diff --git a/eventdetector_ts/optimization/event_extraction_pipeline.py b/eventdetector_ts/optimization/event_extraction_pipeline.py index d97e31a..522d696 100644 --- a/eventdetector_ts/optimization/event_extraction_pipeline.py +++ b/eventdetector_ts/optimization/event_extraction_pipeline.py @@ -1,6 +1,6 @@ from datetime import timedelta from math import ceil -from typing import Tuple +from typing import Tuple, Union import numpy as np import pandas as pd @@ -20,8 +20,8 @@ class OptimizationData: - time_unit (TimeUnit): Unit of time used in the dataset. - true_events (pd.DataFrame): DataFrame to store true events. - predicted_op (np.ndarray): Array to store predicted outcomes. - - delta (int | float): The maximum time tolerance used to determine the correspondence between a predicted event - and its actual counterpart in the true events. + - delta Union[int, float]: The maximum time tolerance used to determine the correspondence between a predicted + event and its actual counterpart in the true events. - s_h (float): A step parameter for the peak height threshold h. - s_s (int): Step size in time unit for overlapping the partition. - w_s (int): Size in time unit of the overlapping partition. @@ -34,7 +34,7 @@ class OptimizationData: def __init__(self, t_max: float, w_s: int, s_s: int, s_h: float, - delta: int | float, + delta: Union[int, float], output_dir: str, time_unit: TimeUnit): """ Initializes the OptimizationData object. @@ -44,8 +44,8 @@ def __init__(self, t_max: float, w_s: int, s_s: int, w_s (int): Size in time unit of the overalapping partition. s_s (int): Step size in time unit for overalapping the partition. s_h (float): A step parameter for the peak height threshold h. - delta (int | float): The maximum time tolerance used to determine the correspondence between a predicted event - and its actual counterpart in the true events. + delta Union[int, float]: The maximum time tolerance used to determine the correspondence between a predicted + event and its actual counterpart in the true events. output_dir (str): The parent directory. time_unit (TimeUnit): Unit of time used in the dataset. """ diff --git a/eventdetector_ts/plotter/plotter.py b/eventdetector_ts/plotter/plotter.py index 0ffaf4c..a1dbf71 100644 --- a/eventdetector_ts/plotter/plotter.py +++ b/eventdetector_ts/plotter/plotter.py @@ -165,7 +165,7 @@ def plot_predicted_events(self) -> None: style=STYLE_PREDICTED) ax.add_patch(rect1) - for _, test_date in self.true_events[MIDDLE_EVENT_LABEL].iteritems(): + for _, test_date in self.true_events[MIDDLE_EVENT_LABEL].items(): rect1 = event_to_rectangle(event=test_date, width_events_s=self.width_events_s, time_unit=self.time_unit, color=COLOR_TRUE, style=STYLE_TRUE)