netcdf-c/libnczarr
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
..
obsolete Add filter support to NCZarr 2021-09-02 17:04:26 -06:00
CMakeLists.txt Fix additional S3 support issues 2021-10-29 20:06:37 -06:00
Makefile.am Merge branch 'tinyxml2.dmh' of https://github.com/DennisHeimbigner/netcdf-c into gh2170.wif 2022-03-29 11:31:31 -06:00
SimpleBinStream.h
zarr.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zarr.h Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zattr.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zcache.h Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zchunking.c
zchunking.h Add filter support to NCZarr 2021-09-02 17:04:26 -06:00
zclose.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zcreate.c Support MSYS2/Mingw platform 2021-12-23 22:18:56 -07:00
zcvt.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zdebug.c Support MSYS2/Mingw platform 2021-12-23 22:18:56 -07:00
zdebug.h Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zdim.c
zdispatch.c Enhance/Fix filter support 2022-03-14 12:39:37 -06:00
zdispatch.h Enhance/Fix filter support 2022-03-14 12:39:37 -06:00
zfile.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zfilter.c Fix internal bz2 problems 2022-05-27 15:45:34 -06:00
zfilter.h I made a major update to this PR with the following changes: 2022-05-19 22:00:40 -06:00
zgrp.c
zincludes.h Move to Version 2 NCZarr Extended Meta-Data 2021-07-17 16:55:30 -06:00
zinternal.c Improve filter installation process to avoid use of an extra shell script 2022-05-14 16:05:48 -06:00
zinternal.h Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zmap_file.c Support MSYS2/Mingw platform 2021-12-23 22:18:56 -07:00
zmap_s3sdk.c Fix additional S3 support issues 2021-10-29 20:06:37 -06:00
zmap_zip.c Support MSYS2/Mingw platform 2021-12-23 22:18:56 -07:00
zmap.c Support MSYS2/Mingw platform 2021-12-23 22:18:56 -07:00
zmap.h Significantly Improve Amazon S3 Cloud Storage Support 2021-09-27 18:36:33 -06:00
zodom.c
zodom.h
zopen.c Support MSYS2/Mingw platform 2021-12-23 22:18:56 -07:00
zprov.c
zprovenance.h
zs3sdk.cpp Significantly Improve Amazon S3 Cloud Storage Support 2021-09-27 18:36:33 -06:00
zsync.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
ztype.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zutil.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zvar.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zwalk.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00
zxcache.c Add support for Zarr string type to NCZarr 2022-08-27 20:21:13 -06:00