netcdf-c/dap4_test
Dennis Heimbigner 231ae96c4b Add support for Zarr string type to NCZarr
* re: https://github.com/Unidata/netcdf-c/pull/2278
* re: https://github.com/Unidata/netcdf-c/issues/2485
* re: https://github.com/Unidata/netcdf-c/issues/2474

This PR subsumes PR https://github.com/Unidata/netcdf-c/pull/2278.
Actually is a bit an omnibus covering several issues.

## PR https://github.com/Unidata/netcdf-c/pull/2278
Add support for the Zarr string type.
Zarr strings are restricted currently to be of fixed size.
The primary issue to be addressed is to provide a way for user to
specify the size of the fixed length strings. This is handled by providing
the following new attributes special:
1. **_nczarr_default_maxstrlen** —
This is an attribute of the root group. It specifies the default
maximum string length for string types. If not specified, then
it has the value of 64 characters.
2. **_nczarr_maxstrlen** —
This is a per-variable attribute. It specifies the maximum
string length for the string type associated with the variable.
If not specified, then it is assigned the value of
**_nczarr_default_maxstrlen**.

This PR also requires some hacking to handle the existing netcdf-c NC_CHAR
type, which does not exist in zarr. The goal was to choose numpy types for
both the netcdf-c NC_STRING type and the netcdf-c NC_CHAR type such that
if a pure zarr implementation read them, it would still work and an
NC_CHAR type would be handled by zarr as a string of length 1.

For writing variables and NCZarr attributes, the type mapping is as follows:
* "|S1" for NC_CHAR.
* ">S1" for NC_STRING && MAXSTRLEN==1
* ">Sn" for NC_STRING && MAXSTRLEN==n

Note that it is a bit of a hack to use endianness, but it should be ok since for
string/char, the endianness has no meaning.

For reading attributes with pure zarr (i.e. with no nczarr
atribute types defined), they will always be interpreted as of
type NC_CHAR.

## Issue: https://github.com/Unidata/netcdf-c/issues/2474
This PR partly fixes this issue because it provided more
comprehensive support for Zarr attributes that are JSON valued expressions.
This PR still does not address the problem in that issue where the
_ARRAY_DIMENSION attribute is incorrectly set. Than can only be
fixed by the creator of the datasets.

## Issue: https://github.com/Unidata/netcdf-c/issues/2485
This PR also fixes the scalar failure shown in this issue.
It generally cleans up scalar handling.
It also adds a note to the documentation describing that
NCZarr supports scalars while Zarr does not and also how
scalar interoperability is achieved.

## Misc. Other Changes
1. Convert the nczarr special attributes and keys to be all lower case. So "_NCZARR_ATTR" now used "_nczarr_attr. Support back compatibility for the upper case names.
2. Cleanup my too-clever-by-half handling of scalars in libnczarr.
2022-08-27 20:21:13 -06:00
..
baseline Fix some protocol differences between netcdf-c and the Hyrax server. 2020-05-30 17:36:25 -06:00
baselinehyrax Improve operation of the DAP4 code and fix bugs 2021-01-14 21:39:08 -07:00
baselineraw Fix some protocol differences between netcdf-c and the Hyrax server. 2020-05-30 17:36:25 -06:00
baselineremote Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
baselinethredds ckp 2021-10-26 22:52:23 -06:00
cdltestfiles Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
daptestfiles Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
dmrtestfiles Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
misctestfiles Fix some protocol differences between netcdf-c and the Hyrax server. 2020-05-30 17:36:25 -06:00
nctestfiles Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
CMakeLists.txt Improve operation of the DAP4 code and fix bugs 2021-05-21 20:46:56 -06:00
d4test_common.sh Additional refactoring of the thredds dap4 test in support of #2077 2021-08-18 10:24:42 -06:00
dump.c Use strcasecmp definitions from config.h 2021-09-05 17:17:30 +10:00
Makefile.am Fix distcheck problems 2022-05-09 12:10:53 -06:00
maketests.sh Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
test_common.h Improve UTF8 Support On Windows 2022-02-08 20:53:30 -07:00
test_data.c 1. Fix conflicts with current master. 2022-03-15 15:33:13 -06:00
test_data.sh Improve operation of the DAP4 code and fix bugs 2021-01-14 21:39:08 -07:00
test_environment4.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
test_fillmismatch.sh fix test cases 2021-01-07 19:37:03 -07:00
test_hyrax.sh Cleanup the CMake inter-test dependencies 2021-12-20 15:13:08 -07:00
test_meta.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
test_meta.sh Improve operation of the DAP4 code and fix bugs 2021-01-14 21:39:08 -07:00
test_parse.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
test_parse.sh Improve operation of the DAP4 code and fix bugs 2021-01-14 21:39:08 -07:00
test_raw.sh Improve operation of the DAP4 code and fix bugs 2021-01-14 21:39:08 -07:00
test_remote.sh restore 2022-04-29 12:36:33 -06:00
test_test.sh Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
test_thredds.sh Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
tst_curlopt.sh More NCZarr optimizations 2021-01-06 13:35:59 -07:00
tst_data.sh Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
tst_meta.sh Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00
tst_parse.sh Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
tst_raw.sh Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch 2018-10-01 15:51:43 -06:00