OSUKED / ElexonDataPortal

Python wrapper for the Elexon/BMRS API
https://osuked.github.io/ElexonDataPortal
MIT License
52 stars 14 forks source link

Rolling System Demand #11

Closed DavidLloydNGP closed 2 years ago

DavidLloydNGP commented 2 years ago

Hi,

Thank you for creating this library.

I am interested in accessing rolling system demand, accessible through the BMRS webpage here:

https://www.bmreports.com/bmrs/?q=demand/rollingsystemdemand/historic

I see that there is a function for accessing system demand (both ITSDO and TSDF) but neither of these quantities corresponds to rolling system demand. Is there a function for accessing rolling system demand or is it currently missing from the API?

Thanks, David

peterdudfield commented 2 years ago

I think this is now done, perhaps @DavidLloydNGP could confirm this?

DavidLloydNGP commented 2 years ago

Hi @peterdudfield. Thanks for letting me know. Do you know in which stream I can now find rolling system demand? I haven't spotted any changes in the documentation that point to where rolling system demand can now be found.

peterdudfield commented 2 years ago

https://github.com/OSUKED/ElexonDataPortal/blob/master/ElexonDataPortal/api.py#L1533

This function does it, I can write an example if you want?

I can update the documentation in a PR, unless you want to do it?

DavidLloydNGP commented 2 years ago

Thanks. I will try it out and update the documentation when I have finished (unless someone manages before me).

DavidLloydNGP commented 2 years ago

_getROLSYSDEM is not present after pip installing the library. After installing ElexonDataPortal from github, I can use _getROLSYSDEM, with one small caveat: _getROLSYSDEM requires start and end date strings in the explicit format 'YYYY-MM-DD HH:MM:SS', whereas get_FUELHH, for instance, is more tolerant of format variations in the date strings.

peterdudfield commented 2 years ago

ok, I guess @AyrtonB can do a release to 'pypi' once that is sorted.

see Elexon documentation 5.2.12 - ROLSYSDEM 5.2.14 - FUELHH

It seems what you have noticed is also in the documentation. I.e Elexon need you to specific time in ROLSYSDEM but not in FUELHH

One way could be you add 00:00:00 to your datetimes, of course one option is to also do this in the repo - but in some ways keep this repo a good reflection of the API might be a good thing. What do you think @DavidLloydNGP?

AyrtonB commented 2 years ago

I've just released the latest version (2.0.12) to PyPi 🎉

RE date formats: Personally I believe its most ideal to keep the library as a reflection of the API (makes it much easier to reason about the code in 6-months time), however, I'm happy to re-evaluate this if its a big pain point.

DavidLloydNGP commented 2 years ago

I tend to agree with you both on this point. The date argument difference is something that could be addressed with a note in the documentation. The error message for ROLSYSDEM is explicitly worded as well, so most people will be able to fix this problem quickly themselves.

peterdudfield commented 2 years ago

@AyrtonB would you be able to do a new release on to pypi? Just to get the latest changes up there?

AyrtonB commented 2 years ago

@AyrtonB would you be able to do a new release on to pypi? Just to get the latest changes up there?

Hi Peter, the changes should be in this version

peterdudfield commented 2 years ago

thanks, ready to close?

AyrtonB commented 2 years ago

Yes 🎉