Closed markushal closed 9 months ago
chain
: (ordered) list of processes plus a mapping of flows to secondary processesregarding "has_global_default" in the table above
global defaults are values which are equal for all source regions.
I checked for the combinations where a global default should be present from the above table. Global defaults are queried with empty strings in source_region_code
. The following code works with 4032cb84256fc4b0f0c0e26cb4eeecd774973a08 on the api-data
branch:
from ptxboa.api_data import DataHandler
from ptxboa.api import PtxboaAPI
api = PtxboaAPI()
handler = DataHandler(api.data, "2030 (high)")
for process in api.data.dimensions["process"]["process_code"].to_list():
for parameter_code in ["CAPEX", "OPEX-F", "SPECCOST", "WACC"]:
try:
value = handler.get_parameter_value(parameter_code, process_code=process, source_region_code="")
print(f"found global default for {process}, {parameter_code}: {value}")
except ValueError:
print(f"No global default for {process}, {parameter_code}")
Looking at the output , we see that for many parameter / process combinations, there exists no global default. Is this intentional @wingechr & @markushal?
For the following parameter we only use region specific data, and global defaults are not needed:
For all other parameters region specific data does not exist (as long as it is not defined by the user), so there should be a global default value, and there should be no region specific data points in the input data set.
@joAschauer I tried to write down my thoughts on the general structure of the
api.calculate()
function in a class based design:a
chain
is a series of main processes (and optionally attached secondary processes)each process is an instance of a (sub) class of class
process
main subclasses are (probably):
each process has a main
flow
that converts an input value to an output valuethis conversion creates also values for required secondary flows
we probably want a function
set_input_flow(self, value)
to set the input that triggers these calculationsmost of the calculation requires process specific
parameters
parameters
are also dependent on user selections likewhenever a process instanciated, depending on it's subclass, it has to retrieve it's parameters from the data api, e.g. parameter EFF (efficiency):
or for instance conversion parameter for secondary flows:
maybe we also want classes for
flows
, but also maybe not, there is not really any logic attached to it,so maybe just using the code strings is enoughList of Parameters
List of Processes
List of Flows