diff --git a/src/pyrecest/_backend/pytorch/__init__.py b/src/pyrecest/_backend/pytorch/__init__.py index 79eaf8364..33b226285 100644 --- a/src/pyrecest/_backend/pytorch/__init__.py +++ b/src/pyrecest/_backend/pytorch/__init__.py @@ -775,9 +775,7 @@ def assignment(x, values, indices, axis=0): x_new[indices] = values return x_new zip_indices = ( - _is_iterable(indices) - and len(indices) > 0 - and _is_iterable(indices[0]) + _is_iterable(indices) and len(indices) > 0 and _is_iterable(indices[0]) ) len_indices = _assignment_index_length(indices, zip_indices) if zip_indices: @@ -832,9 +830,7 @@ def assignment_by_sum(x, values, indices, axis=0): x_new[indices] += values return x_new zip_indices = ( - _is_iterable(indices) - and len(indices) > 0 - and _is_iterable(indices[0]) + _is_iterable(indices) and len(indices) > 0 and _is_iterable(indices[0]) ) len_indices = _assignment_index_length(indices, zip_indices) if zip_indices: diff --git a/src/pyrecest/_backend/pytorch/random.py b/src/pyrecest/_backend/pytorch/random.py index 081b3a432..5c39c04ca 100644 --- a/src/pyrecest/_backend/pytorch/random.py +++ b/src/pyrecest/_backend/pytorch/random.py @@ -115,4 +115,4 @@ def multivariate_normal(mean, cov, size=None): size = () elif not hasattr(size, "__iter__"): size = (size,) - return _MultivariateNormal(mean, cov).sample(size) \ No newline at end of file + return _MultivariateNormal(mean, cov).sample(size) diff --git a/src/pyrecest/utils/association_models.py b/src/pyrecest/utils/association_models.py index 168d0bc35..2567b5ea5 100644 --- a/src/pyrecest/utils/association_models.py +++ b/src/pyrecest/utils/association_models.py @@ -453,4 +453,4 @@ def pairwise_cost_matrix( return -log(probabilities) if mode == "one_minus_probability": return 1.0 - probabilities - raise ValueError(f"Unsupported cost mode: {mode}") \ No newline at end of file + raise ValueError(f"Unsupported cost mode: {mode}") diff --git a/tests/backend_support/test_random_uniform_contract.py b/tests/backend_support/test_random_uniform_contract.py index 85d7834c6..84e33013e 100644 --- a/tests/backend_support/test_random_uniform_contract.py +++ b/tests/backend_support/test_random_uniform_contract.py @@ -5,10 +5,8 @@ import importlib.util import pytest - from tests.support.backend_runner import run_backend_code - _UNIFORM_ARRAY_BOUNDS_CHECK = """ import pyrecest.backend as backend from pyrecest.backend import random diff --git a/tests/test_association_models.py b/tests/test_association_models.py index bd01cfb2e..5f76afedb 100644 --- a/tests/test_association_models.py +++ b/tests/test_association_models.py @@ -226,4 +226,4 @@ def test_calibrated_pairwise_association_model_uses_named_components(self): if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main() diff --git a/tests/test_backend_random.py b/tests/test_backend_random.py index 22a0abf3a..880911d32 100644 --- a/tests/test_backend_random.py +++ b/tests/test_backend_random.py @@ -75,4 +75,4 @@ def test_jax_multinomial_uses_and_advances_global_state(self): if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main()