def test_standardization(self):
"""Test the :meth:`psyplot.data.CFDecoder.standardize_dims` method"""
ds = psyd.open_dataset(os.path.join(bt.test_dir, 'test-t2m-u-v.nc'))
decoder = psyd.CFDecoder(ds)
dims = {'time': 1, 'lat': 2, 'lon': 3, 'lev': 4}
replaced = decoder.standardize_dims(ds.t2m, dims)
for dim, rep in [('time', 't'), ('lat', 'y'), ('lon', 'x'),
('lev', 'z')]:
self.assertIn(rep, replaced)
self.assertEqual(replaced[rep], dims[dim],
msg="Wrong value for %s (%s-) dimension" % (
dim, rep))
评论列表
文章目录