diff --git a/hvplot/tests/testui.py b/hvplot/tests/testui.py index 2d9062ecb..4ef833ad9 100644 --- a/hvplot/tests/testui.py +++ b/hvplot/tests/testui.py @@ -23,7 +23,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'], @@ -43,7 +43,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'], @@ -62,7 +62,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'], @@ -78,7 +78,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'], diff --git a/hvplot/ui.py b/hvplot/ui.py index 2c677bb37..aceeb8296 100644 --- a/hvplot/ui.py +++ b/hvplot/ui.py @@ -410,7 +410,7 @@ def __init__(self, df, **params): cls.name.lower(): cls(df, explorer=self, **cparams) for cls, cparams 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)) @@ -478,7 +478,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 ) diff --git a/hvplot/util.py b/hvplot/util.py index d4f748637..297b7cea7 100644 --- a/hvplot/util.py +++ b/hvplot/util.py @@ -135,11 +135,21 @@ def proj_to_cartopy(proj): srs = proj.srs if has_gdal: - # this is more robust, as srs could be anything (espg, etc.) - s1 = osr.SpatialReference() - s1.ImportFromProj4(proj.srs) - if s1.ExportToProj4(): - srs = s1.ExportToProj4() + import warnings + with warnings.catch_warnings(): + # Avoiding this warning could be done by setting osr.UseExceptions(), + # except there might be a risk to break the code of users leveraging + # GDAL on their side or through other libraries. So we just silence it. + warnings.filterwarnings('ignore', category=FutureWarning, message= + r'Neither osr\.UseExceptions\(\) nor osr\.DontUseExceptions\(\) has ' + r'been explicitly called\. In GDAL 4\.0, exceptions will be enabled ' + 'by default' + ) + # this is more robust, as srs could be anything (espg, etc.) + s1 = osr.SpatialReference() + s1.ImportFromProj4(proj.srs) + if s1.ExportToProj4(): + srs = s1.ExportToProj4() km_proj = {'lon_0': 'central_longitude', 'lat_0': 'central_latitude', diff --git a/pyproject.toml b/pyproject.toml index fec98ab1a..c4f613b55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", +] diff --git a/tox.ini b/tox.ini index 2d82b8664..a691d2004 100644 --- a/tox.ini +++ b/tox.ini @@ -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