Skip to content

Commit 171689a

Browse files
Merge remote-tracking branch 'origin/main' into mm/transformer-mixin
# Conflicts: # aeon/transformations/collection/__init__.py # aeon/transformations/series/__init__.py
2 parents 5e434de + 636d7e4 commit 171689a

File tree

360 files changed

+11368
-9723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

360 files changed

+11368
-9723
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,6 +2747,15 @@
27472747
"contributions": [
27482748
"doc"
27492749
]
2750+
},
2751+
{
2752+
"login": "CodeFor2001",
2753+
"name": "Saniya S Inamdar",
2754+
"avatar_url": "https://avatars.githubusercontent.com/u/39870781?v=4",
2755+
"profile": "https://github.com/CodeFor2001",
2756+
"contributions": [
2757+
"doc"
2758+
]
27502759
}
27512760
],
27522761
"commitType": "docs"

.github/actions/numba_cache/action.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@ runs:
2424
run: echo "NUMBA_CACHE_DIR=${{ github.workspace }}/.numba_cache" >> $GITHUB_ENV
2525
shell: bash
2626

27-
# Sets the cpu name for numba to use
28-
- name: Set numba cpu env
27+
# Sets the CPU name for numba to use
28+
# This is required for reusing the cache across different runners of the same
29+
# architecture and OS
30+
- name: Set numba CPU env
2931
run: echo "NUMBA_CPU_NAME=generic" >> $GITHUB_ENV
3032
shell: bash
3133

32-
# Sets the cpu features for numba to use
33-
- name: Set numba cpu features env
34+
# Sets the CPU features for numba to use
35+
# Found through a bit of trial and error to run on different CPUs found in GitHub
36+
# runners
37+
- name: Set numba CPU features env
3438
run: echo "NUMBA_CPU_FEATURES=+64bit +adx +aes +avx +avx2 -avx512bf16 -avx512bitalg -avx512bw -avx512cd -avx512dq -avx512er -avx512f -avx512ifma -avx512pf -avx512vbmi -avx512vbmi2 -avx512vl -avx512vnni -avx512vpopcntdq +bmi +bmi2 -cldemote -clflushopt -clwb -clzero +cmov +cx16 +cx8 -enqcmd +f16c +fma -fma4 +fsgsbase +fxsr -gfni +invpcid -lwp +lzcnt +mmx +movbe -movdir64b -movdiri -mwaitx +pclmul -pconfig -pku +popcnt -prefetchwt1 +prfchw -ptwrite -rdpid +rdrnd +rdseed +rtm +sahf -sgx -sha -shstk +sse +sse2 +sse3 +sse4.1 +sse4.2 -sse4a +ssse3 -tbm -vaes -vpclmulqdq -waitpkg -wbnoinvd -xop +xsave -xsavec +xsaveopt -xsaves" >> $GITHUB_ENV
3539
shell: bash
3640

37-
# Set the CICD_RUNNING env so that numba knows it is running in a CI environment
38-
- name: Set CICD_RUNNING env
39-
run: echo "CICD_RUNNING=1" >> $GITHUB_ENV
41+
# Set the CACHING_CICD_RUNNING env so we know to use custom numba caching
42+
- name: Set CACHING_CICD_RUNNING env
43+
run: echo "CACHING_CICD_RUNNING=1" >> $GITHUB_ENV
4044
shell: bash
4145

