pisces.extensions.simulation.core.initial_conditions.InitialConditions.remove_particles_from_model#

InitialConditions.remove_particles_from_model(model_name: str, delete_particle_file: bool = True)[source]#

Detach and optionally delete the particle dataset associated with a specific model.

This method:

  1. Validates that the target model exists in the configuration.

  2. Checks if a particle file is associated with the model.

  3. Optionally deletes the particle file from disk.

  4. Updates the configuration to remove the particle file reference.

Parameters:
  • model_name (str) – The name/identifier of the model from which to remove particles.

  • delete_particle_file (bool, optional) – If True (default), the particle file will be deleted from disk. If False, only the reference in the configuration will be removed.

Raises:
  • KeyError – If no model with the given model_name exists in the configuration.

  • ValueError – If no particles are associated with the specified model.