Skip to content

Conversation

@kipe
Copy link
Owner

@kipe kipe commented May 7, 2025

  • Adds support for upcoming 15 and 30 minute pricing using "price indices" -endpoint.
    • The sub-hour resolutions are only fetched via elspot.Prices.fetch, no helper functions for those. For example Prices.fetch(areas=['FI'], resolution=15)
    • The endpoint either uses the official prices if the resolution matches, otherwise calculates an average price.
  • Changes hourly fetching to use the same endpoint as 15 and 30 minute pricing, as default for some areas will be lower -> 60 minute resolution needs to be calculated as an average.
  • Keeps 60 minute resolution as default for compatibility reasons.
  • Adds UnsupportedResolution exception which is raised if an unsupported resolution is requested.

Price indices are normalized prices for a set resolution, for one delivery area or a group of delivery areas. If official prices exist in a certain resolution, then official prices are used. If no centrally agreed official price exists for a resolution, then an average price is calculated.
Note that settlement is always done in the lowest trading resolution for the market and area, price indices are just an indication of what the average price would be in different resolutions.
Source: Nordpool website

kipe added 2 commits May 7, 2025 10:30
- Split tests to multiple files for easier management and better performance in editor.
- Created a utility module for VCR configuration to streamline cassette management.
- Changed API endpoint from 'DayAheadPrices' to 'DayAheadPriceIndices' for hourly price fetching.
- Updated test cases to reflect new date parameters and expected values for May 2025.
- Adjusted handling of empty area prices to return None when no data is found.
@kipe kipe self-assigned this May 7, 2025
- Introduced `UnsupportedResolution` exception for unsupported resolution requests.
- Updated `Prices` class to support fetching prices at 15-minute and 30-minute intervals.
- Enhanced `fetch` and `_fetch_json` methods to accept resolution as a parameter.
- Added unit tests for 15-minute and 30-minute price fetching scenarios.
- Created test for handling unsupported resolution requests.
kipe added 3 commits May 7, 2025 11:28
- Updated comments for clarity, specifying "Central Western Europe" and "South East Europe".
- Added Bulgaria ("BG") and Romania ("TEL") to the list of countries in the Prices class.
- Added internal handling for "SYSTEM" to be treated as "SYS" in the Prices class.
- Updated comments for clarity regarding API endpoint behavior.
- Introduced a new test case for hourly price fetching using the "SYS" area.
- Adjusted VCR cassette to reflect the new API request and response structure.
@flopp999
Copy link
Contributor

It is working fine. I just tested it manually. I will update the examples so you can update them as well

@flopp999
Copy link
Contributor

I just noticed that you need to use end_date= otherwise you will not get any data
with .hourly you do not needed to have end_date=

@kipe
Copy link
Owner Author

kipe commented May 11, 2025

I just noticed that you need to use end_date= otherwise you will not get any data
with .hourly you do not needed to have end_date=

Good catch, seems like I forgot to handle the situation when "data_type" is None -> uses incorrect parameter name in when defining areas for the request. Will fix tomorrow.

@kipe
Copy link
Owner Author

kipe commented May 12, 2025

I just noticed that you need to use end_date= otherwise you will not get any data with .hourly you do not needed to have end_date=

Aah, there's no bug, just tested at the "wrong time". The library by default tries to fetch prices for tomorrow and returns None, if they haven't been published yet. After prices have been published, it fetches them correctly.

I'll double check this today after the prices for tomorrow have been published.

@flopp999
Copy link
Contributor

I just noticed that you need to use end_date= otherwise you will not get any data with .hourly you do not needed to have end_date=

Aah, there's no bug, just tested at the "wrong time". The library by default tries to fetch prices for tomorrow and returns None, if they haven't been published yet. After prices have been published, it fetches them correctly.

I'll double check this today after the prices for tomorrow have been published.

I changed in the code to use today(days=0) and it then worked fine without end_date, so everything is correct

https://github.com/kipe/nordpool/blob/15min/nordpool/elspot.py#L159

@flopp999
Copy link
Contributor

flopp999 commented May 12, 2025

It is working fine. I just tested it manually. I will update the examples so you can update them as well

@kipe this is now done, I noticed on nordpool site that NO5 exists. Find changes in #65

flopp999 and others added 6 commits May 12, 2025 15:14
@kipe
Copy link
Owner Author

kipe commented May 12, 2025

Thanks for the updates!
I cleaned the examples a bit, moving them to their own directory and formatted according to black rules etc.

If nothing else comes to mind, I think I'll merge and publish this tomorrow.

@kipe kipe merged commit 4cb3d51 into main May 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants