Skip to content

Commit 65ba1bf

Browse files
committed
Merge branch 'main' into msm-bug-fix
2 parents e257a26 + b999d55 commit 65ba1bf

File tree

302 files changed

+18559
-8714
lines changed

Some content is hidden

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

302 files changed

+18559
-8714
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ github_checks:
2525
ignore:
2626
- ".github/"
2727
- ".binder/"
28-
- "aeon/testing/expected_results/results_reproduction/"
28+
- "aeon/testing/expected_results/_write_estimator_results.py"
2929
- "docs/"
3030
- "examples/"

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ contact_links:
33
url: https://github.com/aeon-toolkit/aeon/discussions/new/choose
44
about: If none of these options fit, your question or topic may be better suited to a discussion.
55
- name: "\U0001F4AC Slack"
6-
url: https://join.slack.com/t/aeon-toolkit/shared_invite/zt-36dlmbouu-vajTShUYAHopSXUUVtHGzw
6+
url: https://join.slack.com/t/aeon-toolkit/shared_invite/zt-3ihx5vif8-SwFzy1unNNMeQueC84MXVA
77
about: For all other questions and general chat, come chat with the aeon community on Slack!
88
- name: "\u2709\uFE0F Email"
99
url: https://mailxto.com/jbp3ave49x

.github/utilities/_commons.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
label_options = [
2+
("full pre-commit", "Run `pre-commit` checks for all files"),
3+
("run typecheck test", "Run `mypy` typecheck tests"),
4+
("full pytest actions", "Run all `pytest` tests and configurations"),
5+
("full examples run", "Run all notebook example tests"),
6+
("codecov actions", "Run numba-disabled `codecov` tests"),
7+
(
8+
"stop pre-commit fixes",
9+
"Stop automatic `pre-commit` fixes (always disabled for drafts)",
10+
),
11+
("no numba cache", "Disable numba cache loading"),
12+
]

.github/utilities/pr_open_commenter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
9999
If our `pre-commit` code quality check fails, any trivial fixes will automatically be pushed to your PR unless it is a draft.
100100
101-
Don't hesitate to ask questions on the `aeon` [Slack](https://join.slack.com/t/aeon-toolkit/shared_invite/zt-36dlmbouu-vajTShUYAHopSXUUVtHGzw) channel if you have any.
101+
Don't hesitate to ask questions on the `aeon` [Slack](https://join.slack.com/t/aeon-toolkit/shared_invite/zt-3ihx5vif8-SwFzy1unNNMeQueC84MXVA) channel if you have any.
102102
103103
<details><summary>PR CI actions</summary>
104104
<p>
@@ -112,6 +112,7 @@
112112
- [ ] Run numba-disabled `codecov` tests
113113
- [ ] Stop automatic `pre-commit` fixes (always disabled for drafts)
114114
- [ ] Disable numba cache loading
115+
- [ ] Regenerate expected results for testing
115116
- [ ] Push an empty commit to re-run CI checks
116117
117118
</p>

.github/utilities/pr_welcome_edited.py

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
"""Labels PRs and process based on bot comment checkboxes."""
1+
"""Labels PRs based on bot comment checkboxes."""
22

33
import json
44
import os
55
import sys
66

7+
from _commons import label_options
78
from github import Github
89

910
context_dict = json.loads(os.getenv("CONTEXT_GITHUB"))
@@ -17,62 +18,41 @@
1718
comment_user = context_dict["event"]["comment"]["user"]["login"]
1819
labels = [label.name for label in issue.get_labels()]
1920

21+
2022
if (
21-
issue.pull_request is None
23+
"[bot]" in context_dict["event"]["sender"]["login"]
24+
or issue.pull_request is None
2225
or comment_user != "aeon-actions-bot[bot]"
2326
or "## Thank you for contributing to `aeon`" not in comment_body
2427
):
2528
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
29+
print("expected_results=false", file=fh) # noqa: T201
2630
print("empty_commit=false", file=fh) # noqa: T201
2731
sys.exit(0)
28-
pr = issue.as_pull_request()
29-
30-
31-
def check_label_option(label, option):
32-
"""Add or remove a label based on a checkbox in a comment."""
33-
if f"- [x] {option}" in comment_body:
34-
if label not in labels:
35-
pr.add_to_labels(label)
36-
elif f"- [ ] {option}" in comment_body:
37-
if label in labels:
38-
pr.remove_from_labels(label)
39-
4032

