Skip to content

Commit

Permalink
Chore: hide warnings from holoviews
Browse files Browse the repository at this point in the history
These will be fixed in the next holoviews release. See #495 for more details.
  • Loading branch information
lang-m committed Sep 29, 2023
1 parent 25cc629 commit 81a0e98
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions discretisedfield/plotting/hv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@

from .util import hv_key_dim

# HoloViews shows a warning about a deprecated call to unique when creating
# the dynamic map.
# The developers have confirmed, that this warning can be ignored
# and the problem will be fixed in the next HoloViews release.
# https://discourse.holoviz.org/t/futurewarning-when-creating-a-dynamicmap/6108
# The warnings filtering can be removed once this is fixed.
warnings.filterwarnings(
"ignore",
message="unique with argument",
category=FutureWarning,
module="holoviews.core.util",
)


class Hv:
"""Holoviews-based plotting methods.
Expand Down
7 changes: 7 additions & 0 deletions docs/field-holoviews-visualisation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5898,6 +5898,13 @@
}
],
"source": [
"# hide the following warning from bokeh:\n",
"# `UserWarning: found multiple competing values for 'toolbar.active_drag' property; using the latest value`\n",
"import warnings\n",
"\n",
"warnings.simplefilter(\"ignore\")\n",
"\n",
"\n",
"scalar_z = field.hv.scalar(\n",
" kdims=[\"x\", \"y\"], roi=field.norm, clim=(-1, 1), cmap=\"cividis\"\n",
")\n",
Expand Down

0 comments on commit 81a0e98

Please sign in to comment.