culebra.solution.parameter_optimization.Species class¶
- class Species(lower_bounds: Sequence[int | float], upper_bounds: Sequence[int | float], types: Sequence[type[int] | type[float]] | None = None, names: Sequence[str] | None = None)¶
Bases:
SpeciesCreate a new species.
- Parameters:
lower_bounds (Sequence[int | float]) – Lower bound for each parameter
upper_bounds (Sequence[int | float]) – Upper bound for each parameter
types (Sequence[type]) – Type of each parameter. If omited, all the parameters will be treated as
float. Defaults toNonenames (Sequence[str]) – Name of each parameter. Defaults to
None
- Raises:
ValueError – If the sequences have different lengths
ValueError – If the sequences are empty
ValueError – If the type of any bound does not match with its corresponding type in types
ValueError – If any lower bound is greater to or equal than its corresponding upper bound
ValueError – If any name is not an instance of
strValueError – If there is any repeated name
Class methods¶
- classmethod Species.load(filename: str) Base¶
Load a serialized object from a file.
- Parameters:
filename (str) – The file name.
- Returns:
The loaded object
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
Properties¶
Methods¶
- Species.dump(filename: str) None¶
Serialize this object and save it to a file.
- Parameters:
filename (str) – The file name.
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION

