ParameterHistory
- class glotaran.parameter.parameter_history.ParameterHistory[source]
Bases:
object
A class representing a history of parameters.
Attributes Summary
Return the number of records in the history.
Return the labels of the parameters in the history.
Return the parameters in the history.
Methods Summary
Append a
ParameterGroup
to the history.Create a history from a csv file.
Create a history from a pandas data frame.
Get parameters for a history index.
Create a history from a csv file.
Write a
ParameterGroup
to a CSV file.Create a data frame from the history.
Methods Documentation
- append(parameter_group: glotaran.parameter.parameter_group.ParameterGroup)[source]
Append a
ParameterGroup
to the history.- Parameters
parameter_group (ParameterGroup) – The group to append.
- Raises
ValueError – Raised if the parameter labels of the group differs from previous groups.
- classmethod from_csv(path: str) glotaran.parameter.parameter_history.ParameterHistory [source]
Create a history from a csv file.
- Parameters
path (str) – The path to the csv file.
- Returns
The created history.
- Return type
- classmethod from_dataframe(history_df: pandas.core.frame.DataFrame) glotaran.parameter.parameter_history.ParameterHistory [source]
Create a history from a pandas data frame.
- Parameters
history_df (pd.DataFrame) – The source data frame.
- Returns
The created history.
- Return type
- get_parameters(index: int) numpy.ndarray [source]
Get parameters for a history index.
- Parameters
index (int) – The history index.
- Returns
The parameter values at the history index as array.
- Return type
np.ndarray
- classmethod loader(path: str) glotaran.parameter.parameter_history.ParameterHistory
Create a history from a csv file.
- Parameters
path (str) – The path to the csv file.
- Returns
The created history.
- Return type
- property number_of_records: int
Return the number of records in the history.
- Returns
The number of records.
- Return type
- property parameters: list[np.ndarray]
Return the parameters in the history.
- Returns
A list of parameters in the history.
- Return type
list[np.ndarray]