Bases: object
Support for tariffs engine.
Basic usage:
1import iesve
2
3strProjectFolder = 'C:\MyProject'
4strAPSFile = 'C:\MyProject\vista\a_tariff analysis.aps'
5strAPSComparisonFiles = 'C:\MyProject\vista\prb.aps'
6strInfoMessage = iesve.TariffsEngine.String()
7strError = iesve.TariffsEngine.String()
8
9eUnitsSystem = iesve.TariffsEngine.EUnitsSystem.UNITS_SYSTEM_METRIC # (default)
10 # iesve.TariffsEngine.EUnitsSystem.UNITS_SYSTEM_IP
11
12eMode = iesve.TariffsEngine.EModes.MODE_NORMAL # (default)
13 # iesve.TariffsEngine.EModes.MODE_UPDATE_XML_FILE_TARIFFS_NODE
14 # iesve.TariffsEngine.EModes.MODE_CHECK_UTILITIES_VARIABLES
15
16eComputeCosts = iesve.TariffsEngine.EComputeCosts.COMPUTE_COSTS_NO
17 # iesve.TariffsEngine.EComputeCosts.COMPUTE_COSTS_YES
18
19te = iesve.TariffsEngine(strProjectFolder, strAPSFile, strAPSComparisonFiles,
20 strInfoMessage, strError, eUnitsSystem, eMode, eComputeCosts)
21
22if (strError.Empty() == False):
23 print(strError.GetString())
24else:
25 print("Init ok")
26
27if (strInfoMessage.Empty() == False):
28 print(strInfoMessage.GetString())
Bases: IntEnum
Tariff Engine enum.
Bases: IntEnum
Tariff Engine enum.
Bases: IntEnum
Tariff Engine enum.
Bases: IntEnum
Tariff Engine enum.
Bases: IntEnum
Tariff Engine enum.
Bases: object
Accepts changes done. It will save the results, selected tariffs etc.
Error message if any
str
Computes the utility’s costs using the flat rate.
iUtilityId (int) – iesve.TariffsEngine.EUtilities value.
dbFlatRate (float, Optional) – flat rate to use. If <0, the current utility’s flat rate will be used. Defaults to -1.0.
Computes the utility iUtilityId using supplier iSupplierId and tariff iTariffId.
iUtilityId (int) – iesve.TariffsEngine.EUtilities value.
iSupplierId (int) – Supplier id to be set. If not found, an exception is thrown.
iTariffId (int) – Tariff id to be set. If not found or doesn’t belong to iSupplierId, an exception is thrown.
Returns the benchmark cost for a utility or total.
iUtilityId (int, Optional) – iesve.TariffsEngine.EUtilities value. If -1,
the total cost of all of the utilities summed up will
be returned
benchmark total cost.
float
Returns the design cost for a utility or total.
iUtilityId (int, Optional) – iesve.TariffsEngine.EUtilities value. If -1,
the total cost of all of the utilities summed up will
be returned.
design total cost.
float
Returns the cost of an individual end use.
eFile (int) – 0 if design, 1 if benchmark
iUtilityId (int) – iesve.TariffsEngine.EUtilities value.
eVar (EnergyUse) – The end use to obtain data for.
cost of an individual end use
float
Returns the cost of multiple end uses
eFile (int) – 0 if design, 1 if benchmark
iUtilityId (int) – iesve.TariffsEngine.EUtilities value.
endUseList (list[EnergyUse]) – List of end uses to obtain data for.
adjFactor (float, Optional) –
Adjustment Factor to increase electrical usage
values prior to costing. e.g. transformer losses(see
iesve.TransformerLosses.get_adjustment_factor())
Defaults to 1.0.
costs for each end uses.
dict[EnergyUse, float]
Code Sample:
cost = te.GetEndUseCosts(0, iesve.TariffsEngine.EUtilities.ELECTRICITY,
[iesve.EnergyUse.prm_interior_lighting, iesve.EnergyUse.prm_space_heating]
)
Returns a numpy object with the rates applied per time gap from iFirstDay to iLastDay for utility iUtility, that has previously been computed.
iUtility (int) – _description_
iFirstDay (int, Optional) –
First day whose rates per time gap will be stored: 1,… 365, 366… If -1, it will be taken from the APS.
iFirstDay<=iLastDay.
Defaults to -1
iLastDay (int, Optional) –
Last day whose rates per time gap will be stored: 1,… 365, 366… If -1, it will be taken from the APS.
iFirstDay<=iLastDay.
Defaults to -1.
numpy object the proposed demand cost per time gap.
Gets a tuple with the selected currency data.
i.e: ['Polish zloty', 'PLN', 'Poland', 'PLN']
tuple[str, str, str, str]
Gets a tuples list with the suppliers belonging to a utility.
iUtilityId (int) – iesve.TariffsEngine.EUtilities value. If -1,
the total cost of all of the utilities summed up will
be returned.
utility iUtilityId. Each tuple has utility name and id, that can be used for other functions. i.e:
[
('Electricity Commercial Supplier', 1),
('Electricity Domestic Supplier', 4)
]
list[tuple[str, int]]
Returns a text with the symbol of the selected currency divided by the unit of the tariff whose id is iTariffId. I.e: $/T.
iUtilityId (int) – iesve.TariffsEngine.EUtilities value.
Neither miscellaneous nor renewables are possible.
iTariffId (int) – Tariff’s id
by the unit of the tariff whose id is iTariffId. I.e: $/T
str
Basic Usage:
te = iesve.TariffsEngine(...)
currencyUnits = te.GetTariffCurrencyUnits(iesve.TariffsEngine.EUtilities.ELECTRICITY, 4)
print(currencyUnits)
Retrieves the name of the tariff whose id is iTariffId and belongs to the utility iUtilityId
iUtilityId (int) – iesve.TariffsEngine.EUtilities value.
Neither miscellaneous nor renewables are possible.
iTariffId (int) – Tariff’s id to check
tariff name or “” if not found
str
Gets a tuple with the tariffs belonging to a supplier and, optionally, a currency.
iSupplierId (int) – Supplier id whose tariffs will be retrieved.
strCurrencyId (str, Optional) – Currency id the tariffs will have to have in order to be retrieved. If “”, no currency checking will be carried out. Default “”
strSupplierId and using the currency if specified. i.e:
[
("Unrestricted Tariff (£ GBP)", 12),
("Two Rate Tariff (£ GBP)", 13),
("Economy-7 Tariff (£ GBP)", 21),
("Unrestricted Tariff ($ USD)", 23),
("Two Rate Tariff ($ USD)", 24),
("Economy-7 Tariff ($ USD)", 28),
]
list[tuple[str, int]]
Gets a list of tuples with the utilities names and its ids.
[‘Gas’, 1], [‘Oil’, 2], [‘Coal’, 3], [‘Miscellaneous’, 4], [‘Renewables’, 5]]
(list[tuple[str, int]])
Init the tariffs engine. See iesve.TariffsEngine for usage example
pcProjectFolder (str) – MIT project folder ending by ‘/’ or not. I.e: C://My project//
pcAPSFile (str) – APS file with path. I.e: C://My project//vista//test.aps
pcAPSComparisonFiles (str) –
3 options:
Files separated by ? that will be stored for comparing. I.e : File1 ? File2 ? File3
Empty string. Comparison files will be cleared so no files will be used to compare to.
nullptr. Comparison files won’t be modified and pcAPSFile will be compared to them.
oStrInfoMessage (String) – Error message if any. Out parameter
oStrError (String) – Non error message to show after initialization. If not nullptr, it has a message and has to be deleted
eUnitsSystem (EUnitsSystem, int], Optional) – Defaults to EUnitsSystem.METRIC.
eMode (EModes | int, Optional) – TariffsEngine mode. Defaults to EModes.MODE_NORMAL.
eEnergyDataset (EEnergyDataset | int, int], Optional) – Energy option. Defaults to EEnergyDataset.ENERGY_DATASET_GENERIC.
oComputeCosts (EComputeCosts | int, Optional) – Compute utilities or not . Defaults to EComputeCosts.COMPUTE_COSTS_YES.
True if success. False if fail. See oStrError
bool
Sets the file(s) to compare with.
pwcFiles – files separated by ? or empty. I.e: “File1?File2?File3”
te = iesve.TariffsEngine(...)
te. SetBenchmarkProfile("prb.aps?prb2.aps")
Read only property containing the % of improvement.