Table of Contents¶
t3co/tco/ledger¶
Ledger Objects¶
__new__¶
Creates a new instance of the Ledger class.
__init__¶
Python
def __init__(vehicle: Vehicle,
             scenario: Scenario,
             energy: Energy = None,
             config: Config = None)
Initializes the Ledger instance.
Arguments:
vehicleVehicle - The vehicle instance.scenarioScenario - The scenario instance.energyEnergy, optional - The energy instance. Defaults to None.configConfig, optional - The configuration instance. Defaults to None.
set_discounted_costs¶
Sets the discounted cost components for the Ledger instance.
set_discounted_tco¶
Sets the discounted TCO for the Ledger instance.
set_cost_components¶
Sets the cost components for the Ledger instance.
to_dict¶
Exports the Ledger instance to a dictionary.
Arguments:
include_prefixbool, optional - If True, exported column names contain the T3CO submodule names as prefix. Defaults to True.flattenbool, optional - If True, the nested dict output flattens to a single dictionary. Defaults to True.
Returns:
dict- The Ledger instance as a dictionary.
to_json¶
Python
def to_json(filepath: Union[str, Path],
            include_prefix: bool = True,
            flatten: bool = True) -> None
Saves the Ledger instance to a JSON file.
Arguments:
filepathUnion[str, Path] - The file path where the JSON will be saved.include_prefixbool, optional - If True, exported column names contain the T3CO submodule names as prefix. Defaults to True.flattenbool, optional - If True, the nested dict output flattens to a single dictionary. Defaults to True.
to_df¶
Converts the Ledger instance to a DataFrame.
Returns:
pd.DataFrame- The Ledger instance as a DataFrame.
to_csv¶
Saves the Ledger instance to a CSV file.
Arguments:
filepathUnion[str, Path] - The file path where the CSV will be saved.
__str__¶
Returns a string representation of the Ledger instance.
Returns:
str- String representation of the Ledger instance.