Skip to content

Table of Contents

t3co.cli.sweep

load_vehicle_scenario_energy

Python
def load_vehicle_scenario_energy(
        selection: Union[int, str],
        config: Config,
        vehicle: Vehicle = None,
        scenario: Scenario = None,
        energy: Energy = None) -> Tuple[Vehicle, Scenario, Energy]

Loads the vehicle, scenario, and energy models based on the selection and config.

Arguments:

  • selection Union[int, str] - The selection index or string.
  • config Config - The configuration instance.

Returns:

Tuple[Vehicle, Scenario, Energy]: The vehicle, scenario, and energy models.

generate_ledger

Python
def generate_ledger(selection: int, config: Config) -> Dict

Generates the ledger for the given selection and config.

Arguments:

  • selection int - The selection index.
  • config Config - The configuration instance.

Returns:

  • Dict - The ledger as a dictionary.

create_results_filepath

Python
def create_results_filepath(config: Config) -> Path

Creates the results file path based on the config.

Arguments:

  • config Config - The configuration instance.

Returns:

  • Path - The path to the results file.

export_results_to_csv

Python
def export_results_to_csv(
    reports_list: List[Dict],
    config: Config,
    output_path: Union[str, Path] = None,
    return_filepath: bool = True,
    return_df: bool = False,
    sort_values: bool = False
) -> Tuple[Union[Path, None], Union[pd.DataFrame, None]]

Exports the results to a CSV file.

Arguments:

  • reports_list List[Dict] - The list of reports.
  • config Config - The configuration instance.
  • output_path Union[str, Path], optional - The output path for the CSV file. Defaults to None.
  • return_filepath bool, optional - Whether to return the file path. Defaults to True.
  • return_df bool, optional - Whether to return the DataFrame. Defaults to False.
  • sort_values bool, optional - Whether to sort the values by selection. Defaults to False.

Returns:

Tuple[Union[Path, None], Union[pd.DataFrame, None]]: The output path and DataFrame if specified.

run_t3co

Python
def run_t3co(config: Config, save_results: bool = True) -> None

Runs the T3CO analysis.

Arguments:

  • config Config - The configuration instance.
  • save_results bool, optional - Whether to save the results. Defaults to True.