SheffieldSolar / PV_Live-API

A Python implementation of the PV_Live web API.
16 stars 4 forks source link

Rounding errors in float values #25

Closed JamieTaylor-TUOS closed 11 months ago

JamieTaylor-TUOS commented 11 months ago

Seems to be some rounding errors coming from the PV_Live API which can change the API response, even though the values haven't been re-computed.

Example

https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/17?start=2023-07-28T00:00:00&end=2023-07-29T00:00:00&data_format=json&extra_fields=bias_error,capacity_mwp,installedcapacity_mwp,lcl_mw,site_count,stats_error,ucl_mw,uncertainty_MW,updated_gmt

[
    17,
    "2023-07-28T23:30:00Z",
    0.0,
    null,
    214.10121560100004,
    226.97943265300006,
    null,
    1296048,
    null,
    null,
    null,
    "2023-07-29T12:14:35Z"
],

https://api.solar.sheffield.ac.uk/pvlive/api/v4/pes/17?start=2023-07-27T00:00:00&end=2023-07-29T00:00:00&data_format=json&extra_fields=bias_error,capacity_mwp,installedcapacity_mwp,lcl_mw,site_count,stats_error,ucl_mw,uncertainty_MW,updated_gmt

[
    17,
    "2023-07-28T23:30:00Z",
    0.0,
    null,
    214.10121560100004,
    226.97943265299995,
    null,
    1296048,
    null,
    null,
    null,
    "2023-07-29T12:14:35Z"
],

Suggested fix Round all (NOT NULL) values for the following cols to 3 decimal places: bias_error, capacity_mwp, installedcapacity_mwp, lcl_mw, stats_error, ucl_mw, uncertainty_MW

JulianBriggs commented 11 months ago

No action.