Skip to content

Commit

Permalink
remove backend checks for widgets (they work with tkinter and qt as w…
Browse files Browse the repository at this point in the history
…ell)
  • Loading branch information
raphaelquast committed May 18, 2024
1 parent 562bb68 commit fbacf61
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions eomaps/widgets.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from contextlib import contextmanager

import numpy as np
import matplotlib.pyplot as plt

from . import _log
from ._blit_manager import LayerParser
Expand All @@ -12,16 +11,6 @@
_log.warning("EOmaps-widgets are missing the required dependency 'ipywidgets'!")


def _check_backend():
backend = plt.get_backend()
if "ipympl" not in backend.lower():
_log.warning(
"EOmaps-widgets only work with the 'ipympl (widget)' backend! "
"Make sure you have 'ipympl' installed and use the magic-command "
"'%matplotlib widget' to switch to the interactive jupyter backend!"
)


@contextmanager
def _force_full(m):
"""A contextmanager to force a full update of the figure (to avoid glitches)"""
Expand Down Expand Up @@ -100,8 +89,6 @@ class _LayerSelectionWidget:
_widget_cls = None

def __init__(self, m, layers=None, **kwargs):
_check_backend()

self._m = m
self._set_layers_options(layers)

Expand Down Expand Up @@ -336,8 +323,6 @@ class LayerButton(ipywidgets.Button):

def __init__(self, m, layer, **kwargs):
self._m = m
_check_backend()

self._layer = self._parse_layer(layer)

kwargs.setdefault("description", self._layer)
Expand Down Expand Up @@ -386,8 +371,6 @@ class LayerOverlaySlider(ipywidgets.FloatSlider):

def __init__(self, m, layer, **kwargs):
self._m = m
_check_backend()

self._layer = layer

kwargs.setdefault("value", 0)
Expand Down Expand Up @@ -449,8 +432,6 @@ class _CallbackWidget:

def __init__(self, m, widget_kwargs=None, **kwargs):
self._m = m
_check_backend()

self._kwargs = kwargs

if widget_kwargs is None:
Expand Down

0 comments on commit fbacf61

Please sign in to comment.