From 4e0e5fca5099961af9b79ef4b6c796b653384c0e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 02:49:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Python/pywarpx/picmi.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index f1a8fde0dc8..8811541749b 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -687,6 +687,7 @@ def setup_parse_momentum_functions( f"({expression})/{constants.c}", ) + class UniformDistribution( picmistandard.PICMI_UniformDistribution, DensityDistributionBase ): @@ -702,8 +703,9 @@ def distribution_initialize_inputs( if density_scale is not None: species.add_new_group_attr(source_name, "density", density_scale) + class FluxDistributionBase(object): - """ This is a base class for both uniform and analytic flux distributions.""" + """This is a base class for both uniform and analytic flux distributions.""" def init(self, kw): self.inject_from_embedded_boundary = kw.pop( @@ -711,7 +713,7 @@ def init(self, kw): ) def initialize_flux_profile_func(self, species, density_scale, source_name): - """ Initialize the flux profile and flux function.""" + """Initialize the flux profile and flux function.""" pass def distribution_initialize_inputs( @@ -751,11 +753,13 @@ def distribution_initialize_inputs( source_name, "momentum_distribution_type", "gaussianflux" ) + class AnalyticFluxDistribution( - picmistandard.PICMI_AnalyticFluxDistribution, FluxDistributionBase, DensityDistributionBase + picmistandard.PICMI_AnalyticFluxDistribution, + FluxDistributionBase, + DensityDistributionBase, ): - def initialize_flux_profile_func(self, species, density_scale, source_name - ): + def initialize_flux_profile_func(self, species, density_scale, source_name): species.add_new_group_attr(source_name, "flux_profile", "parse_flux_function") if density_scale is not None: species.add_new_group_attr(source_name, "flux", density_scale) @@ -771,16 +775,19 @@ def initialize_flux_profile_func(self, species, density_scale, source_name "{}*({})".format(density_scale, expression), ) + class UniformFluxDistribution( - picmistandard.PICMI_UniformFluxDistribution, FluxDistributionBase, DensityDistributionBase + picmistandard.PICMI_UniformFluxDistribution, + FluxDistributionBase, + DensityDistributionBase, ): - def initialize_flux_profile_func(self, species, density_scale, source_name - ): + def initialize_flux_profile_func(self, species, density_scale, source_name): species.add_new_group_attr(source_name, "flux_profile", "constant") species.add_new_group_attr(source_name, "flux", self.flux) if density_scale is not None: species.add_new_group_attr(source_name, "flux", density_scale) + class AnalyticDistribution( picmistandard.PICMI_AnalyticDistribution, DensityDistributionBase ):