Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence GDAL exceptions warning and filter out warnings from the test suite #1142

Merged
merged 8 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions hvplot/tests/testui.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_explorer_basic():
def test_explorer_settings():
explorer = hvplot.explorer(df)

explorer.param.set_param(
explorer.param.update(
kind='scatter',
x='bill_length_mm',
y_multi=['bill_depth_mm'],
Expand All @@ -39,7 +39,7 @@ def test_explorer_settings():
def test_explorer_plot_code():
explorer = hvplot.explorer(df)

explorer.param.set_param(
explorer.param.update(
kind='scatter',
x='bill_length_mm',
y_multi=['bill_depth_mm'],
Expand All @@ -58,7 +58,7 @@ def test_explorer_plot_code():
def test_explorer_hvplot():
explorer = hvplot.explorer(df)

explorer.param.set_param(
explorer.param.update(
kind='scatter',
x='bill_length_mm',
y_multi=['bill_depth_mm'],
Expand All @@ -74,7 +74,7 @@ def test_explorer_hvplot():
def test_explorer_save(tmp_path):
explorer = hvplot.explorer(df)

explorer.param.set_param(
explorer.param.update(
kind='scatter',
x='bill_length_mm',
y_multi=['bill_depth_mm'],
Expand Down
4 changes: 2 additions & 2 deletions hvplot/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def __init__(self, df, **params):
cls.name.lower(): cls(df, explorer=self, **params)
for cls, params in controller_params.items()
}
self.param.set_param(**self._controllers)
self.param.update(**self._controllers)
self.param.watch(self._plot, list(self.param))
for controller in self._controllers.values():
controller.param.watch(self._plot, list(controller.param))
Expand Down Expand Up @@ -468,7 +468,7 @@ def _plot(self, *events):
self._layout[1][1] = self._hvpane
self._alert.visible = False
except Exception as e:
self._alert.param.set_param(
self._alert.param.update(
object=f'**Rendering failed with following error**: {e}',
visible=True
)
Expand Down
1 change: 1 addition & 0 deletions hvplot/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def proj_to_cartopy(proj):
import cartopy.crs as ccrs
try:
from osgeo import osr
getattr(osr, "UseExceptions", lambda: None)()
maximlt marked this conversation as resolved.
Show resolved Hide resolved
has_gdal = True
except ImportError:
has_gdal = False
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,24 @@ requires = [
"pyct >=0.4.4",
"setuptools >=30.3.0"
]


[tool.pytest.ini_options]
addopts = "-v --pyargs"
norecursedirs = "doc .git dist build _build .ipynb_checkpoints"
# The test suite used to be run with nosetests which collected
# by default files like `testgeo.py` while pytest's default is
# to collect files like `test_geo.py`. This setting allows
# to avoid renaming all the test files.
python_files = "test*.py"
filterwarnings = [
# 2023-09: See https://github.com/matplotlib/matplotlib/issues/25244
"ignore:Deprecated call to `pkg_resources.+?'mpl_toolkits:DeprecationWarning",
"ignore:Deprecated call to `pkg_resources.+?'sphinxcontrib:DeprecationWarning",
# 2023-09: See https://github.com/ibis-project/ibis/pull/6973
"ignore:.+? is deprecated and will be removed in a future version:FutureWarning:ibis.formats.pandas",
# 2023-09: See https://github.com/Unidata/MetPy/pull/3117
"ignore: 'xdrlib' is deprecated and slated for removal in Python 3.13:DeprecationWarning:metpy.io.nexrad",
# 2023-09: See https://github.com/python-streamz/streamz/issues/460
"ignore: pkg_resources is deprecated as an API:DeprecationWarning:streamz.plugins",
]
9 changes: 0 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ deps = unit: {[_unit]deps}
examples: {[_examples]deps}
all: {[_all]deps}

[pytest]
addopts = -v --pyargs
norecursedirs = doc .git dist build _build .ipynb_checkpoints
; The test suite used to be run with nosetests which collected
; by default files like `testgeo.py` while pytest's default is
; to collect files like `test_geo.py`. This setting allows
; to avoid renaming all the test files.
python_files = test*.py

[flake8]
include = *.py
# run_tests.py is generated by conda build, which appears to have a
Expand Down