Hi,
Hope you are all safe and well.
Do you know what I am doing wrong here? I am trying to do a simple unit test but can’t get started.
My assumption is that these are the same and should pass (or almost equal if I was using floats).
Best,
Douglas
import holoviews as hv
hv.__version__ # '1.14.5'
a = [1, 2]
c1 = hv.Curve(a)
c2 = hv.Curve(a)
hv.element.comparison.Comparison.assertEqual(c1, c2)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-24-131c3b2adf0e> in <module>
4 c1 = hv.Curve(a)
5 c2 = hv.Curve(a)
----> 6 hv.element.comparison.Comparison.assertEqual(c1, c2)
C:\ProgramData\Anaconda3\envs\kitchen_sink\lib\site-packages\holoviews\element\comparison.py in assertEqual(cls, first, second, msg)
77
78 if msg is None:
---> 79 asserter(first, second)
80 else:
81 asserter(first, second, msg=msg)
C:\ProgramData\Anaconda3\envs\kitchen_sink\lib\site-packages\holoviews\element\comparison.py in simple_equality(cls, first, second, msg)
54 if not first==second:
55 standardMsg = '%s != %s' % (safe_repr(first), safe_repr(second))
---> 56 raise cls.failureException(msg or standardMsg)
57
58
AssertionError: :Curve [x] (y) != :Curve [x] (y)
I think Assert Equal is a simple test and for a curve I need
hv.element.comparison.Comparison.compare_curve(hv.Curve([1,2]), hv.Curve([1,2]))
Nope, still struggling. Any thoughts on this?
hv.element.comparison.Comparison.compare_overlays(hv.Curve([1,2]) * hv.Curve([1,2]), hv.Curve([1,2]) * hv.Curve([1,2]))
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-44-5df255aa7534> in <module>
----> 1 hv.element.comparison.Comparison.compare_overlays(hv.Curve([1,2]) * hv.Curve([1,2]), hv.Curve([1,2]) * hv.Curve([1,2]))
C:\ProgramData\Anaconda3\envs\kitchen_sink\lib\site-packages\holoviews\element\comparison.py in compare_overlays(cls, el1, el2, msg)
374 def compare_overlays(cls, el1, el2, msg=None):
375 cls.compare_dimensioned(el1, el2)
--> 376 cls.compare_trees(el1, el2, msg='Overlays')
377
378
C:\ProgramData\Anaconda3\envs\kitchen_sink\lib\site-packages\holoviews\element\comparison.py in compare_trees(cls, el1, el2, msg)
359 raise cls.failureException("%s have mismatched paths." % msg)
360 for element1, element2 in zip(el1.values(), el2.values()):
--> 361 cls.assertEqual(element1, element2)
362
363 @classmethod
C:\ProgramData\Anaconda3\envs\kitchen_sink\lib\site-packages\holoviews\element\comparison.py in assertEqual(cls, first, second, msg)
77
78 if msg is None:
---> 79 asserter(first, second)
80 else:
81 asserter(first, second, msg=msg)
C:\ProgramData\Anaconda3\envs\kitchen_sink\lib\site-packages\holoviews\element\comparison.py in simple_equality(cls, first, second, msg)
54 if not first==second:
55 standardMsg = '%s != %s' % (safe_repr(first), safe_repr(second))
---> 56 raise cls.failureException(msg or standardMsg)
57
58
AssertionError: :Curve [x] (y) != :Curve [x] (y)
Looking at the code, it seems to again do simple comparisons of the contained objects rather than curve v curve comparison etc…