Skip to content

Table of Contents

t3co/input_data/scenario

Scenario Objects

Python
@dataclass
class Scenario()

Class object that contains all TCO parameters and performance target (range, grade, accel) information for a vehicle such that performance and TCO can be computed during optimization.

__new__

Python
def __new__(cls, *args, **kwargs)

Creates a new instance of the Scenario class.

from_file

Python
@classmethod
def from_file(
    cls,
    selection: int,
    scenario_file: Union[str, Path] = gl.RESOURCES_FOLDERPATH / "inputs" /
    "Demo_FY22_scenario_assumptions.csv"
) -> Self

Creates a Scenario instance from a CSV file.

Arguments:

  • selection int - The selection index to filter the scenario data.
  • scenario_file Union[str, Path] - Path to the scenario CSV file.

Returns:

  • Scenario - An instance of the Scenario class.

override_from_config

Python
def override_from_config(config: Config = None, verbose: bool = False) -> Self

Overrides certain scenario fields if use_config is True and config object is not None.

Arguments:

  • config Config, optional - Config object containing configuration data. Defaults to None.
  • verbose bool, optional - If True, prints the overridden fields. Defaults to False.

Raises:

  • Exception - If config file is not attached or scenario.use_config is set to False.

get_discounted_value

Python
def get_discounted_value(value: float, year_number: int) -> float

Calculates the discounted value for a given year.

Arguments:

  • value float - The value to be discounted.
  • year_number int - The year number for discounting.

Returns:

  • float - The discounted value.

delete_dataframes

Python
def delete_dataframes() -> None

Deletes DataFrame attributes from the Scenario instance.