Closed emiliom closed 1 year ago
Here are some specific tests I will build in.
For each netcdf group:
There are important, additional twists, though:
obligation
, to encode the obligation level.echopype_mods
, that categorizes the variable based on changes implemented in echopype. For example, "added" if we added a variable that is not found in the convention (eg, channel
).The tests to be implemented will then need to take into account the obligation
and echopype_mods
attributes.
The echopype_checker
package (https://github.com/OSOceanAcoustics/echopype-checker) still needs polish, but its github repo now includes decent instructions and notebooks illustrating its usage.
So, I'm closing this issue. Further package development will be tracked in its repo.
This will be a relatively simple compliance checker, tuned to the echopype implementation of SONAR-netCDF4 v1. We'll use it to manually assess compliance for every instrument or any given converted file or echodata object. It'll use a CDL file to test again expected variables, dimensions and attributes, including names, variable data types, attribute values and variable dimensions.
I'll create the CDL as follows:
ncdump -h
to generate a CDL of the metadata ("header"). Actually, I can skip creating the file and usenc4.Dataset.tocdl()
, like this:nc4_ds.tocdl(coordvars=False, data=False, outfile=
exported.cdl)
ncgen
)The compliance checker will read the CDL into an xarray dataset as follows (see here for the xarray part):