spine-tools / Spine-Toolbox

Spine Toolbox is an open source Python package to manage data, scenarios and workflows for modelling and simulation. You can have your local workflow, but work as a team through version control and SQL databases.
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
72 stars 17 forks source link

Exporter column types and variable number of columns #2058

Open DillonJ opened 1 year ago

DillonJ commented 1 year ago

I want to export time series values via Excel for a large unknown number of objects.

Right now, exporter defaults to string type and even if the number of columns wasn't variable, it would still be extremely impractical changing the type from string to float manually for all of them.

Can there be some sort of global default that can be chosen by the user? I.e. assume a certain type for all columns? Exporter seems set up for this - there is nothing that needs to be specified on a per column basis except the data type and this seems somewhat limiting to the functionality.

Another option would be "auto" where the type could be automatically determined based on the first row of data.

jkiviluo commented 1 year ago

Sounds like an important feature. When this is implemented, would it suffice if the option to define parameter type would be in the 'mapping options' widget? That would then apply to all values that are exported with that mapping. I suppose if one needs to export also text from the same source, then it would be enough to have another mapping for that. Bit confusingly, there is already 'parameter type' in the mapping options, but it's another thing, so we should think about the naming things too.

If you need it now, maybe potential work-around is to use CSV files. Whether it works naturally depends on the final destination and whether it can import CSV numbers as numbers.

soininen commented 1 year ago

Writing everything as strings in Excel files sounds like an oversight in Exporter. I believe we can write the correct types automatically without additional options in the UI.

jkiviluo commented 1 year ago

That would be great of course.

jkiviluo commented 3 days ago

Has been implemented.

jkiviluo commented 3 days ago

Actually it has not been implemented.