Skip to content

EntsoePandasClient.query_installed_generation_capacity yields only NA #496

@karlhaensel-sunnic

Description

@karlhaensel-sunnic

Hi,

EntsoePandasClient.query_installed_generation_capacity sometimes only yields NA values. One example:
test = EntsoePandasClient(api_key=<API-KEY>).query_installed_generation_capacity('DE', start=pd.Timestamp('20200101',tz='Europe/Brussels'), end=pd.Timestamp('20250101',tz='Europe/Brussels'), psr_type=None)
(btw also including a lot of future warnings: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. [...] S = S.reindex(pd.date_range(start, end-delta, freq=delta_text)).ffill())

I think the problem is that the API response yields a value for year before 31 December 23:00 UTC. Therefore, the timedelta with '12MS' does not work properly since it is no month start. It works for UK (but also returns the year before with same values as start year - is this intended behaviour?).

A quick fix, so there are values for every area I tested: tz_convert start and end in series_parsers.py / _parse_timeseries_generic as follows:

start = pd.Timestamp(period.find('start').text).tz_convert('Europe/Brussels')
end = pd.Timestamp(period.find('end').text).tz_convert('Europe/Brussels')

Then the example above works (although on a sidenote: it only yields data for the start year - if I understood correctly, @year_limited wrapper should ensure data for all queried years?). But I'm not sure, whether this would be the right way to fix this problem in general.

Thanks in advance for adressing this issue!
Karl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions