From e3dee5443dad84b507734c0a3d2bba8ec44f5653 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 28 Aug 2023 22:40:36 +0200 Subject: [PATCH] Drop requirement for NdMapping to be defined with OrderedDict (#5867) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Simon Høxbro Hansen --- holoviews/core/ndmapping.py | 4 ---- holoviews/element/tabular.py | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/holoviews/core/ndmapping.py b/holoviews/core/ndmapping.py index 4cc8c2392d..1c9f0f40a5 100644 --- a/holoviews/core/ndmapping.py +++ b/holoviews/core/ndmapping.py @@ -104,10 +104,6 @@ def __init__(self, initial_items=None, kdims=None, **params): if kdims is not None: params['kdims'] = kdims super().__init__(OrderedDict(), **dict(params)) - if type(initial_items) is dict and not self.sort: - raise ValueError('If sort=False the data must define a fixed ' - 'ordering, please supply a list of items or ' - 'an OrderedDict, not a regular dictionary.') self._next_ind = 0 self._check_key_type = True diff --git a/holoviews/element/tabular.py b/holoviews/element/tabular.py index b0c333e0ed..2dc298a24c 100644 --- a/holoviews/element/tabular.py +++ b/holoviews/element/tabular.py @@ -41,10 +41,8 @@ def cols(self): def __init__(self, data, **params): if data is None: data = [] - if type(data) == dict: - raise ValueError("ItemTable cannot accept a standard Python dictionary " - "as a well-defined item ordering is required.") - elif isinstance(data, dict): pass + if isinstance(data, dict): + pass elif isinstance(data, list): data = OrderedDict(data) else: