I'm trying to add ImpactFactors to LCIA methods via IPC (using the Python "olca" library).
What I'm doing is getting the method, then the ImpactCategories via IPC. I add an ImpactFactor to the impact_factor property of the ImpactCategory object, then update the ImpactCategory, but nothing happens : when I request the ImpactCategory back, it contains the same ImpactFactors as before (mine is not there).
The HTTP request log (below) shows that my ImpactFactor (the last one) is correctly sent.
2019-03-25 07:02:14 DEBUG http://openlca:8080 "POST / HTTP/1.1" 200 None
2019-03-25 07:02:14 DEBUG Starting new HTTP connection (1): openlca:8080
send: b'POST / HTTP/1.1\r\nHost: openlca:8080\r\nUser-Agent: python-requests/2.20.1\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-Length: 14473\r\nContent-Type: application/json\r\n\r\n'
send: b'{"jsonrpc": "2.0", "id": 13, "method": "update/model", "params": {"@type": "ImpactCategory", "@id": "b5f6e767-96b3-3b60-b44f-213e6a659a99", "name": "Natural land transformation - ReCiPe Midpoint (H)", "version": "00.00.000", "referenceUnitName": "m2", "impactFactors": [{"@type": "ImpactFactor", "flow": {"@type": "FlowRef", "@id": "e3c1224d-1958-4fbb-b0e3-91943e5975c7", "name": "Transformation, to tropical rain forest", "categoryPath": ["Elementary flows", "Resource", "unspecified"], "refUnit": "m2", "flowType": "ELEMENTARY_FLOW"}, "flowProperty": {"@type": "Ref", "@id": "93a60a56-a3c8-19da-a746-0800200c9a66", "name": "Area", "categoryPath": ["Technical flow properties"]}, "unit": {"@type": "Ref", "@id": "3ce61faa-5716-41c1-aef6-b5920054acc9", "name": "m2"}, "value": -1.0}, ..., {"@type": "ImpactFactor", "flow": {"@type": "FlowRef", "@id": "2299398e-0846-4290-bcab-09bda2e61ee3", "name": "Transformation, to unknown", "categoryPath": ["Elementary flows", "Resource", "unspecified"], "refUnit": "m2", "flowType": "ELEMENTARY_FLOW"}, "flowProperty": {"@type": "Ref", "@id": "93a60a56-a3c8-19da-a746-0800200c9a66", "name": "Area", "categoryPath": ["Technical flow properties"]}, "unit": {"@type": "Ref", "@id": "3ce61faa-5716-41c1-aef6-b5920054acc9", "name": "m2"}, "value": -0.4}, {"@type": "ImpactFactor", "flow": {"@type": "Ref", "@id": "86cb7772-78ca-4b30-92e8-5976559846e5"}, "flowProperty": {"@type": "Ref", "@id": "01846770-4cfe-4a25-8ad9-919d8d378345", "name": "Number of items", "categoryPath": ["Technical flow properties"]}, "unit": {"@type": "Ref", "@id": "6dabe201-aaac-4509-92f0-d00c26cb72ab", "name": "Item(s)"}, "value": 1.0}]}}'
reply: 'HTTP/1.1 200 OK \r\n'