Commit Graph

9046 Commits

Author SHA1 Message Date
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
Dennis Heimbigner
8774625c21 Add option to control accessing external servers
Add options
"--enable-external-server-tests" (automake)
"-DENABLE_EXTERNAL_SERVER_TESTS" (cmake)
to enable/disable tests that access
external URLS, where an external URL refers to some server not
directly under the control of netcdf-c.
This option defaults to off.

The reason for this PR is that external servers can be up or down
or change content without any warning to us, thus causing some
of our tests to fail.

Additionally. and recently, the thredds-test server was shut
down and some of our tests used it. So these tests are disabled
until a suitable replacement server is available.

## Misc. Fixes
* Bump the depth of trace support in nclog.c to avoid overflow
2022-08-27 14:24:47 -06:00
Ward Fisher
9cc8831fc8
Merge pull request #2488 from WardF/gh2487.wif
Address jump-misses-init issue.
2022-08-24 10:53:39 -06:00
Ward Fisher
e3c43deba6 Address jump-misses-init issue. 2022-08-24 10:07:00 -06:00
Ward Fisher
435769f248 Changed attribute case in documentation in support of https://github.com/Unidata/netcdf-c/issues/2481 2022-08-19 13:28:51 -06:00
Ward Fisher
12a9083fb3
Merge pull request #2470 from dzenanz/main
Fix AWS SDK linking errors
2022-08-16 12:27:33 -06:00
Ward Fisher
5ccb71d7a3
Merge pull request #1701 from magnusuMET/bugfix/musl_build
fix musl build
2022-08-12 15:09:59 -06:00
Dennis Heimbigner
5a859cf2a8 nodebug 2022-08-06 13:35:36 -06:00
Dennis Heimbigner
5f2ac0117c debug1 2022-08-06 12:38:09 -06:00
Dennis Heimbigner
44e9899806 Windows specific blosc fixed 2022-08-05 17:00:40 -06:00
Dennis Heimbigner
517cb6e816 Fix master conflicts 2022-08-05 13:09:03 -06:00
Dženan Zukić
bb1e0c3dd2 Fix AWS SDK linking errors
The error messages were of the style:

LINK : fatal error LNK1181: cannot open input file 'aws-crt-cpp.lib'
2022-08-03 09:59:06 -04:00
Ward Fisher
b03988e735
Merge pull request #2466 from DennisHeimbigner/fixedstring.dmh
Fix support for reading arrays of HDF5 fixed size strings
2022-08-02 16:41:13 -06:00
Dennis Heimbigner
2b45c7ec84 Fix support for reading arrays of HDF5 fixed size strings
re: https://github.com/Unidata/netcdf-c/issues/2159

There was error in libhdf5 that only allowed reading a single
value HDF5 fixed string. Fix to allow reading an array of such strings.
Also make sure it still works for scalars and for attributes.
Add a testcase: nc_test4/tst_fixedstring.sh.
2022-07-29 14:47:07 -06:00
Ward Fisher
5ebc855ed6
Merge pull request #2462 from DennisHeimbigner/enumdfalt.dmh
Provide a default enum const when fill value does not match any enum constant
2022-07-27 09:20:15 -06:00
Ward Fisher
ba37c0af9f
Merge branch 'main' into enumdfalt.dmh 2022-07-26 15:23:40 -06:00
Ward Fisher
62ae05d6d0
Merge pull request #2457 from edwardhartnett/ejh_test_quantize_3
more quantize testing and adding pre-processor constant NC_MAX_FILENAME to nc_tests.h
2022-07-25 15:59:50 -06:00
Magnus Ulimoen
5ec50071d7 Use int64_t instead of __int64 2022-07-20 08:45:55 +02:00
Magnus Ulimoen
670078f981 fix musl build 2022-07-20 08:45:55 +02:00
Ward Fisher
717e022e80
Merge pull request #2463 from magnusuMET/bugfix/read_only
Prevent cmake writing to source dir
2022-07-19 13:43:21 -06:00
Ward Fisher
0de3062048
Merge pull request #2448 from DennisHeimbigner/twojsons.dmh
Ensure that netcdf_json.h does not interfere with ncjson.
2022-07-19 11:56:01 -06:00
Ward Fisher
8b583d18ca
Merge branch 'main' into twojsons.dmh 2022-07-19 11:16:04 -06:00
Magnus Ulimoen
aa394b5ebc Prevent cmake writing to source dir 2022-07-19 15:55:42 +02:00
Dennis Heimbigner
eeb215bf4e debug1 2022-07-17 14:43:59 -06:00
Dennis Heimbigner
b588855ea2 Update release notes 2022-07-17 14:38:54 -06:00
Dennis Heimbigner
65fd9fe1a5 Provide a default enum const when fill value does not match any enum const.
re: https://github.com/Unidata/netcdf-c/issues/982

