Skip to content

Commit

Permalink
Updates for pylint 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
drasmuss committed Jun 18, 2024
1 parent 7264265 commit d453de7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion keras_lmu/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,8 @@ def call(self, inputs, training=False):

if self.conv_mode == "fft":
m = self._fft_convolution(u)
elif self.conv_mode == "raw":
else:
assert self.conv_mode == "raw"
m = self._raw_convolution(u)

# apply hidden cell
Expand Down
3 changes: 2 additions & 1 deletion keras_lmu/tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def test_performance(mode, min_time, max_time):
layers.LMUCell(**kwargs),
return_sequences=False,
)
elif mode in ("fft", "raw"):
else:
assert mode in ["fft", "raw"]
lmu_layer = layers.LMUFeedforward(
return_sequences=False, conv_mode=mode, **kwargs
)
Expand Down
6 changes: 4 additions & 2 deletions keras_lmu/tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ def test_save_load_serialization(mode, tmp_path, trainable_theta, discretizer):
trainable_theta=trainable_theta,
discretizer=discretizer,
)(inp)
elif mode == "feedforward":
else:
assert mode == "feedforward"
out = layers.LMUFeedforward(
1,
2,
Expand Down Expand Up @@ -663,7 +664,8 @@ def test_theta_attribute(mode):
layer = layers.LMUCell(1, 2, theta, None, trainable_theta=True)
elif mode == "rnn":
layer = layers.LMU(1, 2, theta, None, trainable_theta=True)
elif mode == "feedforward":
else:
assert mode == "feedforward"
layer = layers.LMU(1, 2, theta, None, trainable_theta=False)

assert not layer.built
Expand Down

0 comments on commit d453de7

Please sign in to comment.