Does a Json string with spine_db.DatabaseMapping() get automatically parsed to a time_series in spineDb editor? #239
Replies: 2 comments
-
It is automatically defined ^^ However, the API format should be understood |
Beta Was this translation helpful? Give feedback.
-
We use the JSON format internally within the database and it is subject to change (and such change has been discussed a number of times already). While it is currently possible to feed JSON directly into Database editor, it isn't guaranteed to work in the future. I recommend inputting data via Parameter value editors ("build-in parser") or Importer project items. If you want to use Python, have a look at the |
Beta Was this translation helpful? Give feedback.
-
I have a quick question on relationship_parameter_values in spine. For instance, if I have this json_template variable that I use in python3 (whereby data is a dictionary key and I can load a specific parameter value into it according to a time series I want to define).
}
After using the json.dumps(json_template ) I get json_template as a json object.
However, I just want to ask if everything is defined correctly will spinetoolbox databases recognize the template like below as a string in plain value?
{"type": "time_series", "data": [18.43296333, 17.97232443, 17.97232443, 17.97232443], "index": {"start": "2015-01-01T00:00", "resolution": "1D", "ignore_year": false, "repeat": false}}
![image](https://user-images.githubusercontent.com/73653114/232193975-8690fda6-eacf-4b0b-8cbf-2ed6c7672070.png)
Or is there supposed a built in parser that takes these parameters and defines a time-series parameter value automatically?
Beta Was this translation helpful? Give feedback.
All reactions