EnergieID / entsoe-py

Python client for the ENTSO-E API (european network of transmission system operators for electricity)
MIT License
409 stars 182 forks source link

Unmarked currency changes #153

Closed Tomkourou closed 2 years ago

Tomkourou commented 2 years ago

I have noticed that in price data there are instances where ENTSOE changes the unit currency. For example, for Poland the ENTSOE website states the following:

"Please note that due to distinct market arrangements for certain periods Day-ahead Prices are expressed in different currencies: From 5 January 2015 Day-ahead Prices for the Polish Area are expressed in EUR/MWh. Between 2 March 2017 and 19 November 2019 Day-ahead Prices are published in PLN/MWh. Starting from 20 November 2019 Day-ahead Prices are equal to fixed auction prices from the Single Day-ahead Coupling in EUR/MWh. "

When one pulls historical data like day-ahead prices this change in currency will not be immediately obvious as the currency is not displayed. Would it be possible to add a column in the pandas client showing the currency?

fboerman commented 2 years ago

hi @Tomkourou I dont think the api returns this info so then we need to put hardcoded rules into place.

I dont have the time to fully investigate this now, if you can provide a pull request I will look at it.

MattEwen commented 2 years ago

@fboerman Just bumping this - the currency is provided as an attribute of <TimeSeries> so could be grabbed. I'd be happy to have a go doing a PR for this when I get time. However it would mean returning a df instead of a series which I imagine could make a lot of people's code fail. Is this an ok change, or would it be better in a new query method for the time being?

jpaduart commented 2 years ago

I would say it's overkill to include the currency into the existing Series/Dataframes, accompanying the prices, because in my experience, only Poland and Romania exhibit currency changes. It would break the code, plus be discarded by most users anyway. A (new) specific query looks like the best solution to me.

Op vr 13 mei 2022 om 07:58 schreef Matt Ewen @.***>:

@fboerman https://github.com/fboerman Just bumping this - the currency is provided as an attribute of so could be grabbed. I'd be happy to have a go implementing this when I get time. However it would mean returning a df instead of a series which I imagine could make a lot of people's code fail. Is this an ok change, or would it be better in a new query method for the time being?

— Reply to this email directly, view it on GitHub https://github.com/EnergieID/entsoe-py/issues/153#issuecomment-1125683666, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIO2LULIRZM6ZLZMK2QHIM3VJXVPLANCNFSM5MFNWUPQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

fboerman commented 2 years ago

hi @MattEwen and @jpaduart I agree that breaking the functionality from series to dataframe is not something we would want.

@jpaduart what you are saying is not entirely true. There are specific timeperiods when more countries had different currencies and poland even swapped twice back and forth as said in the OP.

@MattEwen I think best would be to have an extra function called query_day_ahead_prices_with_currencies or something similar. It would be great if you could do this with a PR!

MattEwen commented 2 years ago

hi @fboerman - just wanted to check in and apologise for not getting to this. We've changed to a different approach for price data so unfortunately I don't think I'll be able to

fboerman commented 2 years ago

hi @MattEwen no problem, but im gonna close this issue for now since I dont think its that important to fix