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
70 stars 17 forks source link

Copy-pasting `TimeSeries` from DB Editor to other programs yields the underlying JSON string. #1684

Open Tasqu opened 2 years ago

Tasqu commented 2 years ago

Ideally, we'd probably want to be able to copy the TimeSeries to the clipboard in some more universally understood format. E.g. getting the table representation directly into Excel.

manuelma commented 2 years ago

I like it, but to explain, the current behavior is oriented to enable internal copy pasting within the db editor. If we instead copy the time series as a two column table with timestamps and values, then it becomes more difficult for the db editor to understand that. Maybe we need to use MIME data or something?

soininen commented 2 years ago

Maybe we need to use MIME data or something?

This would be the solution, indeed. We can add different data to clipboard under different MIME types which enables us to copy both Toolbox-specific data structures for internal use and csv tables for external programs at the same time. Some project items already use their own MIME types, e.g. Importer for copy pasting mappings.