Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
menouarazib committed Oct 10, 2023
1 parent 0f07b24 commit e67c777
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
8 changes: 4 additions & 4 deletions eventdetector_ts/optimization/event_extraction_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
"""
Expand Down
2 changes: 1 addition & 1 deletion eventdetector_ts/plotter/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e67c777

Please sign in to comment.