Skip to content
Permalink
Browse files

Added unit test for multi-column sorting

  • Loading branch information
philippjfr committed May 3, 2017
1 parent 400cf7c commit 6f101c776ce4dbf4490022b36bf3a568db5ed8f4
Showing with 26 additions and 0 deletions.
  1. +26 −0 tests/testdataset.py
@@ -120,6 +120,13 @@ def test_dataset_closest(self):

# Operations

def test_dataset_sort_hm(self):
ds = Dataset(([2, 2, 1], [2,1,2], [0.1, 0.2, 0.3]),
kdims=['x', 'y'], vdims=['z']).sort()
ds_sorted = Dataset(([1, 2, 2], [2, 1, 2], [0.3, 0.2, 0.1]),
kdims=['x', 'y'], vdims=['z'])
self.assertEqual(ds.sort(), ds_sorted)

def test_dataset_sort_vdim_hm(self):
xs_2 = np.array(self.xs_2)
dataset = Dataset(np.column_stack([self.xs, -xs_2]),
@@ -575,6 +582,9 @@ def test_dataset_add_dimensions_values_hm(self):
def test_dataset_add_dimensions_values_ht(self):
raise SkipTest("Not supported")

def test_dataset_sort_hm(self):
raise SkipTest("Not supported")

def test_dataset_sort_vdim_ht(self):
raise SkipTest("Not supported")

@@ -615,6 +625,13 @@ def setUp(self):
self.data_instance_type = NdElement
self.init_column_data()

def test_dataset_sort_hm(self):
"""
Sorting broken in this case for some reason, since deprecated
this is not worth fixing
"""
raise SkipTest("Not supported")

# Literal formats that have been previously been supported but
# currently are only supported via NdElement.

@@ -815,6 +832,9 @@ def test_dataset_ndelement_init_hm(self):
Dataset(NdElement(zip(self.xs, self.xs_2),
kdims=['x'], vdims=['x2']))

def test_dataset_sort_hm(self):
raise SkipTest("Not supported")

def test_dataset_sort_vdim_hm(self):
exception = ('Compressed format cannot be sorted, either instantiate '
'in the desired order or use the expanded format.')
@@ -975,6 +995,9 @@ def test_dataset_add_dimensions_values_hm(self):
def test_dataset_add_dimensions_values_hm_alias(self):
raise SkipTest("Not supported")

def test_dataset_sort_hm(self):
raise SkipTest("Not supported")

def test_dataset_sort_vdim_hm(self):
raise SkipTest("Not supported")

@@ -1032,6 +1055,9 @@ def setUp(self):
def test_dataset_add_dimensions_values_hm(self):
raise SkipTest("Not supported")

def test_dataset_sort_hm(self):
raise SkipTest("Not supported")

def test_dataset_sort_vdim_hm_alias(self):
raise SkipTest("Not supported")

0 comments on commit 6f101c7

Please sign in to comment.
You can’t perform that action at this time.