You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected the Dimension class and the process_dimensions function to accept a dict to specify the dimension. For example, one encounters an exception message to that effect when initializing a MultiDimensionalMapping (such as its subclasses NdLayout and NdOverlay) with an incorrect type in the kdims argument, as in the following example with an intentionally wrong type to produce the message:
In [1]: importholoviewsIn [2]: holoviews.core.ndmapping.MultiDimensionalMapping([], kdims=[b"bad type"])
Traceback (mostrecentcalllast):
InputIn [2] in<cellline: 1>holoviews.core.ndmapping.MultiDimensionalMapping([], kdims=[b"bad type"])
File~\Documents\Repositories\holoviews\holoviews\core\ndmapping.py:104in__init__super().__init__(OrderedDict(), **dict(params))
File~\Documents\Repositories\holoviews\holoviews\core\dimension.py:840in__init__params.update(process_dimensions(kdims, vdims))
File~\Documents\Repositories\holoviews\holoviews\core\dimension.py:123inprocess_dimensionsraiseValueError('Dimensions must be defined as a tuple, 'ValueError: Dimensionsmustbedefinedasatuple, string, dictionaryorDimensioninstance, foundabytestype.
Also, Holoviews development includes the closed issue #2315 and PR #2332, which intended to implement specifying a Dimension with a dict.
However, trying to create a Dimension from a dict causes a TypeError, although it occurs not because the code checks the type directly but rather because it attempts a membership test with a mutable object:
That membership test to look up the spec in the preset dimensions prevents a dict spec from making it to the clause shown below that PR #2332 introduced to check whether spec is a dict.
The conda environment's packages are collapsed here.
I expected the
Dimension
class and theprocess_dimensions
function to accept adict
to specify the dimension. For example, one encounters an exception message to that effect when initializing aMultiDimensionalMapping
(such as its subclassesNdLayout
andNdOverlay
) with an incorrect type in thekdims
argument, as in the following example with an intentionally wrong type to produce the message:Also, Holoviews development includes the closed issue #2315 and PR #2332, which intended to implement specifying a
Dimension
with adict
.However, trying to create a
Dimension
from adict
causes aTypeError
, although it occurs not because the code checks the type directly but rather because it attempts a membership test with a mutable object:That membership test to look up the spec in the preset dimensions prevents a
dict
spec from making it to the clause shown below that PR #2332 introduced to check whetherspec
is adict
.The text was updated successfully, but these errors were encountered: