Open smartie2076 opened 3 years ago
This is something we should discuss in our call with ICOM, when fixing the output of the simulation.
@Bachibouzouk so, I realized that the discussion with Dimitris was maybe rather about the parser but not how I should do it within the MVS. We should look at our current parser again and see if it already does what he wants, and if I have free range for what I am doing.
def convert_from_special_types_to_json(o):
if isinstance(o, np.int64):
answer = int(o)
...
elif isinstance(o, pd.DataFrame):
answer = {DATA_TYPE_JSON_KEY: TYPE_DATAFRAME}
answer.update(json.loads(o.to_json(orient="split")))
Resulting in
"cost_matrix": {
"columns": [
"label",
"costs_total",
"costs_om_total",
],
"data": [
[
"battery storage capacity",
3068972.69526,
0.0,
],
[
"battery input power",
0.0,
0.0,
],
],
"data_type": "pandas_Dataframe",
"index": [
0,
0,
]
So, this is not exactly what Dimitris explained to us. It is pd.DataFrame. But we anyway provide them with the cost_matrix
, right, so he should be able to read it?
For me, it really does not matter what I do - keep it as json, make a pd.DF. But I would like to have this in the report, and ideally in the EPA.
For the report it is best that this is a pd.DF
, I will make the parser to provide the right json format we discussed :). For the report we should just make sure we have our pd.DF
following the tidy data standard
For the report it is best that this is a
pd.DF
, I will make the parser to provide the right json format we discussed :). For the report we should just make sure we have ourpd.DF
following the tidy data standard
Great! Then the todos here are:
pd.DF
, adapt functions that write into it f04ff78cce0957a16c7f2b0b536605f609e40637pd.DF
for being printed into the report c18ebebaa94fba05190879e7503588e333198f08@smartie2076 - the last point can be addressed in a subsequent PR, if I understand it well you want to move the relevant values from "scalars" into "KPI individual sectors", or is it the reverse?
@SabineHaas @Bachibouzouk @ciaradunks this is actually something that may be important to do before the release. I will try to do it tomorrow and ask @Bachibouzouk to do a dummy EPA integration, to see if anything fails.
Ah, I've also noticed that some of the units are missing in KPI_SCALARS_DICT
Yeah, that as well. As the EPA currently already has some issues to parse the MVS results, I will not add onto that and pause this issue. We can address it when there are better/more interactive error messages displayed in the EPA.
Currently, the attributed costs are in
data[KPI][KPI_SCALARS_DICT]
:They should however be in here for a better overview:
Also, the
KPI individual sectors
should be adapted to the structure ofkpi scalars
so that its easier to print them in the pdf report.Originally posted by @smartie2076 in https://github.com/rl-institut/multi-vector-simulator/issues/549#issuecomment-742474854