41-
label_options = [
42-
("full pre-commit", "Run `pre-commit` checks for all files"),
43-
("run typecheck test", "Run `mypy` typecheck tests"),
44-
("full pytest actions", "Run all `pytest` tests and configurations"),
45-
("full examples run", "Run all notebook example tests"),
46-
("codecov actions", "Run numba-disabled `codecov` tests"),
47-
(
48-
"stop pre-commit fixes",
49-
"Stop automatic `pre-commit` fixes (always disabled for drafts)",
50-
),
51-
("no numba cache", "Disable numba cache loading"),
52-
]
33+
pr = issue.as_pull_request()
34+
comment = pr.get_issue_comment(context_dict["event"]["comment"]["id"])
5335

5436
for option in label_options:
55-
check_label_option(option[0], option[1])
37+
if f"- [x] {option[1]}" in comment_body and option[0] not in labels:
38+
pr.add_to_labels(option[0])
39+
elif f"- [ ] {option[1]}" in comment_body and option[0] in labels:
40+
pr.remove_from_labels(option[0])
5641

5742
repo_name = pr.head.repo.full_name
5843
branch_name = pr.head.ref
5944
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
6045
print(f"repo={repo_name}", file=fh) # noqa: T201
6146
print(f"branch={branch_name}", file=fh) # noqa: T201
6247

48+
if "- [x] Regenerate expected results for testing" in comment_body:
49+
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
50+
print("expected_results=true", file=fh) # noqa: T201
51+
else:
52+
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
53+
print("expected_results=false", file=fh) # noqa: T201
54+
6355
if "- [x] Push an empty commit to re-run CI checks" in comment_body:
64-
for comment in pr.get_comments():
65-
if (
66-
comment.user.login == comment_user
67-
and "## Thank you for contributing to `aeon`" in comment.body
68-
):
69-
comment.edit(
70-
comment_body.replace(
71-
"- [x] Push an empty commit to re-run CI checks",
72-
"- [ ] Push an empty commit to re-run CI checks",
73-
)
74-
)
75-
break
7656
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
7757
print("empty_commit=true", file=fh) # noqa: T201
7858
else:
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"""Labels PRs based on bot comment checkboxes."""
2+
3+
import json
4+
import os
5+
import sys
6+
7+
from _commons import label_options
8+
from github import Github
9+
10+
context_dict = json.loads(os.getenv("CONTEXT_GITHUB"))
11+
12+
repo = context_dict["repository"]
13+
g = Github(os.getenv("GITHUB_TOKEN"))
14+
repo = g.get_repo(repo)
15+
pr_number = context_dict["event"]["number"]
16+
pr = repo.get_pull(number=pr_number)
17+
labels = [label.name for label in pr.get_labels()]
18+
19+
if "[bot]" in context_dict["event"]["sender"]["login"]:
20+
sys.exit(0)
21+
22+
comment = None
23+
for c in pr.get_issue_comments():
24+
if (
25+
c.user.login == "aeon-actions-bot[bot]"
26+
and "## Thank you for contributing to `aeon-eval`" in c.body
27+
):
28+
comment = c
29+
break
30+
31+
if comment is None:
32+
sys.exit(0)
33+
34+
comment_body = comment.body
35+
for option in label_options:
36+
if f"- [x] {option[1]}" in comment_body and option[0] not in labels:
37+
comment_body = comment_body.replace(
38+
f"- [x] {option[1]}",
39+
f"- [ ] {option[1]}",
40+
)
41+
elif f"- [ ] {option[1]}" in comment_body and option[0] in labels:
42+
comment_body = comment_body.replace(
43+
f"- [ ] {option[1]}",
44+
f"- [x] {option[1]}",
45+
)
46+
47+
comment.edit(comment_body)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""Uncheck relevant boxes after running the comment edit workflow."""
2+
3+
import json
4+
import os
5+
import sys
6+
7+
from github import Github
8+
9+
context_dict = json.loads(os.getenv("CONTEXT_GITHUB"))
10+
11+
repo = context_dict["repository"]
12+
g = Github(os.getenv("GITHUB_TOKEN"))
13+
repo = g.get_repo(repo)
14+
issue_number = context_dict["event"]["issue"]["number"]
15+
issue = repo.get_issue(number=issue_number)
16+
comment_body = context_dict["event"]["comment"]["body"]
17+
comment_user = context_dict["event"]["comment"]["user"]["login"]
18+
19+
if (
20+
"[bot]" in context_dict["event"]["sender"]["login"]
21+
or issue.pull_request is None
22+
or comment_user != "aeon-actions-bot[bot]"
23+
or "## Thank you for contributing to `aeon`" not in comment_body
24+
):
25+
sys.exit(0)
26+
27+
pr = issue.as_pull_request()
28+
comment = pr.get_issue_comment(context_dict["event"]["comment"]["id"])
29+
30+
new_comment_body = comment_body
31+
32+
if "- [x] Regenerate expected results for testing" in comment_body:
33+
new_comment_body = new_comment_body.replace(
34+
"- [x] Regenerate expected results for testing",
35+
"- [ ] Regenerate expected results for testing",
36+
)
37+
38+
if "- [x] Push an empty commit to re-run CI checks" in comment_body:
39+
new_comment_body = new_comment_body.replace(
40+
"- [x] Push an empty commit to re-run CI checks",
41+
"- [ ] Push an empty commit to re-run CI checks",
42+
)
43+
44+
if new_comment_body != comment_body:
45+
comment.edit(new_comment_body)

.github/workflows/fast_release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
runs-on: ubuntu-24.04
1010

1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v5
1313

1414
- name: Setup Python 3.12
15-
uses: actions/setup-python@v5
15+
uses: actions/setup-python@v6
1616
with:
1717
python-version: "3.12"
1818

@@ -22,7 +22,7 @@ jobs:
2222
python -m build
2323
2424
- name: Store build files
25-
uses: actions/upload-artifact@v4
25+
uses: actions/upload-artifact@v5
2626
with:
2727
name: dist
2828
path: dist/*
@@ -38,7 +38,7 @@ jobs:
3838
id-token: write
3939

4040
steps:
41-
- uses: actions/download-artifact@v4
41+
- uses: actions/download-artifact@v6
4242
with:
4343
name: dist
4444
path: dist

.github/workflows/issue_assigned.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
private-key: ${{ secrets.PR_APP_KEY }}
2222

2323
- name: Checkout main
24-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
2525
with:
2626
sparse-checkout: .github/utilities
2727

2828
- name: Setup Python 3.12
29-
uses: actions/setup-python@v5
29+
uses: actions/setup-python@v6
3030
with:
3131
python-version: "3.12"
3232

.github/workflows/issue_comment_edited.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
private-key: ${{ secrets.PR_APP_KEY }}
2323

2424
- name: Checkout main
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@v5
2626
with:
2727
sparse-checkout: .github/utilities
2828

2929
- name: Setup Python 3.12
30-
uses: actions/setup-python@v5
30+
uses: actions/setup-python@v6
3131
with:
3232
python-version: "3.12"
3333

@@ -41,19 +41,36 @@ jobs:
4141
CONTEXT_GITHUB: ${{ toJson(github) }}
4242
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4343

44-
- if: ${{ steps.label_out.outputs.empty_commit == 'true' }}
44+
- if: ${{ steps.label_out.outputs.expected_results == 'true' || steps.label_out.outputs.empty_commit == 'true' }}
4545
name: Checkout head
46-
uses: actions/checkout@v4
46+
uses: actions/checkout@v5
4747
with:
4848
repository: ${{ steps.label_out.outputs.repo }}
4949
ref: ${{ steps.label_out.outputs.branch }}
5050
token: ${{ steps.app-token.outputs.token }}
5151

52+
- if: ${{ steps.label_out.outputs.expected_results == 'true' }}
53+
name: Regenerate expected results
54+
run: python aeon/testing/expected_results/_write_estimator_results.py
55+
56+
- if: ${{ steps.label_out.outputs.expected_results == 'true' }}
57+
name: Push expected results
58+
uses: stefanzweifel/git-auto-commit-action@v7
59+
with:
60+
commit_message: Regenerated expected results for testing
61+
commit_user_name: aeon-actions-bot[bot]
62+
5263
- if: ${{ steps.label_out.outputs.empty_commit == 'true' }}
5364
name: Push empty commit
54-
uses: stefanzweifel/git-auto-commit-action@v6
65+
uses: stefanzweifel/git-auto-commit-action@v7
5566
with:
5667
commit_message: Empty commit for CI
5768
commit_user_name: aeon-actions-bot[bot]
5869
commit_options: --allow-empty
5970
skip_dirty_check: true
71+
72+
- name: Uncheck relevant boxes
73+
run: python .github/utilities/uncheck_welcome_boxes.py
74+
env:
75+
CONTEXT_GITHUB: ${{ toJson(github) }}
76+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)