Skip to content

Commit

Permalink
empty commit 9 (#23)
Browse files Browse the repository at this point in the history
* [BUG] fix padder fit_values (aeon-toolkit#1752)

* fix padder

* declare var

* [DOC,MNT] Documentation updates and deprecation warning for `v1.0.0` (aeon-toolkit#1743)

* forecasting docs

* v1.0.0 mass deprecation message

* index fix

* installation

* typos

* [MNT] Unit testing revamp part 1: `check_estimator` (aeon-toolkit#1479)

* remove no soft deps job and expand full no soft deps job

* no PR testing flag

* module soft deps

* is this actually returning an empty list

* import modules now

* clear out module soft dep

* check_estimator

* check_estimator updates

* import

* more complete functions and tests

* fix

* coverage and paramterize function test

* testing data start

* testing data start

* testing data cont

* real partial

* cont

* testing data changes

* examples revert

* fourier features

* Revert "fourier features"

This reverts commit 567c5e1.

* legacy skip

* init

* move to legacy

* example data update

* testing data

* imports

* examples

* testing update

* multiindex

* multiindex fixes

* multiindex returns

* test

* test

* docs, tests and fixes

* comments

* last bits

* refactor testing folder

* imports

* series generators

* fixes

* make_series legacy

* merge

* forecasting functions

* fixes

* fixes

* fixes

* testing

* examples

* convert checks

* fixes

* docs

* ad datasets

* more docs

* forecasting compose

* forecasting

* delete forecasting api docs

* docs

* revert and comment init

* imports

* import test

* uncomment

* docstrings

* no imports

* package name

* import

* docstring

* fixes

* remove legacy and doc fix

* [ENH] Channel selection rocket wrapper (aeon-toolkit#1504)

* base channel selector

* base channel selector

* random channel selector

* elbow class test

* random channel selector

* base channel selector

* base channel selector

* revert registry

* draft channel selector

* class method

* test channel scorer

* docstring

* remove unnecessary ExponentTransform import

* deprecate DateTime

* Revert "deprecate DateTime"

This reverts commit 98b29e6.

* channel selection

* remove dependency

* move tests to fit

* move tests to fit

* channel scorer test

* add to API

* [DEP] Exclusion list  (aeon-toolkit#1730)

* remove dependency

* excluded list

* [MNT] Removing `tensorflow_addons` dependency (aeon-toolkit#1421)

* tensorflow bound

* add manually instance normalization

* empty commit

* fix doxs

* fix bug

* add maintainer

* re arrange

* dep on utils

* fix comments

* add version and file to header

* re add conflict

* remove addon

* only adodn remove

* add typeguard dep

* remove addons from test

* remove tag of python<3.12 from base class

* edit pyptoject for test details

* remove typeguard

* remove addons

* remove typeguard

* fix bug in python version

* remove config on python < 3.12

* remove python version from test

* remove python version from base

* use group norm

* re-add 3.12 limit

* remove tags and add python version

* skip random state clr test

* fix test all networks

* set y for channel selection test

* set y for channel selection test

---------

Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>

* comment

* Empty commit for CI

* uncomment

---------

Co-authored-by: Tony Bagnall <ajb@uea.ac.uk>
Co-authored-by: hadifawaz1999 <hadifawaz2291999@gmail.com>
Co-authored-by: MatthewMiddlehurst <MatthewMiddlehurst@users.noreply.github.com>
  • Loading branch information
4 people authored Jul 4, 2024
1 parent 75c9621 commit 27bf8e6
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 63 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/issue_comment_edited.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-20.04

steps:
# - 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: 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
Expand All @@ -39,15 +39,15 @@ jobs:
run: python build_tools/pr_welcome_edited.py
env:
CONTEXT_GITHUB: ${{ toJson(github) }}
# GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
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 }}
token: ${{ steps.app-token.outputs.token }}

- if: ${{ steps.label_out.outputs.empty_commit == 'true' }}
name: Push empty commit
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
runs-on: ubuntu-20.04

steps:
# - 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: 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
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
# token: ${{ steps.app-token.outputs.token }}
token: ${{ steps.app-token.outputs.token }}

- name: Setup Python 3.10
uses: actions/setup-python@v5
Expand Down
7 changes: 4 additions & 3 deletions aeon/classification/deep_learning/_encoder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Encoder Classifier."""

__maintainer__ = []
__maintainer__ = ["hadifawaz1999"]
__all__ = ["EncoderClassifier"]

import gc
Expand Down Expand Up @@ -83,7 +83,7 @@ class EncoderClassifier(BaseDeepClassifier):
"""

_tags = {
"python_dependencies": ["tensorflow", "tensorflow_addons"],
"python_dependencies": ["tensorflow"],
}

def __init__(
Expand Down Expand Up @@ -255,7 +255,8 @@ def _fit(self, X, y):

try:
self.model_ = tf.keras.models.load_model(
self.file_path + self.file_name_ + ".keras", compile=False
self.file_path + self.file_name_ + ".keras",
compile=False,
)
if not self.save_best_model:
os.remove(self.file_path + self.file_name_ + ".keras")
Expand Down
1 change: 0 additions & 1 deletion aeon/classification/deep_learning/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class BaseDeepClassifier(BaseClassifier, ABC):
"non-deterministic": True,
"cant-pickle": True,
"python_dependencies": "tensorflow",
"python_version": "<3.12",
}

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.mark.skipif(
not _check_soft_dependencies(["tensorflow", "tensorflow_addons"], severity="none"),
not _check_soft_dependencies(["tensorflow"], severity="none"),
reason="skip test if required soft dependency not available",
)
def test_random_state_deep_learning_cls():
Expand Down
1 change: 0 additions & 1 deletion aeon/clustering/deep_learning/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class BaseDeepClusterer(BaseClusterer, ABC):
"non-deterministic": True,
"cant-pickle": True,
"python_dependencies": "tensorflow",
"python_version": "<3.12",
}

def __init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

from aeon.clustering import deep_learning
from aeon.testing.data_generation import make_example_3d_numpy
from aeon.utils.validation._dependencies import _check_soft_dependencies

__maintainer__ = ["hadifawaz1999"]


@pytest.mark.skipif(
not _check_soft_dependencies(["tensorflow", "tensorflow_addons"], severity="none"),
# not _check_soft_dependencies("tensorflow", severity="none"),
# See Issue #1761
True,
reason="skip test if required soft dependency not available",
)
def test_random_state_deep_learning_clr():
Expand Down
9 changes: 5 additions & 4 deletions aeon/networks/_encoder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Encoder Classifier."""

__maintainer__ = []
__maintainer__ = ["hadifawaz1999"]

from aeon.networks.base import BaseDeepLearningNetwork

Expand Down Expand Up @@ -88,7 +88,8 @@ def build_network(self, input_shape, **kwargs):
output_layer : a keras layer
"""
import tensorflow as tf
import tensorflow_addons as tfa

tf.keras.config.enable_unsafe_deserialization()

self._kernel_size = (
[5, 11, 21] if self.kernel_size is None else self.kernel_size
Expand All @@ -107,7 +108,7 @@ def build_network(self, input_shape, **kwargs):
strides=self.strides,
)(x)

conv = tfa.layers.InstanceNormalization()(conv)
conv = tf.keras.layers.GroupNormalization(groups=-1)(conv)
conv = tf.keras.layers.PReLU(shared_axes=[1])(conv)
conv = tf.keras.layers.Dropout(self.dropout_proba)(conv)

Expand Down Expand Up @@ -138,7 +139,7 @@ def build_network(self, input_shape, **kwargs):
hidden_fc_layer = tf.keras.layers.Dense(
units=self.fc_units, activation=self.activation
)(attention)
hidden_fc_layer = tfa.layers.InstanceNormalization()(hidden_fc_layer)
hidden_fc_layer = tf.keras.layers.GroupNormalization(groups=-1)(hidden_fc_layer)

# output layer before classification layer

Expand Down
2 changes: 1 addition & 1 deletion aeon/regression/deep_learning/_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class EncoderRegressor(BaseDeepRegressor):
"""

_tags = {
"python_dependencies": ["tensorflow", "tensorflow_addons"],
"python_dependencies": ["tensorflow"],
}

def __init__(
Expand Down
1 change: 0 additions & 1 deletion aeon/regression/deep_learning/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class BaseDeepRegressor(BaseRegressor, ABC):
"non-deterministic": True,
"cant-pickle": True,
"python_dependencies": "tensorflow",
"python_version": "<3.12",
}

def __init__(self, batch_size=40, last_file_name="last_model"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@pytest.mark.skipif(
not _check_soft_dependencies(["tensorflow", "tensorflow_addons"], severity="none"),
not _check_soft_dependencies(["tensorflow"], severity="none"),
reason="skip test if required soft dependency not available",
)
def test_random_state_deep_learning_rgs():
Expand Down
41 changes: 20 additions & 21 deletions aeon/testing/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,27 @@
import aeon.testing.utils._cicd_numba_caching # noqa: F401

EXCLUDE_ESTIMATORS = [
"_BoxCoxTransformer",
"TimeBinAggregate",
"PartialAutoCorrelationTransformer",
"_LogTransformer",
"ReverseAugmenter",
"RandomSamplesAugmenter",
"SqrtTransformer",
"_ColumnSelect",
"_IndexSubset",
"TimeSince",
"Differencer",
"CosineTransformer",
"_ThetaLinesTransformer",
"InvertAugmenter",
"TabularToSeriesAdaptor",
"PandasTransformAdaptor",
"BKFilter",
"AutoCorrelationTransformer",
"PCATransformer",
"EmpiricalCoverage",
"WhiteNoiseAugmenter",
"KalmanFilterTransformer",
"BaseKalmanFilter",
"ClearSky",
"TransformerPipeline",
"FeatureUnion",
"FitInTransform",
"MultiplexTransformer",
"InvertTransform",
"Id",
"OptionalPassthrough",
"ColumnwiseTransformer",
"ColumnConcatenator",
"YtoX",
"DateTimeFeatures",
"ExponentTransformer",
"FeatureSelection",
"FourierFeatures",
"Imputer",
"Lag",
"HampelFilter",
"WindowSummarizer",
] # Exclude deprecated estimators to reduce warnings

# the test currently fails when numba is disabled. See issue #622
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def test_channel_selectors(trans):
if issubclass(trans, BaseChannelSelector):
# Need fit for channel selection
# Must select at least one channel
X, y = make_example_3d_numpy(n_cases=10, n_channels=6, n_timepoints=30)
X, _ = make_example_3d_numpy(n_cases=20, n_channels=6, n_timepoints=30)
y = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1])
cs = trans()
assert not cs.get_tag("fit_is_empty")
cs.fit(X, y)
Expand Down
7 changes: 7 additions & 0 deletions aeon/transformations/scaledlogit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
from warnings import warn

import numpy as np
from deprecated.sphinx import deprecated

from aeon.transformations.base import BaseTransformer


# TODO: remove in v0.11.0
@deprecated(
version="0.10.0",
reason="ScaledLogitTransformer will be removed in version 0.11.0.",
category=FutureWarning,
)
class ScaledLogitTransformer(BaseTransformer):
r"""Scaled logit transform or Log transform.
Expand Down
1 change: 1 addition & 0 deletions aeon/utils/networks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Utils for tensorflow_addons."""
16 changes: 8 additions & 8 deletions build_tools/pr_welcome_edited.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
comment_user = context_dict["event"]["comment"]["user"]["login"]
labels = [label.name for label in issue.get_labels()]

# if (
# issue.pull_request is None
# or comment_user != "aeon-actions-bot[bot]"
# or "## Thank you for contributing to `aeon`" not in comment_body
# ):
# with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
# print("empty_commit=false", file=fh) # noqa: T201
# sys.exit(0)
if (
issue.pull_request is None
or comment_user != "aeon-actions-bot[bot]"
or "## Thank you for contributing to `aeon`" not in comment_body
):
with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
print("empty_commit=false", file=fh) # noqa: T201
sys.exit(0)
pr = issue.as_pull_request()


Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ all_extras = [
"ruptures>=1.1.9",
"tbats>=1.1.0",
"tensorflow>=2.12; python_version < '3.12'",
"tensorflow-addons; python_version < '3.12'",
"torch>=1.13.1",
"tsfresh>=0.20.0",
"tslearn>=0.5.2",
Expand All @@ -93,10 +92,9 @@ all_extras = [
]
dl = [
"keras-self-attention",
"tensorflow>=2.12; python_version < '3.12'",
"tensorflow-addons; python_version < '3.12'",
# dependency of tensorflow, see issue #1724
"keras<3.4",
"tensorflow>=2.12; python_version < '3.12'",
]
unstable_extras = [
"mrsqm>=0.0.1,<0.1.0; platform_system == 'Darwin' and python_version < '3.12'", # requires gcc and fftw to be installed for Windows and some other OS (see http://www.fftw.org/index.html)
Expand Down

0 comments on commit 27bf8e6

Please sign in to comment.