SheffieldSolar / PV_Live-API

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

GSP ids #8

Closed peterdudfield closed 2 years ago

peterdudfield commented 2 years ago

Is there an easy endpoint to get all the gsp ids, or pes ids?

This might be quite handy if people want to then get data points from different sites.

Can probably force a method to try ids until they stop working, but there might be an easy sql command on the server side of this API that might be better to use

My motivation is to move https://github.com/openclimatefix/nowcasting_dataset/blob/main/nowcasting_dataset/data_sources/gsp/pvlive.py these functions to this repo so lots of people can use them

JamieTaylor-TUOS commented 2 years ago

There's an instance attribute: self.gsp_ids (numpy array of unique int IDs)

Also one for PES IDs: self.pes_ids (numpy array of unique int IDs)

There's also a lookup of all modelled entities, from which both of are derived: self.ggd_lookup (Pandas DF)

e.g.

from pvlive_api import PVLive

pvl = PVLive()
print(pvl.gsp_ids)
JamieTaylor-TUOS commented 2 years ago

(Apologies they're not documented in the README, I'll add this...)

peterdudfield commented 2 years ago

ah thanks - thats super