Example #1
0
 def test_multiple_selections(self):
     """Test multiple selections applied to dataset."""
     dataset = apply_selection(["cast.lon=100", "cast.lat>0"], self.dataset)
     np.testing.assert_array_equal(
         dataset.cast.data,
         self.dataset.cast.data[self.dataset.cast.data["lon"] == 100][
             self.dataset.cast.data["lat"] > 0])
Example #2
0
 def test_multiple_selections(self):
     """Test multiple selections applied to dataset."""
     dataset = apply_selection(
         ["cast.lon=100", "cast.lat>0"], self.dataset)
     np.testing.assert_array_equal(
         dataset.cast.data,
         self.dataset.cast.data[
             self.dataset.cast.data["lon"] == 100
         ][
             self.dataset.cast.data["lat"] > 0
         ])
Example #3
0
 def test_simple_selection(self):
     """Test a simple selection applied to the dataset."""
     dataset = apply_selection(["cast.lon=100"], self.dataset)
     np.testing.assert_array_equal(
         dataset.cast.data,
         self.dataset.cast.data[self.dataset.cast.data["lon"] == 100])
Example #4
0
 def test_no_selection(self):
     """Test no selection in the query string."""
     dataset = apply_selection("", self.dataset)
     np.testing.assert_array_equal(dataset.cast.data,
                                   self.dataset.cast.data)
Example #5
0
 def test_simple_selection(self):
     """Test a simple selection applied to the dataset."""
     dataset = apply_selection(["cast.lon=100"], self.dataset)
     np.testing.assert_array_equal(
         dataset.cast.data,
         self.dataset.cast.data[self.dataset.cast.data["lon"] == 100])
Example #6
0
 def test_no_selection(self):
     """Test no selection in the query string."""
     dataset = apply_selection("", self.dataset)
     np.testing.assert_array_equal(
         dataset.cast.data, self.dataset.cast.data)