Skip to content

Commit

Permalink
Merge branch 'main' into adds_class_weights
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickzib authored Jul 9, 2024
2 parents 6442580 + ab2ef20 commit 1a93ef2
Show file tree
Hide file tree
Showing 21 changed files with 1,679 additions and 174 deletions.
10 changes: 6 additions & 4 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"projectOwner": "aeon-toolkit",
"repoType": "github",
"repoHost": "https://github.com",
"files": ["CONTRIBUTORS.md"],
"files": [
"CONTRIBUTORS.md"
],
"imageSize": 80,
"commit": "false"
"commit": "false",
"commitConvention": "atom",
"contributorsPerLine": 8,
"contributorsSortAlphabetically": true,
Expand Down Expand Up @@ -2349,7 +2351,7 @@
"code",
"doc",
"research",
"tests",
"test",
"review",
"data"
]
Expand Down Expand Up @@ -2436,5 +2438,5 @@
"doc"
]
}
],
]
}
48 changes: 36 additions & 12 deletions .github/workflows/issue_comment_edited.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
name: Issue Comment Posted
name: Issue Comment Edited

on:
issue_comment:
types: [edited]

concurrency:
group: ${{ github.workflow }}-${{ github.event.comment.id }}
cancel-in-progress: true

jobs:
check-pr-labels:
pr-welcome-edited:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-20.04

steps:
- name: Checkout
- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_APP_ID }}
private-key: ${{ secrets.PR_APP_KEY }}

- name: Checkout main
uses: actions/checkout@v4
with:
sparse-checkout: build_tools
Expand All @@ -22,15 +34,27 @@ jobs:
- name: Install PyGithub
run: pip install -Uq PyGithub

- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_APP_ID }}
private-key: ${{ secrets.PR_APP_KEY }}

- name: Assign issue
run: python build_tools/comment_pr_labeler.py
- name: Process comment edit
id: label_out
run: python build_tools/pr_welcome_edited.py
env:
CONTEXT_GITHUB: ${{ toJson(github) }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

- if: ${{ steps.label_out.outputs.empty_commit == 'true' }}
name: Checkout head
uses: actions/checkout@v4
with:
repository: ${{ steps.label_out.outputs.repo }}
ref: ${{ steps.label_out.outputs.branch }}
token: ${{ steps.app-token.outputs.token }}

- if: ${{ steps.label_out.outputs.empty_commit == 'true' }}
name: Push empty commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Empty commit for CI
commit_user_name: aeon-actions-bot[bot]
commit_options: --allow-empty
create_branch: false
skip_dirty_check: true
2 changes: 1 addition & 1 deletion .github/workflows/periodic_github_maintenace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
private-key: ${{ secrets.PR_APP_KEY }}

- name: Stale Branches
uses: crs-k/stale-branches@v5
uses: crs-k/stale-branches@v5.0.1
with:
repo-token: ${{ steps.app-token.outputs.token }}
days-before-stale: 140
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/pr_precommit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: PR pre-commit

on:
push:
branches:
- main
pull_request_target:
branches:
- main
Expand All @@ -24,7 +27,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
token: ${{ steps.app-token.outputs.token }}

- name: Setup Python 3.10
Expand All @@ -50,9 +54,10 @@ jobs:
with:
extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}

- if: ${{ failure() && github.event_name == 'pull_request_target' && github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'stop pre-commit fixes')}}
- if: ${{ failure() && github.event_name == 'pull_request_target' && !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name, 'stop pre-commit fixes') }}
name: Push pre-commit fixes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automatic `pre-commit` fixes
commit_user_name: aeon-actions-bot[bot]
create_branch: false
2 changes: 1 addition & 1 deletion .github/workflows/precommit_autoupdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
python-version: "3.10"

- uses: browniebroke/pre-commit-autoupdate-action@v1
- uses: browniebroke/pre-commit-autoupdate-action@v1.0.0

- if: always()
name: Create app token
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
args: [ "--create", "--python-folders", "aeon" ]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
rev: v0.5.1
hooks:
- id: ruff
args: [ "--fix"]
Expand All @@ -48,7 +48,7 @@ repos:
args: [ "--profile=black", "--multi-line=3" ]

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies: [ flake8-bugbear, flake8-print, Flake8-pyproject ]
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ aeon/transformations/theta.py @GuzalBulatova

aeon/utils/numba/ @baraline @MatthewMiddlehurst

aeon/visualisation/ @baraline

