quintel / etm-esdl

http://esdl.energytransitionmodel.com/api/v1/
1 stars 0 forks source link

RooftopPvParser can not handle InfluxDB profiles #87

Open noracato opened 1 year ago

noracato commented 1 year ago

In __set_production of the RooftopPvParser we add the values of the profiles of the ports like this:

self.production = sum((asset.port[0].profile[0].value for asset in assets_generator))

However, when a profile is referenced like in the InfluxDBProfile object, there is no direct attribute value. We should find another way to get this value. As we cannot access the db from our app, the profile needs to be supplied to our API. Plan is to:

Part of #82

noracato commented 1 year ago

For now I added a mocked method that returns 0 as a value when a profile was not found, so that the files at least make it through the API. We should change that according to the description of this issue.

See: https://github.com/quintel/etm-esdl/blob/b07e8a235171671420aabe888bb5de2090b6e774/app/models/parsers/rooftop_pv.py#L47-L57