it-is-me-mario/MARIO

Get_data function

LorenzoRinaldi opened this issue · 3 comments

The function "get_data" is not working if the user provide an integer as "scenarios" parameter. Not even if it is provided within a list.
Moreover, the documentation for this function seems missing.

I would add the following:
The get_data function was supposed to be used as a back-hand. Probabily for this reason, it looks sub-optimal and may be improved. Best way to use it to extract a specific matrix (e.g. f) of the main object (world) is:

world.get_data(matrices=['f'], scenarios=['scenario 2'])['scenario 2'][0]

The function may be improved by avoiding the pass the same info twice.
Furthermore, a dedicated documentation should be added.

I would add the following: The get_data function was supposed to be used as a back-hand. Probabily for this reason, it looks sub-optimal and may be improved. Best way to use it to extract a specific matrix (e.g. f) of the main object (world) is:

world.get_data(matrices=['f'], scenarios=['scenario 2'])['scenario 2'][0]

The function may be improved by avoiding the pass the same info twice. Furthermore, dedicated documentation should be added.

@nigolred & @LorenzoRinaldi Probably the best way to solve the problem would be to have a new function with a more user-friendy function that executes the get_data function in a simpler and more intuitive way and leave the get_data function as a private function that is extensively used in the backend. Probably changing this function itself will arise backward-compatibility issues. What do you think?

For me that can work for sure and may be preferable to avoid backward-compatibility.