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)¶
Create a new species.
- Parameters:
lower_bounds (
Sequence
ofint
orfloat
values) – Lower bound for each parameterupper_bounds (
Sequence
ofint
orfloat
values) – Upper bound for each parametertypes (
Sequence
oftype
(int
orfloat
), optional) – Type of each parameter. All the parameters will be treated asfloat
if omitted. Defaults toNone
names (
Sequence
ofstr
, optional) – Name of each parameter. Defaults toNone
- 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
str
ValueError – If there is any repeated name
Class methods¶
- classmethod Species.load_pickle(filename: str) Base ¶
Load a pickled object from 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
PICKLE_FILE_EXTENSION
Properties¶
Methods¶
- Species.save_pickle(filename: str) None ¶
Pickle 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
PICKLE_FILE_EXTENSION