Skip to content

Commit

Permalink
susbapce API test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhassell committed Apr 23, 2024
1 parent 0a8b8a0 commit 31ec154
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cf/test/test_Field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,14 @@ def test_Field_subspace(self):
h = f.subspace(grid_longitude=np.float64(20))
self.assertTrue(g.equals(h))

# Test API with 0/1/2 arguments
kwargs = {"grid_latitude": [1]}
i = f.subspace(**kwargs)
j = f.subspace(0, **kwargs)
k = f.subspace("compress", 0, **kwargs)
self.assertEqual(i, j)
self.assertEqual(i, k)

def test_Field_auxiliary_to_dimension_to_auxiliary(self):
f = cf.example_field(0)
nd = len(f.dimension_coordinates())
Expand Down

0 comments on commit 31ec154

Please sign in to comment.