OSUKED / ElexonDataPortal

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

Code fails when trying to get data for a long period #19

Closed adfi closed 1 year ago

adfi commented 1 year ago

The following statement fails: client.get_FORDAYDEM(start_date='2022-01-01', end_date='2022-01-30').

The error is: NameError: name 'warnings' is not defined

I've traced it down to this line of code: https://github.com/OSUKED/ElexonDataPortal/blob/c5645df1bad07ace31aa24cd9a1bfc655d44679e/ElexonDataPortal/dev/orchestrator.py#L113

The module warnings is imported but aliased to warn.

I've not investigated why the warning is being thrown, you could probably figure that out faster than me.

AyrtonB commented 1 year ago

Thanks @adfi for flagging this, it's a classic case of the code intended to help debugging causing a bug itself 🤦.

I've corrected this with https://github.com/OSUKED/ElexonDataPortal/commit/ea3b4234c97d970d58a5f2da9e93ef5b062fec48 which has been included as part of a new release v2.0.16 which is now available on PyPi.