aequilibrae.project.data.result_record#

Classes

ResultRecord(data_set, project[, ...])

Class for handling records of results in the AequilibraE project database.

class aequilibrae.project.data.result_record.ResultRecord(data_set: dict, project, project_conn: Connection | None = None, results_conn: Connection | None = None)[source]#

Class for handling records of results in the AequilibraE project database.

This class provides methods to save, delete, and retrieve result records and their data.

Parameters:
  • **data_set** (dict) – Dictionary containing the result record data.

  • **project** – (Project): Project object this result record belongs to.

  • **project_conn** (:obj:`Optional[sqlite3.Connection]) – Connection to the project database. If None, the project’s connection will be used.

  • **results_conn** (Optional[sqlite3.Connection]) – Connection to the results database. If None, the project’s results connection will be used.

delete() None[source]#

Deletes this results record and the underlying data from disk.

Removes both the record from the project database and the data table from the results database.

get_data() DataFrame[source]#

Returns the results data for further computation.

Returns:

DataFrame containing the results data.

Return type:

df (pd.DataFrame)

save() None[source]#

Saves results record to the project database.

Creates a new record if it doesn’t exist or updates an existing one.

set_data(df: DataFrame, **kwargs) None[source]#

Set the results data corresponding to this record. Additionally saves this record.

Additional keyword arguments forwarded to the pd.DataFrame.to_sql method.

Parameters:

**df** (pd.DataFrame) – DataFrame object to save. Uses pd.DataFrame.to_sql.