diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index dade360..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.11" ] + 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: | @@ -48,14 +48,14 @@ jobs: run: | coverage run -m pytest tests/ coverage xml -o coverage.xml - - name: Upload coverage report (only for ubuntu-latest and python 3.11) - if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} + - name: Upload coverage report (only for ubuntu-latest and python 3.10) + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }} uses: actions/upload-artifact@v3 with: name: coverage-report path: coverage.xml - - name: Run Coveralls (only for ubuntu-latest and python 3.11) - if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} + - name: Run Coveralls (only for ubuntu-latest and python 3.10) + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: coverallsapp/github-action@v2 diff --git a/eventdetector_ts/optimization/event_extraction_pipeline.py b/eventdetector_ts/optimization/event_extraction_pipeline.py index cb9379e..522d696 100644 --- a/eventdetector_ts/optimization/event_extraction_pipeline.py +++ b/eventdetector_ts/optimization/event_extraction_pipeline.py @@ -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 Union[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. @@ -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 Union[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)