4246
# Get current date for cache restore
@@ -58,6 +62,6 @@ runs:
5862
path: ${{ github.workspace }}/.numba_cache
5963
# Try restore using today's date
6064
key: numba-${{ inputs.cache_name }}-${{ inputs.runner_os }}-${{ inputs.python_version }}-${{ env.CURRENT_DATE }}
61-
# If cant restore with today's date try another cache (without date)
65+
# If can't restore with today's date try another cache (without date)
6266
restore-keys: |
6367
numba-${{ inputs.cache_name }}-${{ inputs.runner_os }}-${{ inputs.python_version }}-
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Script for handling AI Spam label on pull requests.
2+
3+
Triggered when AI Spam label is added to a PR,
4+
it adds a comment and closes the PR.
5+
"""
6+
7+
import json
8+
import os
9+
10+
from github import Github
11+
12+
context_dict = json.loads(os.getenv("CONTEXT_GITHUB"))
13+
14+
repo_name = context_dict["repository"]
15+
g = Github(os.getenv("GITHUB_TOKEN"))
16+
repo = g.get_repo(repo_name)
17+
pr_number = context_dict["event"]["pull_request"]["number"]
18+
pr = repo.get_pull(pr_number)
19+
label_name = context_dict["event"]["label"]["name"]
20+
21+
if label_name == "AI pull request":
22+
pr.create_issue_comment(
23+
"This pull request has been flagged with the **AI pull request** label as it"
24+
"is suspected to be comprised of mostly AI code.\n\n"
25+
"`aeon` does not accept pull requests that are primarily generated by AI "
26+
"tools.\n\n"
27+
"If you believe this label has been applied in error, contact us on Slack or"
28+
"GitHub."
29+
)
30+
pr.edit(state="closed")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fpr
2+
mape
3+
recuse
4+
strat

.github/utilities/issue_assign.py

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"""Script for the GitHub issue self-assign bot.
22
3-
It checks if a comment on an issue or PR includes the trigger
4-
phrase (as defined) and a mentioned user.
5-
If it does, it assigns the issue to the mentioned user.
6-
Users without write access can only have up to 2 open issues assigned.
7-
Users with write access (or admin) are exempt from this limit.
8-
If a non-write user already has 2 or more open issues, the bot
9-
comments on the issue with links to the currently assigned open issues.
3+
Checks if a comment on an issue or PR includes the trigger phrase and a mentioned user.
4+
If it does, it assigns or unassigns the issue to the mentioned user if they have
5+
permissions.
106
"""
117

128
import json
@@ -22,54 +18,75 @@
2218
repo = g.get_repo(repo)
2319
issue_number = context_dict["event"]["issue"]["number"]
2420
issue = repo.get_issue(number=issue_number)
25-
comment_body = context_dict["event"]["comment"]["body"]
21+
issue_labels = {label.name.lower() for label in issue.labels}
2622
pr = context_dict["event"]["issue"].get("pull_request")
23+
comment_body = context_dict["event"]["comment"]["body"]
2724
commenter = context_dict["event"]["comment"]["user"]["login"]
25+
commenter_permission = repo.get_collaborator_permission(commenter)
26+
has_write_permission = commenter_permission not in ["admin", "write"]
27+
28+
restricted_labels = {"meta-issue"}
2829

30+
# Assign tagged used to the issue if the comment includes the trigger phrase
2931
body = comment_body.lower()
30-
if "@aeon-actions-bot" in body and not pr:
31-
# Assign commenter if comment includes "assign me"
32-
if "assign me" in body:
33-
issue.add_to_assignees(commenter)
34-
# Assign tagged used to the issue if the comment includes the trigger phrase
35-
elif "assign" in body:
32+
if "@aeon-actions-bot" in body and "assign" in body and not pr:
33+
# Check if the issue has any restricted labels for auto assignment
34+
label_intersect = issue_labels & restricted_labels
35+
if len(label_intersect) > 0:
36+
issue.create_comment(
37+
f"This issue contains the following restricted label(s): "
38+
f"{', '.join(label_intersect)}. Cannot assign to users."
39+
)
40+
else:
41+
# collect any mentioned (@username) users
3642
mentioned_users = re.findall(r"@[a-zA-Z0-9_-]+", comment_body)
3743
mentioned_users = [user[1:] for user in mentioned_users]
3844
mentioned_users.remove("aeon-actions-bot")
45+
# Assign commenter if comment includes "assign me"
46+
if "assign me" in body:
47+
mentioned_users.append(commenter)
48+
mentioned_users = set(mentioned_users)
3949

50+
access_error = False
4051
for user in mentioned_users:
41-
user_obj = g.get_user(user)
42-
permission = repo.get_collaborator_permission(user_obj)
52+
# Can only assign others if the commenter has write access
53+
if user != commenter and not has_write_permission:
54+
if not access_error:
55+
issue.create_comment(
56+
"Cannot assign other users to issues without write access."
57+
)
58+
access_error = True
59+
continue
60+
61+
# If the user is already assigned to this issue, remove them
62+
if user in [assignee.login for assignee in issue.assignees]:
63+
issue.remove_from_assignees(user)
64+
continue
4365

44-
if permission in ["admin", "write"]:
66+
# If the commenter has write access, just assign
67+
if has_write_permission:
4568
issue.add_to_assignees(user)
4669
else:
47-
# First check if the user is already assigned to this issue
48-
if user in [assignee.login for assignee in issue.assignees]:
49-
continue
50-
5170
# search for open issues only
5271
query = f"repo:{repo.full_name} is:issue is:open assignee:{user}"
5372
issues_assigned_to_user = g.search_issues(query)
5473
assigned_count = issues_assigned_to_user.totalCount
5574

56-
if assigned_count >= 2:
75+
if assigned_count >= 3:
5776
# link to issue
5877
assigned_issues_list = [
5978
f"[#{assigned_issue.number}]({assigned_issue.html_url})"
6079
for assigned_issue in issues_assigned_to_user
6180
]
6281

63-
comment_message = (
64-
f"@{user}, you already have {assigned_count} "
65-
f"open issues assigned."
66-
"Users without write access are limited to self-assigning two"
67-
"issues.\n\n"
68-
"Here are the open issues assigned to you:\n"
82+
issue.create_comment(
83+
f"@{user}, already has {assigned_count} open issues assigned."
84+
"Users without write access are limited to self-assigning "
85+
"three issues.\n\n"
86+
"Here are the open issues assigned:\n"
6987
+ "\n".join(
7088
f"- {issue_link}" for issue_link in assigned_issues_list
7189
)
7290
)
73-
issue.create_comment(comment_message)
7491
else:
7592
issue.add_to_assignees(user)

.github/workflows/issue_assigned.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Issue Assigned
1+
name: Issue assigned
22

33
on:
44
issues:

.github/workflows/issue_comment_edited.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Issue Comment Edited
1+
name: Issue comment edited
22

33
on:
44
issue_comment:
@@ -51,10 +51,9 @@ jobs:
5151

5252
- if: ${{ steps.label_out.outputs.empty_commit == 'true' }}
5353
name: Push empty commit
54-
uses: stefanzweifel/git-auto-commit-action@v5
54+
uses: stefanzweifel/git-auto-commit-action@v6
5555
with:
5656
commit_message: Empty commit for CI
5757
commit_user_name: aeon-actions-bot[bot]
5858
commit_options: --allow-empty
59-
create_branch: false
6059
skip_dirty_check: true

.github/workflows/issue_comment_posted.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Issue Comment Posted
1+
name: Issue comment posted
22

33
on:
44
issue_comment:

.github/workflows/periodic_tests.yml

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Periodic Tests
1+
name: Periodic tests
22

33
on:
44
schedule:
@@ -174,11 +174,18 @@ jobs:
174174
with:
175175
python-version: ${{ matrix.python-version }}
176176

177+
- name: Clear disik space
178+
uses: jlumbroso/[email protected]
179+
with:
180+
dotnet: false
181+
large-packages: false
182+
swap-storage: false
183+
177184
- name: Set swap space
178185
if: runner.os == 'Linux'
179186
uses: pierotofy/[email protected]
180187
with:
181-
swap-size-gb: 10
188+
swap-size-gb: 8
182189

183190
- name: Use numba cache to set env variables but not restore cache
184191
uses: ./.github/actions/numba_cache
@@ -208,6 +215,72 @@ jobs:
208215
# Save cache with the current date (ENV set in numba_cache action)
209216
key: numba-pytest-${{ runner.os }}-${{ matrix.python-version}}-${{ env.CURRENT_DATE }}
210217

218+
doctests:
219+
runs-on: ubuntu-24.04
220+
221+
steps:
222+
- name: Checkout
223+
uses: actions/checkout@v4
224+
225+
- name: Setup Python 3.12
226+
uses: actions/setup-python@v5
227+
with:
228+
python-version: "3.12"
229+
230+
- name: Use numba cache to set env variables but not restore cache
231+
uses: ./.github/actions/numba_cache
232+
with:
233+
cache_name: "doctests"
234+
runner_os: ${{ runner.os }}
235+
python_version: "3.12"
236+
restore_cache: "false"
237+
238+
- name: Install aeon and dependencies
239+
uses: nick-fields/retry@v3
240+
with:
241+
timeout_minutes: 30
242+
max_attempts: 3
243+
command: python -m pip install .[all_extras,dev]
244+
245+
- name: Show dependencies
246+
run: python -m pip list
247+
248+
- name: Run tests
249+
run: python -m pytest -n logical --doctest-only --doctest-continue-on-failure
250+
251+
multithreaded-estimators:
252+
runs-on: ubuntu-24.04
253+
254+
steps:
255+
- name: Checkout
256+
uses: actions/checkout@v4
257+
258+
- name: Setup Python 3.12
259+
uses: actions/setup-python@v5
260+
with:
261+
python-version: "3.12"
262+
263+
- name: Use numba cache to set env variables but not restore cache
264+
uses: ./.github/actions/numba_cache
265+
with:
266+
cache_name: "multithreaded-estimators"
267+
runner_os: ${{ runner.os }}
268+
python_version: "3.12"
269+
restore_cache: "false"
270+
271+
- name: Install aeon and dependencies
272+
uses: nick-fields/retry@v3
273+
with:
274+
timeout_minutes: 30
275+
max_attempts: 3
276+
command: python -m pip install .[all_extras,dev]
277+
278+
- name: Show dependencies
279+
run: python -m pip list
280+
281+
- name: Run tests
282+
run: python -m pytest aeon/testing/tests/ --enablethreading true -k "check_estimator_multithreading"
283+
211284
codecov:
212285
runs-on: ubuntu-24.04
213286

.github/workflows/pr_examples.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR Examples
1+
name: PR examples
22

33
on:
44
push:
@@ -41,7 +41,8 @@ jobs:
4141
runner_os: ${{ runner.os }}
4242
python_version: "3.12"
4343

44-
- uses: ./.github/actions/cpu_all_extras
44+
- name: Install aeon and dependencies
45+
uses: ./.github/actions/cpu_all_extras
4546
with:
4647
additional_extras: "dev,binder"
4748

0 commit comments

Comments
 (0)