diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index f41c910..0271615 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -15,10 +15,10 @@ jobs: - Windows - MacOs py: + - "3.11" - "3.10" - "3.9" - "3.8" - - "3.7" steps: - name: Setup python for test ${{ matrix.py }} uses: actions/setup-python@v3 diff --git a/realbook/layers/signal.py b/realbook/layers/signal.py index 9499423..aa7d69f 100644 --- a/realbook/layers/signal.py +++ b/realbook/layers/signal.py @@ -75,7 +75,7 @@ def __init__( name: Name of the layer. dtype: Type used in calcuation. """ - super().__init__(trainable=False, name=name, dtype=dtype, dynamic=False) + super().__init__(trainable=False, name=name, dtype=dtype) self.fft_length = fft_length self.window_length = window_length if window_length else self.fft_length self.hop_length = hop_length if hop_length else self.window_length // 4 @@ -171,7 +171,7 @@ def __init__( name: Name of the layer. dtype: Type used in calcuation. """ - super().__init__(trainable=False, name=name, dtype=dtype, dynamic=False) + super().__init__(trainable=False, name=name, dtype=dtype) # Because layer saves dtype as string??? self.dtypes_type = dtype diff --git a/setup.cfg b/setup.cfg index 67ad185..af71c08 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.2 +current_version = 1.0.3 commit = True tag = True @@ -22,20 +22,22 @@ classifiers = Operating System :: MacOS :: MacOS X Operating System :: Microsoft :: Windows Programming Language :: Python - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython [options] zip_safe = False packages = find: include_package_data = True +# Note we don't yet support TensorFlow 2.16 or later due to Keras 3, +# which does not support complex datatypes. install_requires = - tensorflow>=2.4; sys_platform != 'darwin' or platform.machine != 'arm64' - tensorflow-macos>=2.4; sys_platform == 'darwin' and platform.machine == 'arm64' - tensorboard + tensorflow>=2.4,<2.16; sys_platform != 'darwin' or platform.machine != 'arm64' + # TF 2.13 finally publishes ARM wheels: + tensorflow>=2.13,<2.16; sys_platform == 'darwin' and platform.machine == 'arm64' types-protobuf numpy typing_extensions @@ -48,7 +50,7 @@ tensorboard = matplotlib psutil nvsmi - librosa>=0.9,<0.10 + librosa>=0.9 test = coverage>=5.0.2 pytest>=7.1.1 @@ -57,10 +59,11 @@ test = tox torch nnaudio - numpy==1.21.6 - librosa>=0.9,<0.10 - tensorflow>=2.4,<2.11; sys_platform != 'darwin' or platform.machine != 'arm64' - tensorflow-macos>=2.4,<2.11; sys_platform == 'darwin' and platform.machine == 'arm64' + numpy>=1.22 + librosa>=0.9 + tensorflow>=2.4,<2.16; sys_platform != 'darwin' or platform.machine != 'arm64' + # TF 2.13 finally publishes ARM wheels: + tensorflow>=2.13,<2.16; sys_platform == 'darwin' and platform.machine == 'arm64' [bumpversion:file:realbook/__init__.py] diff --git a/tests/callbacks/test_debugging.py b/tests/callbacks/test_debugging.py index aa389a6..867b0c5 100644 --- a/tests/callbacks/test_debugging.py +++ b/tests/callbacks/test_debugging.py @@ -38,7 +38,7 @@ def generate_data() -> Iterator[Tuple[List[int], List[int]]]: ), ) - model = tf.keras.Sequential([tf.keras.Input(shape=(1)), tf.keras.layers.Dense(1)]) + model = tf.keras.Sequential([tf.keras.Input(shape=(1,)), tf.keras.layers.Dense(1)]) model.compile(loss="binary_crossentropy") model.fit(fake_data, steps_per_epoch=1, epochs=10, callbacks=[HangDebugCallback()]) @@ -70,7 +70,7 @@ def generate_data() -> Iterator[Tuple[List[int], List[int]]]: ), ) - model = tf.keras.Sequential([tf.keras.Input(shape=(1)), tf.keras.layers.Dense(1)]) + model = tf.keras.Sequential([tf.keras.Input(shape=(1,)), tf.keras.layers.Dense(1)]) model.compile(loss="binary_crossentropy") model.fit( fake_data, @@ -114,7 +114,7 @@ def generate_data() -> Iterator[Tuple[List[int], List[int]]]: ), ) - model = tf.keras.Sequential([tf.keras.Input(shape=(1)), tf.keras.layers.Dense(1)]) + model = tf.keras.Sequential([tf.keras.Input(shape=(1,)), tf.keras.layers.Dense(1)]) model.compile(loss="binary_crossentropy") model.fit( fake_data, diff --git a/tests/layers/test_nnaudio.py b/tests/layers/test_nnaudio.py index 8e0ce86..5331ef2 100644 --- a/tests/layers/test_nnaudio.py +++ b/tests/layers/test_nnaudio.py @@ -95,7 +95,7 @@ def test_cqt_trainable_layers_change_on_training(train: bool) -> None: model.compile(loss="mse") if train: - signal = librosa.chirp(32.70, TEST_SAMPLE_RATE, length=TEST_SAMPLE_RATE * 10, linear=True) + signal = librosa.chirp(fmin=32.70, fmax=TEST_SAMPLE_RATE, length=TEST_SAMPLE_RATE * 10, linear=True) noise = np.random.rand(*signal.shape).astype(signal.dtype) model.fit(np.array([signal, noise]), np.array([1, 0]), epochs=10, verbose=0)