remove_species
Stable function · Editing
Tier: stable · Kind: function · Topic: Editing
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
remove_species | removeSpecies | remove_species, remove_species_from_system | remove_species | RemoveSpecies |
Note: spelling differs from the §2 rule: python=remove_species_from_system (expected remove_species); multiple spellings exported by: python
Julia
remove_species(system::ReactionSystem, name::String)
remove_species(system::ReactionSystem, name::String) -> ReactionSystem
Remove a species from a reaction system.
Warns about dependent reactions but does not automatically update them.
Throws EditError
if the species does not exist.
TypeScript
function removeSpecies(system: ReactionSystem, name: string): ReactionSystem
Remove a species from a reaction system, with reference checking
Parameters
system— ReactionSystem to remove species fromname— Species name to remove
Returns
New reaction system with species removed
Throws
- VariableInUseError if species is still referenced in reactions
- EntityNotFoundError if species doesn’t exist
Python
Exported as remove_species and remove_species_from_system. Both names refer to the same operation.
remove_species
remove_species(reaction_system: ReactionSystem, species_name: str, validate_after_edit: bool = True) -> EditResult
Remove a species from a reaction system.
remove_species_from_system
remove_species_from_system(reaction_system: ReactionSystem, species_name: str, validate_after_edit: bool = True) -> EditResult
Deprecated alias for remove_species
. Remove a species from a reaction system.
Rust
pub fn remove_species(system: &ReactionSystem, species_name: &str) -> EditResult<ReactionSystem>
Remove a species from a reaction system
Arguments
system- The reaction system to modifyspecies_name- Name of the species to remove
Returns
EditResult<ReactionSystem>- New reaction system without the species
Go
func RemoveSpecies(system ReactionSystem, name string) (ReactionSystem, error)
RemoveSpecies returns a copy of system without the species name, after checking that no reaction still references it.
Returns *EntityNotFoundError when the species does not exist, and *VariableInUseError when it appears among any reaction’s substrates or products, or is read by any reaction’s rate expression. Constraint equations are scanned too — they are ordinary expression sites over the same names.