pik-piam / piamInterfaces

0 stars 18 forks source link

feature requests model comparison #38

Closed orichters closed 1 year ago

orichters commented 1 year ago
fbenke-pik commented 1 year ago

in checkSummations, loop over models (and scenarios?) to have them differentiated

@orichters What do you mean by this?

orichters commented 1 year ago

As far as I understood, @nicobauer wanted to pass the whole quitte object (or best the xlsx file) to checkSummations, but then it checks everything at once which is not very helpful (in particular for the human-readable output part which does not differentiate which model is wrong). Doing one comparison per model might be much better (As far as I understood, Nico does that now by calling the function multiple times)

fbenke-pik commented 1 year ago

I personally dont think this is a problem. If you run it on all models and scenarios, you get one large dataframe with all the comparisons for all models+scenarios+variables. You can then filter afterwards based on your needs, e.g. by variable, scenario, model or relative difference / absolute difference above a certain threshold you find acceptable.

I think this final step is project-specific / depends on your individual needs and does not fit into a generic summations check.

orichters commented 1 year ago

So then we better switch off the human-readable output if no template is supplied? Because if it doesn't tell you to which model it relates, it is quite useless, I guess.

fbenke-pik commented 1 year ago

So then we better switch off the human-readable output if no template is supplied? Because if it doesn't tell you to which model it relates, it is quite useless, I guess.

Yes. In the intermodel-comparison context the human-readable output is not useful. So when you want to compare accross models, you don't supply a template and dont get output. When you do a check pre-submission, you supply a template and get the output.

In the long run, we probably want to move out the generic parts of summation checks (that just take input data and create checksums + absolute diffs + relative diffs) and then create an intermodel comparison function and a pre-submission function. Both call the generic summation check and then generate human-readable output that is helpful in the respective context.

orichters commented 1 year ago

I'm not sure. I would rather want to send something like this to my colleagues compared to a data.frame :)

Summation checks that failed in MESSAGEix-GLOBIOM based on summation_groups_NAVIGATE_T2p4.csv

Final Energy|Industry <
   + Final Energy|Industry|Electricity
   + Final Energy|Industry|Gases
   + Final Energy|Industry|Heat
   + Final Energy|Industry|Hydrogen
   + Final Energy|Industry|Liquids
   + Final Energy|Industry|Other
   + Final Energy|Industry|Solids
   + Final Energy|Industry|Waste
   + Final Energy|Industry|Geothermal
Relative difference between -49.3% and -20.3%, absolute difference up to 32.85 EJ/yr.
fbenke-pik commented 1 year ago

I'm not sure. I would rather want to send something like this to my colleagues compared to a data.frame :)

You dont have to send a data frame to your colleagues. All i am suggesting is to have a generic function that returns the data frame. And then a function calling that generic function and then producing a textual summary like the one you posted above from the df. The latter part depends on the project, the former part is universal.

All until here is universal in my eyes

fbenke-pik commented 1 year ago

Probably done, @orichters ?