diff --git a/src/core/lb/LBWalberla.cpp b/src/core/lb/LBWalberla.cpp index 9944d05408..af75a47a8e 100644 --- a/src/core/lb/LBWalberla.cpp +++ b/src/core/lb/LBWalberla.cpp @@ -106,7 +106,7 @@ void LBWalberla::veto_kT(double kT) const { auto const energy_conversion = Utils::int_pow<2>(lb_params->get_agrid() / lb_params->get_tau()); auto const lb_kT = lb_fluid->get_kT() * energy_conversion; - if (not ::Thermostat::are_kT_equal(lb_kT, kT)) { + if (not(::Thermostat::are_kT_equal(lb_kT, kT))) { throw std::runtime_error("Temperature change not supported by LB"); } } diff --git a/src/core/unit_tests/Verlet_list_test.cpp b/src/core/unit_tests/Verlet_list_test.cpp index 4be59cbbea..ae2bcdc1cb 100644 --- a/src/core/unit_tests/Verlet_list_test.cpp +++ b/src/core/unit_tests/Verlet_list_test.cpp @@ -77,8 +77,8 @@ struct IntegratorHelper : public ParticleFactory { /** Set particle to move along the x-axis. */ virtual void set_particle_properties(int) const = 0; virtual char const *name() const = 0; - friend auto operator<<(std::ostream &os, - IntegratorHelper const &obj) -> std::ostream & { + friend auto operator<<(std::ostream &os, IntegratorHelper const &obj) + -> std::ostream & { return os << obj.name(); } }; diff --git a/src/python/espressomd/code_features.py b/src/python/espressomd/code_features.py index 1172d81d9e..86338029e2 100644 --- a/src/python/espressomd/code_features.py +++ b/src/python/espressomd/code_features.py @@ -18,9 +18,6 @@ # along with this program. If not, see . # -from . import code_info -from . import utils - class FeaturesError(Exception): @@ -33,6 +30,8 @@ def has_features(*args): Check whether a list of features is a subset of the compiled-in features. """ + from . import code_info + from . import utils lvl = utils.nesting_level(args) assert lvl in [1, 2], "has_features() takes strings as argument" if lvl == 2: @@ -53,6 +52,8 @@ def missing_features(*args): Return a list of the missing features in the arguments. """ + from . import code_info + from . import utils lvl = utils.nesting_level(args) assert lvl in [1, 2], "missing_features() takes strings as argument" if lvl == 2: diff --git a/src/utils/include/utils/mask.hpp b/src/utils/include/utils/mask.hpp index 954c517ea9..39ee422e9d 100644 --- a/src/utils/include/utils/mask.hpp +++ b/src/utils/include/utils/mask.hpp @@ -54,11 +54,11 @@ auto mask_impl(Integral mask, T t, std::index_sequence) { * @return t partially zeroed out according to mask */ template -auto mask(Integral mask, - T t) -> std::enable_if_t && - (size_in_bits::value >= - tuple_size::value), - T> { +auto mask(Integral mask, T t) + -> std::enable_if_t && + (size_in_bits::value >= + tuple_size::value), + T> { return detail::mask_impl(mask, t, std::make_index_sequence::value>{}); } diff --git a/src/utils/include/utils/math/bspline.hpp b/src/utils/include/utils/math/bspline.hpp index 37a5ef45c0..5e3418f1d6 100644 --- a/src/utils/include/utils/math/bspline.hpp +++ b/src/utils/include/utils/math/bspline.hpp @@ -28,8 +28,8 @@ namespace Utils { /** @brief Formula of the B-spline. */ template -DEVICE_QUALIFIER auto -bspline(int i, T x) -> std::enable_if_t<(order > 0) && (order <= 7), T> { +DEVICE_QUALIFIER auto bspline(int i, T x) + -> std::enable_if_t<(order > 0) && (order <= 7), T> { DEVICE_ASSERT(i < order); DEVICE_ASSERT(x >= T(-0.5)); DEVICE_ASSERT(x <= T(0.5)); @@ -206,8 +206,8 @@ template auto bspline(int i, T x, int k) { /** @brief Derivative of the B-spline. */ template -DEVICE_QUALIFIER auto -bspline_d(int i, T x) -> std::enable_if_t<(order > 0) && (order <= 7), T> { +DEVICE_QUALIFIER auto bspline_d(int i, T x) + -> std::enable_if_t<(order > 0) && (order <= 7), T> { DEVICE_ASSERT(i < order); DEVICE_ASSERT(x >= T(-0.5)); DEVICE_ASSERT(x <= T(0.5)); diff --git a/src/utils/include/utils/serialization/memcpy_archive.hpp b/src/utils/include/utils/serialization/memcpy_archive.hpp index 5cfc0e90ca..b301c9feab 100644 --- a/src/utils/include/utils/serialization/memcpy_archive.hpp +++ b/src/utils/include/utils/serialization/memcpy_archive.hpp @@ -123,14 +123,14 @@ template class BasicMemcpyArchive { public: template - auto - operator>>(T &value) -> std::enable_if_t::value> { + auto operator>>(T &value) + -> std::enable_if_t::value> { process(value); } template - auto - operator<<(T &value) -> std::enable_if_t::value> { + auto operator<<(T &value) + -> std::enable_if_t::value> { process(value); } diff --git a/src/utils/tests/Vector_test.cpp b/src/utils/tests/Vector_test.cpp index 64463077fd..0835a3e204 100644 --- a/src/utils/tests/Vector_test.cpp +++ b/src/utils/tests/Vector_test.cpp @@ -44,8 +44,7 @@ using Utils::Vector; /* Number of nontrivial Baxter permutations of length 2n-1. (A001185) */ -#define TEST_NUMBERS \ - { 0, 1, 1, 7, 21, 112, 456, 2603, 13203 } +#define TEST_NUMBERS {0, 1, 1, 7, 21, 112, 456, 2603, 13203} constexpr int test_numbers[] = TEST_NUMBERS; constexpr std::size_t n_test_numbers = sizeof(test_numbers) / sizeof(int); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.h index 0d8a012197..71db1b93dc 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_double_precision.h @@ -116,7 +116,7 @@ class ReactionKernelIndexed_1_double_precision { double rate_coefficient, double stoech_0) : indexVectorID(indexVectorID_), rho_0ID(rho_0ID_), order_0_(order_0), - rate_coefficient_(rate_coefficient), stoech_0_(stoech_0){}; + rate_coefficient_(rate_coefficient), stoech_0_(stoech_0) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.h index 72a1643998..e6915cd6e4 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_1_single_precision.h @@ -116,7 +116,7 @@ class ReactionKernelIndexed_1_single_precision { float rate_coefficient, float stoech_0) : indexVectorID(indexVectorID_), rho_0ID(rho_0ID_), order_0_(order_0), - rate_coefficient_(rate_coefficient), stoech_0_(stoech_0){}; + rate_coefficient_(rate_coefficient), stoech_0_(stoech_0) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.h index fff5a79f44..8690680c69 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_double_precision.h @@ -121,7 +121,7 @@ class ReactionKernelIndexed_2_double_precision { : indexVectorID(indexVectorID_), rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), order_0_(order_0), order_1_(order_1), rate_coefficient_(rate_coefficient), stoech_0_(stoech_0), - stoech_1_(stoech_1){}; + stoech_1_(stoech_1) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.h index 621e74d830..8c4ce9f3f9 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_2_single_precision.h @@ -121,7 +121,7 @@ class ReactionKernelIndexed_2_single_precision { : indexVectorID(indexVectorID_), rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), order_0_(order_0), order_1_(order_1), rate_coefficient_(rate_coefficient), stoech_0_(stoech_0), - stoech_1_(stoech_1){}; + stoech_1_(stoech_1) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.h index 585db2e3ab..9fd31104db 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_double_precision.h @@ -122,7 +122,7 @@ class ReactionKernelIndexed_3_double_precision { : indexVectorID(indexVectorID_), rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), rho_2ID(rho_2ID_), order_0_(order_0), order_1_(order_1), order_2_(order_2), rate_coefficient_(rate_coefficient), - stoech_0_(stoech_0), stoech_1_(stoech_1), stoech_2_(stoech_2){}; + stoech_0_(stoech_0), stoech_1_(stoech_1), stoech_2_(stoech_2) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.h index 80524cc1d7..af6c3969b2 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_3_single_precision.h @@ -121,7 +121,7 @@ class ReactionKernelIndexed_3_single_precision { : indexVectorID(indexVectorID_), rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), rho_2ID(rho_2ID_), order_0_(order_0), order_1_(order_1), order_2_(order_2), rate_coefficient_(rate_coefficient), - stoech_0_(stoech_0), stoech_1_(stoech_1), stoech_2_(stoech_2){}; + stoech_0_(stoech_0), stoech_1_(stoech_1), stoech_2_(stoech_2) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.h index a1af22d1a0..3a37a60b5d 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_double_precision.h @@ -125,7 +125,7 @@ class ReactionKernelIndexed_4_double_precision { rho_2ID(rho_2ID_), rho_3ID(rho_3ID_), order_0_(order_0), order_1_(order_1), order_2_(order_2), order_3_(order_3), rate_coefficient_(rate_coefficient), stoech_0_(stoech_0), - stoech_1_(stoech_1), stoech_2_(stoech_2), stoech_3_(stoech_3){}; + stoech_1_(stoech_1), stoech_2_(stoech_2), stoech_3_(stoech_3) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.h index 654ba307cc..ef5e37e659 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_4_single_precision.h @@ -125,7 +125,7 @@ class ReactionKernelIndexed_4_single_precision { rho_2ID(rho_2ID_), rho_3ID(rho_3ID_), order_0_(order_0), order_1_(order_1), order_2_(order_2), order_3_(order_3), rate_coefficient_(rate_coefficient), stoech_0_(stoech_0), - stoech_1_(stoech_1), stoech_2_(stoech_2), stoech_3_(stoech_3){}; + stoech_1_(stoech_1), stoech_2_(stoech_2), stoech_3_(stoech_3) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.h index 368e91fac3..4f1224488a 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_double_precision.h @@ -130,7 +130,7 @@ class ReactionKernelIndexed_5_double_precision { order_3_(order_3), order_4_(order_4), rate_coefficient_(rate_coefficient), stoech_0_(stoech_0), stoech_1_(stoech_1), stoech_2_(stoech_2), stoech_3_(stoech_3), - stoech_4_(stoech_4){}; + stoech_4_(stoech_4) {} void run(IBlock *block); diff --git a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.h b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.h index 7404fc8d96..e97de963d3 100644 --- a/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.h +++ b/src/walberla_bridge/src/electrokinetics/reactions/generated_kernels/ReactionKernelIndexed_5_single_precision.h @@ -130,7 +130,7 @@ class ReactionKernelIndexed_5_single_precision { order_3_(order_3), order_4_(order_4), rate_coefficient_(rate_coefficient), stoech_0_(stoech_0), stoech_1_(stoech_1), stoech_2_(stoech_2), stoech_3_(stoech_3), - stoech_4_(stoech_4){}; + stoech_4_(stoech_4) {} void run(IBlock *block); diff --git a/testsuite/python/constant_pH.py b/testsuite/python/constant_pH.py index 177079541d..afbbf692d6 100644 --- a/testsuite/python/constant_pH.py +++ b/testsuite/python/constant_pH.py @@ -17,7 +17,6 @@ # along with this program. If not, see . # -# pylint: disable=cyclic-import import unittest as ut import numpy as np import espressomd diff --git a/testsuite/python/ek_interface.py b/testsuite/python/ek_interface.py index 2c9ea16b99..c7e670c2a8 100644 --- a/testsuite/python/ek_interface.py +++ b/testsuite/python/ek_interface.py @@ -385,7 +385,8 @@ def test_ek_bulk_reactions(self): def test_raise_if_read_only(self): ek_species = self.make_default_ek_species() - for key in {"lattice", "shape", "single_precision", "seed", "thermalized"}: + for key in {"lattice", "shape", + "single_precision", "seed", "thermalized"}: with self.assertRaisesRegex(RuntimeError, f"(Parameter|Property) '{key}' is read-only"): setattr(ek_species, key, 0) diff --git a/testsuite/python/ibm.py b/testsuite/python/ibm.py index 887adba31e..b07fd8e5ad 100644 --- a/testsuite/python/ibm.py +++ b/testsuite/python/ibm.py @@ -258,7 +258,8 @@ def test_tribend_checkpointing(self): system.bonded_inter.add(tribend_original) system.bonded_inter.add(tribend_unpickled) tribend_skip_init = pickle.loads(pickle.dumps(tribend_original)) - for tribend in [tribend_original, tribend_unpickled, tribend_skip_init]: + for tribend in [tribend_original, + tribend_unpickled, tribend_skip_init]: self.assertTrue(tribend.is_initialized) self.assertAlmostEqual(tribend.theta0, theta0, delta=1e-6) self.assertEqual(tribend.ind1, p1.id) diff --git a/testsuite/python/lb_lees_edwards_particle_coupling.py b/testsuite/python/lb_lees_edwards_particle_coupling.py index c407cdbb9b..d4f091024b 100644 --- a/testsuite/python/lb_lees_edwards_particle_coupling.py +++ b/testsuite/python/lb_lees_edwards_particle_coupling.py @@ -204,7 +204,8 @@ def test_viscous_coupling_with_offset(self): np.testing.assert_allclose( np.copy(n.last_applied_force), -w * np.copy(p.f)) - def check_velocity_interpolation(self, pos_offset, shear_vel, test_positions): + def check_velocity_interpolation( + self, pos_offset, shear_vel, test_positions): system.lb = None system.part.clear() system.time_step = 1 diff --git a/testsuite/python/mpiio.py b/testsuite/python/mpiio.py index 1aedf7e51e..3988c798cd 100644 --- a/testsuite/python/mpiio.py +++ b/testsuite/python/mpiio.py @@ -70,7 +70,7 @@ def get_random_mock_particles(): p1 = randint_different_from(0, npart, i) p2 = randint_different_from(0, npart, i) - # Don't add the same bond twice and don't use the same particle twice + # avoid adding the same bond twice or using the same particle twice if p1 != p2 and (btype, p1, p2) not in p.bonds: p.bonds.append((btype, p1, p2)) parts.append(p)