flexops.costing.load_tariff¶
- flexops.costing.load_tariff(source: str | Path | dict | list | DataFrame) DataFrame¶
Return an EECO tariff object (a
rate_dataDataFrame) fromsource.sourceis what aCostingConfig.tariff_sourcestring resolves to: a JSON or CSV file path, an in-memory dict/records structure, or an already built rate_dataDataFrame(passed through after validation). A.csvpath is routed throughtariff_csv_to_dict()first. EECO 0.4.2 has no tariff loader of its own — its cost functions consume arate_dataDataFrame directly — so that DataFrame is the EECO tariff object here.- Parameters:
source – Tariff source: a JSON/CSV path, a dict/records structure, or a rate_data DataFrame.
- Returns:
The validated EECO
rate_dataDataFrame.- Raises:
FlexDataError – If the file/structure is malformed or missing required columns; the message names the file and the offending field.