It is possible to define an enum type that has no enum constant
with value zero. However, HDF5 has a default fill value of zero
that it used to fill all chunks. In the event that this situation
occurs, ncdump, say, will fail because there is no enum const
to print for the value zero.

The solution is to create a special enum constant called "_UNDEFINED"
that has the value zero. It is only used in the case that there is
no constant in the enum that already covers zero.

A test case is added in netcdf-c/ncdump to validate this solution.

Note: the changes occur primarily in libsrc4, so they also work for NCZarr.
2022-07-17 14:32:31 -06:00
Dennis Heimbigner
9e053f0888 Update blosc testing 2022-07-17 13:59:11 -06:00
Dennis Heimbigner
59806d0a32 Update release notes 2022-07-12 15:53:01 -06:00
Dennis Heimbigner
3623e17920 Fix some bugs in the blosc filter wrapper
re: Issue https://github.com/Unidata/netcdf-c/issues/2458

The above Github Issue revealed some bugs in the file netcdf-c/plugins/H5Zblosc.c. Fixed and added a testcase. Also discovered that the Blosc LZ sub-compressors do not work well with small datasets.

Misc. Other Change(s): I noticed that the file "dap4_test/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds" is still causing tar errors during "make distcheck", so I made some changes to do rename at test-time.
2022-07-12 15:19:07 -06:00
Ward Fisher
64033e367d
Merge pull request #2460 from WardF/gh2446.wif
Guard _declspec(dllexport) in support of #2446
2022-07-11 14:42:21 -06:00
Ward Fisher
1975911aae Guard _declspec(dllexport) in support of https://github.com/Unidata/netcdf-c/issues/2446 2022-07-11 14:09:57 -06:00
Edward Hartnett
f32890e1be more testing of quantize 2022-07-08 14:58:52 -06:00
Edward Hartnett
a621ed4224 more testing of quantize 2022-07-08 13:33:23 -06:00
Edward Hartnett
31dfc1ce15 more testing of quantize 2022-07-08 13:29:56 -06:00
Edward Hartnett
8142189892 more testing of quantize 2022-07-08 13:27:18 -06:00
Edward Hartnett
99dbcad141 more testing of quantize 2022-07-08 13:21:51 -06:00
Edward Hartnett
cd1aa7b882 more testing of quantize 2022-07-08 13:15:23 -06:00
Edward Hartnett
d23d90e148 more testing of quantize 2022-07-08 12:48:46 -06:00
Edward Hartnett
82caba1f12 more quantize testing 2022-07-08 11:44:23 -06:00
Edward Hartnett
1a13b9ed09 more quantize testing 2022-07-08 10:35:38 -06:00
Edward Hartnett
6645cce1c9 more quantize testing 2022-07-08 09:44:38 -06:00
Edward Hartnett
2bfde9a5eb more quantize testing 2022-07-08 08:55:48 -06:00
Edward Hartnett
4aa319f9dc adding pre-processor constant NC_MAX_FILENAME to nc_tests.h 2022-07-08 07:27:54 -06:00
Ward Fisher
26c558203f
Merge pull request #2445 from edwardhartnett/ejh_fix_quantize
fix and test quantize mode for NC_CLASSIC_MODEL
2022-07-07 15:29:33 -06:00
Edward Hartnett
4b0f337dbc
Merge branch 'main' into ejh_fix_quantize 2022-07-07 11:16:32 -06:00
Dennis Heimbigner
31b24d767a Fix bad cmake install location 2022-07-06 15:01:23 -06:00
Dennis Heimbigner
966a0c1a9f Resolve conflict 2022-07-06 14:21:51 -06:00
Greg Sjaardema
53aeb1aacb
Minor update to doxygen function documentation 2022-07-06 10:38:43 -06:00
Ward Fisher
ee5e1596f5
Merge pull request #2430 from DennisHeimbigner/cmakeplugin.dmh
Fix the way CMake handles -DPLUGIN_INSTALL_DIR
2022-07-06 09:09:13 -06:00
Dennis Heimbigner
f50007e21d Update RELEASENOTES.md 2022-07-05 22:06:28 -06:00