pisces.extensions.simulation.core.initial_conditions.InitialConditions.generate_particles#
- InitialConditions.generate_particles(model_name: str, num_particles: dict[str, int], overwrite: bool = False, **kwargs) None [source]#
Generate particles for a stored model using its internal particle generation method.
This method will load the model, verify that it implements a
generate_particles
method, and invoke it with the provided particle counts.- Parameters:
model_name (
str
) – The name/identifier of the model for which to generate particles.num_particles (
dict
ofstr
,int
) – Mapping of particle species names to the number of particles to generate for each.overwrite (
bool
) – IfTrue
, any existing particle file for this model will be overwritten. IfFalse
(default), an error will be raised if a particle file is already associated with the model.kwargs – Additional keyword arguments to pass to the model’s
generate_particles
method.
- Raises:
KeyError – If the specified model is not found in the initial conditions.
NotImplementedError – If the loaded model does not implement a
generate_particles
method.