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])
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 ])
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])
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)
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)