Skip to content

Commit 40719db

Browse files
committed
surpress unneeded warning from beautifulsoup
fixed EnergieID#180
1 parent 9c5a2ac commit 40719db

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

entsoe/entsoe.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytz
77
import requests
88
from bs4 import BeautifulSoup
9+
from bs4.builder import XMLParsedAsHTMLWarning
910

1011
from entsoe.exceptions import InvalidPSRTypeError, InvalidBusinessParameterError
1112
from .exceptions import NoMatchingDataError, PaginationError
@@ -16,9 +17,12 @@
1617
parse_imbalance_volumes_zip, parse_netpositions, parse_procured_balancing_capacity, \
1718
parse_water_hydro
1819
from .decorators import retry, paginated, year_limited, day_limited, documents_limited
20+
import warnings
21+
22+
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)
1923

2024
__title__ = "entsoe-py"
21-
__version__ = "0.5.4"
25+
__version__ = "0.5.5"
2226
__author__ = "EnergieID.be, Frank Boerman"
2327
__license__ = "MIT"
2428

entsoe/parsers.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
import zipfile
33
from io import BytesIO
44
from typing import Union
5-
5+
import warnings
66
import bs4
7+
from bs4.builder import XMLParsedAsHTMLWarning
78
import pandas as pd
89

910
from .mappings import PSRTYPE_MAPPINGS, DOCSTATUS, BSNTYPE, Area
1011

12+
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)
13+
1114
GENERATION_ELEMENT = "inBiddingZone_Domain.mRID"
1215
CONSUMPTION_ELEMENT = "outBiddingZone_Domain.mRID"
1316

0 commit comments

Comments
 (0)