I’m trying to upload a single object of type Abstract to a new stream. My python code looks something like this:
url = "https://{}/api/streams/{}".format(os.environ["SERVER"], stream_id)
payload = {"objects": [csv_to_speckle_object(fp)]}
r = requests.put(url, data=json.dumps(payload), headers=headers)
My payload looks like this when json encoded:
{
“objects”: [
{
“type”: “Abstract”,
“SpaceTypes”: {
“Atrium - Between 20ft and 40ft in height”: {
“Name”: “Atrium - Between 20ft and 40ft in height”,
“Equipment [W/m2]”: “5.38”,
“Equipment Variation Profile”: “Assembly - People”,
“Lighting [W/m2]”: “6.46”,
“Lighting Variation Profile”: “Assembly - Light”,
“Occupant Sensible Gain (W/person)”: “73.3”,
“Occupant Latent Gain (W/person)”: “73.3”,
“Occupant Density (people/m\u00ef\u00bf\u00bd)”: “1.61”,
“Occupant Variation Profile”: “Assembly - People”,
“ASHRAE 62.1 Category”: “”,
“62.1 Ventilation Coefficient Rp (m3/person)”: “0.00000”,
“62.1 Ventilation Coefficient Ra (m3/m\u00ef\u00bf\u00bd)”: “0.00000”,
“Infiltration [ACH]”: “0.5”
}…
The upload is successful, but when I try to read the contents of the stream, the objects are formatted in a way that looks like there’s an issue parsing the json where the decimals are. It looks like this:
{
“Atrium - Between 20ft and 40ft in height”: {
“62”: {
“1 Ventilation Coefficient Rp (m3/person)”: “0.00000”,
“1 Ventilation Coefficient Ra (m3/m�)”: “0.00000”,
},
“Name”: “Atrium - Between 20ft and 40ft in height”,
“Equipment [W/m2]”: “5.38”,
“Equipment Variation Profile”: “Assembly - People”,
“Lighting [W/m2]”: “6.46”,
“Lighting Variation Profile”: “Assembly - Light”,
“Occupant Sensible Gain (W/person)”: “73.3”,
“Occupant Latent Gain (W/person)”: “73.3”,
“Occupant Density (people/m�)”: “1.61”,
“Occupant Variation Profile”: “Assembly - People”,
“ASHRAE 62”: {“1 Category”: “”},
“Infiltration [ACH]”: “0.5”,
}…
Not quite sure how to get over this issue. Any suggestions would be great.
Cheers