From ce7d227ae74622fe5e462fa8ab068fe20be3a440 Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Sun, 4 Jun 2023 16:18:19 +0200 Subject: [PATCH] Fix changes linter --- doc/conf.py | 2 +- lbmpy/chapman_enskog/chapman_enskog.py | 2 +- lbmpy/moment_transforms/cumulanttransforms.py | 4 ++-- lbmpy/moments.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 1711bdf8..bdac10e5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -33,7 +33,7 @@ version = re.sub(r'(\d+\.\d+)\.\d+(.*)', r'\1\2', lbmpy.__version__) version = re.sub(r'(\.dev\d+).*?$', r'\1', version) # The full version, including alpha/beta/rc tags. release = lbmpy.__version__ -language = None +language = 'en' exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints'] default_role = 'any' pygments_style = 'sphinx' diff --git a/lbmpy/chapman_enskog/chapman_enskog.py b/lbmpy/chapman_enskog/chapman_enskog.py index c337a36f..93d7b7c0 100644 --- a/lbmpy/chapman_enskog/chapman_enskog.py +++ b/lbmpy/chapman_enskog/chapman_enskog.py @@ -370,7 +370,7 @@ def take_moments(eqn, pdf_to_moment_name=(('f', '\\Pi'), ('\\Omega f', '\\Upsilo if new_f_index is None: rest *= factor else: - assert not(new_f_index and f_index) + assert not (new_f_index and f_index) f_index = new_f_index moment_tuple = [0] * len(velocity_terms) diff --git a/lbmpy/moment_transforms/cumulanttransforms.py b/lbmpy/moment_transforms/cumulanttransforms.py index 692aee72..eca4ed97 100644 --- a/lbmpy/moment_transforms/cumulanttransforms.py +++ b/lbmpy/moment_transforms/cumulanttransforms.py @@ -67,10 +67,10 @@ class CentralMomentsToCumulantsByGeneratingFunc(AbstractMomentTransform): self.cumulant_exponents = self.moment_exponents self.cumulant_polynomials = self.moment_polynomials - if(len(self.cumulant_exponents) != stencil.Q): + if len(self.cumulant_exponents) != stencil.Q: raise ValueError("Number of cumulant exponent tuples must match stencil size.") - if(len(self.cumulant_polynomials) != stencil.Q): + if len(self.cumulant_polynomials) != stencil.Q: raise ValueError("Number of cumulant polynomials must match stencil size.") self.central_moment_exponents = self.compute_required_central_moments() diff --git a/lbmpy/moments.py b/lbmpy/moments.py index 4b312d28..66f0fcb5 100644 --- a/lbmpy/moments.py +++ b/lbmpy/moments.py @@ -86,8 +86,8 @@ def moment_permutations(exponent_tuple): def moments_of_order(order, dim=3, include_permutations=True): """All tuples of length 'dim' which sum equals 'order'""" for item in __fixed_sum_tuples(dim, order, ordered=not include_permutations): - assert(len(item) == dim) - assert(sum(item) == order) + assert len(item) == dim + assert sum(item) == order yield item -- GitLab