From 5ff76445df3d1510d9fbcc882010a662461cdd91 Mon Sep 17 00:00:00 2001 From: Tom Donoghue Date: Fri, 30 Aug 2024 10:08:17 -0400 Subject: [PATCH 1/2] square axis warnings - set ticks be4 labels --- lisc/plts/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisc/plts/utils.py b/lisc/plts/utils.py index e2ad5dc..22f9376 100644 --- a/lisc/plts/utils.py +++ b/lisc/plts/utils.py @@ -216,12 +216,14 @@ def rotate_ticks(ax, xtickrotation=None, ytickrotation=None): """ if xtickrotation: + ax.set_xticks(ax.get_xticks()) ax.set_xticklabels(ax.get_xticklabels(), rotation=xtickrotation, horizontalalignment='right') if ytickrotation: alignment = 'top' if ytickrotation > 0 and ytickrotation < 180 else 'bottom' + ax.set_yticks(ax.get_yticks()) ax.set_yticklabels(ax.get_yticklabels(), rotation=ytickrotation, verticalalignment=alignment) From 16dd6ab75d7befc8e915e16bd0bf7eb3d169c665 Mon Sep 17 00:00:00 2001 From: Tom Donoghue Date: Fri, 30 Aug 2024 10:08:35 -0400 Subject: [PATCH 2/2] squash xml/html parsing warning that seems irrelevant --- lisc/collect/info.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisc/collect/info.py b/lisc/collect/info.py index 013126e..67cb8d3 100644 --- a/lisc/collect/info.py +++ b/lisc/collect/info.py @@ -83,6 +83,11 @@ def get_db_info(req, info_url): >>> db_info = get_db_info(Requester(), url) """ + # Squash warning that arises despite specifying XML parsing + from bs4.builder import XMLParsedAsHTMLWarning + import warnings + warnings.filterwarnings("ignore", category=XMLParsedAsHTMLWarning) + # Get the info page and parse with BeautifulSoup info_page = req.request_url(info_url) info_page_soup = BeautifulSoup(info_page.content, 'lxml')