Skip to content

Commit

Permalink
addressing pylint hints
Browse files Browse the repository at this point in the history
  • Loading branch information
slayoo committed Aug 1, 2024
1 parent d527536 commit 1267428
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 237 deletions.
5 changes: 4 additions & 1 deletion PySDM/backends/impl_numba/methods/seeding_methods.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
""" CPU implementation of backend methods for particle injections """

from functools import cached_property

import numba

from PySDM.backends.impl_common.backend_methods import BackendMethods


class SeedingMethods(BackendMethods):
class SeedingMethods(BackendMethods): # pylint: disable=too-few-public-methods
@cached_property
def _seeding(self):
@numba.njit(**{**self.default_jit_flags, "parallel": False})
Expand All @@ -30,6 +32,7 @@ def body(

def seeding(
self,
*,
idx,
multiplicity,
extensive_attributes,
Expand Down
9 changes: 8 additions & 1 deletion PySDM/dynamics/seeding.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
""" particle injection handling, requires initalising a simulation with
enough particles flagged with NaN multiplicity (translated to zeros
at multiplicity discretisation """


class Seeding:
def __init__(
self,
Expand All @@ -20,7 +25,9 @@ def __call__(self):
self.particulator.attributes.get_extensive_attribute_keys()
) != tuple(self.seeded_particle_extensive_attributes.keys()):
raise ValueError(
f"extensive attributes ({self.seeded_particle_extensive_attributes.keys()}) do not match those used in particulator ({self.particulator.attributes.get_extensive_attribute_keys()})"
f"extensive attributes ({self.seeded_particle_extensive_attributes.keys()})"
" do not match those used in particulator"
f" ({self.particulator.attributes.get_extensive_attribute_keys()})"
)

time = self.particulator.n_steps * self.particulator.dt
Expand Down
Loading

0 comments on commit 1267428

Please sign in to comment.