This is quite a big task, because there is a lot of code that translates NASA Ames concepts/objects to/from NetCDF-style concepts. However, it is more complex than that because we previously used cdms as the library to convert to NetCDF. Now, we are moving to xarray.
NOTE: Initially, we only need the Xarray-to-NASAAmes|CSV functionality to work!
[x] Rewrite the following files so that each line is run as a proper unit test that wraps calling the cli. In all cases we just want to check the output file has been written, and check that the output file generated matching those in the tests/expected_outputs/ directory:
[x] Take the nappy/nappy_api.py file contents and create a tests/test_nappy_api.py - create unit tests for each of the examples given.
[x] Run the tests/test_nappy_api.py tests - they will fail... Now start to modify the contents of the nappy.nc_interface modules to get them working using Xarray.
This is quite a big task, because there is a lot of code that translates NASA Ames concepts/objects to/from NetCDF-style concepts. However, it is more complex than that because we previously used
cdms
as the library to convert to NetCDF. Now, we are moving toxarray
.NOTE: Initially, we only need the Xarray-to-NASAAmes|CSV functionality to work!
Here is an overview of the order of tasks:
cdms|CDMS|Cdms
withxarray|xr
- https://github.com/cedadev/nappy/tree/xarray-portcli
. In all cases we just want to check the output file has been written, and check that the output file generated matching those in thetests/expected_outputs/
directory:nappy/nappy_api.py
file contents and create atests/test_nappy_api.py
- create unit tests for each of the examples given.tests/test_nappy_api.py
tests - they will fail... Now start to modify the contents of thenappy.nc_interface
modules to get them working using Xarray.cdms_utils
(http://proj.badc.rl.ac.uk/cows/browser/cows_support/cdms_utils/trunk/lib/cdms_utils). We just need to create the following functions that are actually used bynappy
, and put them in a localnappy/nc_interface/xarray_utils.py
module. There might be some stuff we can steal from: https://github.com/roocs/roocs-utils/blob/master/roocs_utils/xarray_utils/xarray_utils.py . The required functions are:cdms_utils.axis_utils.isUniformlySpaced(axis) cdms_utils.axis_utils.areAxesIdentical(ax1, ax2) cdms_utils.axis_utils.isAxisRegularlySpacedSubsetOf(ax1, ax2)