Skip to content

Commit

Permalink
fixed #295
Browse files Browse the repository at this point in the history
changed pandas freqstr in parse_prices. this requires pandas to be >= 2.2.0
  • Loading branch information
fboerman committed Jan 26, 2024
1 parent 6805699 commit afcd888
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# odd custom folders
ne_10m_admin_0_countries
scratch


# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
12 changes: 6 additions & 6 deletions entsoe/entsoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)

__title__ = "entsoe-py"
__version__ = "0.6.2"
__version__ = "0.6.3"
__author__ = "EnergieID.be, Frank Boerman"
__license__ = "MIT"

Expand Down Expand Up @@ -1160,12 +1160,12 @@ def query_day_ahead_prices(
self, country_code: Union[Area, str],
start: pd.Timestamp,
end: pd.Timestamp,
resolution: List[Literal['60T', '30T', '15T']] = '60T') -> pd.Series:
resolution: List[Literal['60min', '30min', '15min']] = '60min') -> pd.Series:
"""
Parameters
----------
resolution: either 60T for hourly values,
30T for half-hourly values or 15T for quarterly values, throws error if type is not available
resolution: either 60min for hourly values,
30min for half-hourly values or 15min for quarterly values, throws error if type is not available
country_code : Area|str
start : pd.Timestamp
end : pd.Timestamp
Expand All @@ -1174,8 +1174,8 @@ def query_day_ahead_prices(
-------
pd.Series
"""
if resolution not in ['60T', '30T', '15T']:
raise InvalidParameterError('Please choose either 60T, 30T or 15T')
if resolution not in ['60min', '30min', '15min']:
raise InvalidParameterError('Please choose either 60min, 30min or 15min')
area = lookup_area(country_code)
# we do here extra days at start and end to fix issue 187
text = super(EntsoePandasClient, self).query_day_ahead_prices(
Expand Down
6 changes: 3 additions & 3 deletions entsoe/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def parse_prices(xml_text):
pd.Series
"""
series = {
'15T': [],
'30T': [],
'60T': []
'15min': [],
'30min': [],
'60min': []
}
for soup in _extract_timeseries(xml_text):
soup_series = _parse_timeseries_generic(soup, 'price.amount')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requests
pytz
beautifulsoup4>=4.11.1
pandas>=1.4.0
pandas>=2.2.0
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11'
],

keywords='ENTSO-E data api energy',
Expand All @@ -67,7 +68,7 @@

# List run-time dependencies here. These will be installed by pip when
# your project is installed.
install_requires=['requests', 'pytz', 'beautifulsoup4>=4.11.1', 'pandas>=1.4.0'],
install_requires=['requests', 'pytz', 'beautifulsoup4>=4.11.1', 'pandas>=2.2.0'],

include_package_data=True,
)

0 comments on commit afcd888

Please sign in to comment.