.github/ @aeon-toolkit/aeon-infrastructure-workgroup
build_tools/ @aeon-toolkit/aeon-infrastructure-workgroup

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="12.5%"><a href="https://github.com/dasgupsa"><img src="https://avatars2.githubusercontent.com/u/10398956?v=4?s=80" width="80px;" alt="Saurabh Dasgupta"/><br /><sub><b>Saurabh Dasgupta</b></sub></a><br /><a href="https://github.com/aeon-toolkit/aeon/commits?author=dasgupsa" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/SebasKoel"><img src="https://avatars3.githubusercontent.com/u/66252156?v=4?s=80" width="80px;" alt="Sebastiaan Koel"/><br /><sub><b>Sebastiaan Koel</b></sub></a><br /><a href="https://github.com/aeon-toolkit/aeon/commits?author=SebasKoel" title="Code">💻</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=SebasKoel" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/shagn"><img src="https://avatars.githubusercontent.com/u/16029092?v=4?s=80" width="80px;" alt="Sebastian Hagn"/><br /><sub><b>Sebastian Hagn</b></sub></a><br /><a href="https://github.com/aeon-toolkit/aeon/commits?author=shagn" title="Documentation">📖</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/codelionx"><img src="https://avatars.githubusercontent.com/u/10573700?v=4?s=80" width="80px;" alt="Sebastian Schmidl"/><br /><sub><b>Sebastian Schmidl</b></sub></a><br /><a href="https://github.com/aeon-toolkit/aeon/issues?q=author%3Acodelionx" title="Bug reports">🐛</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=codelionx" title="Code">💻</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=codelionx" title="Documentation">📖</a> <a href="#research-codelionx" title="Research">🔬</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/codelionx"><img src="https://avatars.githubusercontent.com/u/10573700?v=4?s=80" width="80px;" alt="Sebastian Schmidl"/><br /><sub><b>Sebastian Schmidl</b></sub></a><br /><a href="https://github.com/aeon-toolkit/aeon/issues?q=author%3Acodelionx" title="Bug reports">🐛</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=codelionx" title="Code">💻</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=codelionx" title="Documentation">📖</a> <a href="#research-codelionx" title="Research">🔬</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=codelionx" title="Tests">⚠️</a> <a href="https://github.com/aeon-toolkit/aeon/pulls?q=is%3Apr+reviewed-by%3Acodelionx" title="Reviewed Pull Requests">👀</a> <a href="#data-codelionx" title="Data">🔣</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://github.com/AurumnPegasus"><img src="https://avatars.githubusercontent.com/u/54315149?v=4?s=80" width="80px;" alt="Shivansh Subramanian"/><br /><sub><b>Shivansh Subramanian</b></sub></a><br /><a href="https://github.com/aeon-toolkit/aeon/commits?author=AurumnPegasus" title="Documentation">📖</a> <a href="https://github.com/aeon-toolkit/aeon/commits?author=AurumnPegasus" title="Code">💻</a></td>
<td align="center" valign="top" width="12.5%"><a href="https://www.linkedin.com/in/solomon-botchway-a1383821b/"><img src="https://avatars.githubusercontent.com/u/62394255?v=4?s=80" width="80px;" alt="Solomon Botchway"/><br /><sub><b>Solomon Botchway</b></sub></a><br /><a href="#maintenance-snnbotchway" title="Maintenance">🚧</a></td>
</tr>
Expand Down
7 changes: 6 additions & 1 deletion aeon/classification/shapelet_based/_rdst.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class RDSTClassifier(BaseClassifier):
If True, restrict the value of the shapelet dilation parameter to be prime
values. This can greatly speed-up the algorithm for long time series and/or
short shapelet length, possibly at the cost of some accuracy.
distance: str="manhattan"
Name of the distance function to be used. By default this is the
manhattan distance. Other distances from the aeon distance modules can be used.
estimator : BaseEstimator or None, default=None
Base estimator for the ensemble, can be supplied a sklearn `BaseEstimator`. If
`None` a default `RidgeClassifierCV` classifier is used with standard scalling.
Expand Down Expand Up @@ -147,6 +150,7 @@ def __init__(
estimator=None,
save_transformed_data: bool = False,
class_weight=None,
distance: str = "manhattan",
n_jobs: int = 1,
random_state: Union[int, Type[np.random.RandomState], None] = None,
) -> None:
Expand All @@ -157,7 +161,7 @@ def __init__(
self.alpha_similarity = alpha_similarity
self.use_prime_dilations = use_prime_dilations
self.class_weight = class_weight

self.distance = distance
self.estimator = estimator
self.save_transformed_data = save_transformed_data
self.random_state = random_state
Expand Down Expand Up @@ -198,6 +202,7 @@ def _fit(self, X, y):
use_prime_dilations=self.use_prime_dilations,
n_jobs=self.n_jobs,
random_state=self.random_state,
distance=self.distance,
)
if self.estimator is None:
self._estimator = make_pipeline(
Expand Down
9 changes: 5 additions & 4 deletions aeon/transformations/collection/convolution_based/_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class HydraTransformer(BaseCollectionTransformer):
"output_data_type": "Tabular",
"algorithm_type": "convolution",
"python_dependencies": "torch",
"fit_is_empty": True,
}

def __init__(
Expand All @@ -82,7 +81,7 @@ def __init__(

super().__init__()

def _transform(self, X, y=None):
def _fit(self, X, y=None):
import torch

if isinstance(self.random_state, int):
Expand All @@ -91,14 +90,16 @@ def _transform(self, X, y=None):
n_jobs = check_n_jobs(self.n_jobs)
torch.set_num_threads(n_jobs)

self.hydra = _HydraInternal(
self._hydra = _HydraInternal(
X.shape[2],
X.shape[1],
k=self.n_kernels,
g=self.n_groups,
max_num_channels=self.max_num_channels,
)
return self.hydra(torch.tensor(X).float())

def _transform(self, X, y=None):
return self._hydra(torch.tensor(X).float())


if _check_soft_dependencies("torch", severity="none"):
Expand Down
Loading

0 comments on commit 1a93ef2

Please sign in to comment.