Commit Graph

7865 Commits

Author SHA1 Message Date
Dennis Heimbigner
ec5b3f9a4f Regularize the scoping of dimensions
This is a follow-on to pull request
````https://github.com/Unidata/netcdf-c/pull/1959````,
which fixed up type scoping.

The primary changes are to _nc\_inq\_dimid()_ and to ncdump.

The _nc\_inq\_dimid()_ function is supposed to allow the name to be
and FQN, but this apparently never got implemented. So if was modified
to support FQNs.

The ncdump program is supposed to output fully qualified dimension names
in its generated CDL file under certain conditions.

Suppose ncdump has a netcdf-4 file F with variable V, and V's parent group
is G. For each dimension id D referenced by V, ncdump needs to determine
whether to print its name as a simple name or as a fully qualified name (FQN).

The algorithm is as follows:

1. Search up the tree of ancestor groups.
2. If one of those ancestor groups contains the dimid, then call it dimgrp.
3. If one of those ancestor groups contains a dim with the same name as the dimid, but with a different dimid, then record that as duplicate=true.
4. If dimgrp is defined and duplicate == false, then we do not need an fqn.
5. If dimgrp is defined and duplicate == true, then we do need an fqn to avoid incorrectly using the duplicate.
6. If dimgrp is undefined, then do a preorder breadth-first search of all the groups looking for the dimid.
7. If found, then use the fqn of the first found such dimension location.
8. If not found, then fail.

Test case ncdump/test_scope.sh was modified to test the proper
operation of ncdump and _nc\_inq\_dimid()_.

Misc. Other Changes:
* Fix nc_inq_ncid (NC4_inq_ncid actually) to return root group id if the name argument is NULL.
* Modify _ncdump/printfqn_ to print out a dimid FQN; this supports verification that the resulting .nc files were properly created.
2021-05-31 15:51:12 -06:00
Ward Fisher
b8e9929e34
Merge pull request #1986 from DennisHeimbigner/ncdumpvlenbug.dmh
Fix ncdump bug when printing VLENs with basetype char
2021-05-27 15:13:50 -06:00
Ward Fisher
19809e2c26
Merge branch 'master' into ncdumpvlenbug.dmh 2021-05-27 14:50:05 -06:00
Ward Fisher
3d997de7d3
Merge pull request #1959 from DennisHeimbigner/typescope.dmh
Regularize the scoping of types
2021-05-27 14:34:05 -06:00
Ward Fisher
2c26f94a49
Merge branch 'master' into typescope.dmh 2021-05-27 14:13:14 -06:00
Ward Fisher
73e7b84294
Merge pull request #2009 from DennisHeimbigner/xgetoptmingw.dmh
Fix Mingw versus XGetopt (again)
2021-05-27 14:07:30 -06:00
Ward Fisher
e0ddc7c4e0
Merge branch 'master' into xgetoptmingw.dmh 2021-05-27 14:07:18 -06:00
Ward Fisher
991069ea93
Merge pull request #1973 from gsjaardema/patch-48
Fix some HDF5-related tests
2021-05-27 12:31:30 -06:00
Ward Fisher
1eb7522528
Merge pull request #2000 from DennisHeimbigner/badfilter.dmh
Improve error message when non-existent filter is encountered.
2021-05-27 12:30:44 -06:00
Ward Fisher
cc618af959
Merge branch 'master' into badfilter.dmh 2021-05-27 12:30:39 -06:00
Ward Fisher
ca9be04be0
Merge pull request #2007 from Unidata/fix-makedist.wif
Makedist is failing in nczarr_test
2021-05-27 09:11:58 -06:00
Dennis Heimbigner
014db82bd4 Update Release notes 2021-05-26 16:06:17 -06:00
Dennis Heimbigner
d3f6c126b6 Fix Mingw versus XGetopt (again)
re: https://github.com/Unidata/netcdf-c/pull/2003#issuecomment-847637871

Turns out that mingw defines both _WIN32 and also defines getopt.
This means that this test:
````
#ifdef _WIN32
#include "XGetopt.h"
#endif
````
fails on this error:
````
../include/XGetopt.h:38:24: error: conflicting types for 'getopt'
````

Fix is to replace
````
#ifdef _WIN32
with
#if defined(_WIN32) && !defined(__MINGW32__)
````
2021-05-26 14:27:27 -06:00
Ward Fisher
5b49ee9f3b Temporarily remove distcheck from Github Actions 2021-05-26 13:55:59 -06:00
Ward Fisher
6eaf39f3c3 Revert previous change. 2021-05-26 13:54:40 -06:00
Ward Fisher
a5d7277092 Testing a different theory 2021-05-26 13:44:56 -06:00
Ward Fisher
5f95b7ca9f Temporarily add an ssh-interface when make distcheck fails. 2021-05-26 13:15:12 -06:00
Ward Fisher
ceb9b29e17 Speculating on fix, perhaps a race issue on make distcheck when passed the command to use concurrent processes. 2021-05-26 11:16:22 -06:00
Ward Fisher
141446514b Trying to fix a confounding error in make distcheck. 2021-05-26 11:03:29 -06:00
Ward Fisher
e2eb7bb52e Added DISTCHECK_CONFIGURE_FLAGS to Github Actions distcheck stanza. 2021-05-26 10:44:07 -06:00
Ward Fisher
d003f98367 Updated github actions to add make distcheck 2021-05-25 10:55:14 -06:00
Ward Fisher
ac6c9eb20d Updated Release Notes. 2021-05-25 10:52:55 -06:00
Ward Fisher
345b9e6f2c Clean up a leftover directory. 2021-05-25 10:13:32 -06:00
Ward Fisher
427166f02d
Merge pull request #2003 from DennisHeimbigner/closedir.dmh
Fix NCclosedir in dpathmgr.c
2021-05-20 15:43:40 -06:00
Dennis Heimbigner
0e931f22a5 More cygwin fixes 2021-05-19 21:04:53 -06:00
Dennis Heimbigner
537f41aeb3 Fix 2 for cygwin build 2021-05-19 17:41:41 -06:00
Dennis Heimbigner
edc2c7af98 fix cygwin build 2021-05-19 17:19:33 -06:00
Dennis Heimbigner
453ad847b9 turn off tracing 2021-05-19 14:38:07 -06:00
Dennis Heimbigner
fba7198039 Fix NCclosedir in dpathmgr.c
re: Issue https://github.com/Unidata/netcdf-c/issues/1999

NCclosedir code is incorrect. Fix.
Note that this issue crops up when using a non-VisualStudio windows build
such as Mingw because Mingq defines dirent.h, but Visual Studio does not.

Addendum:
Fix some mingw bugs:

1. Modify XGetopt.h to be conditional on _WIN32 instead of _MSC_VER.
2. Make sure sys/stat.h is included in ncpathmgr.h
2021-05-19 14:19:28 -06:00
Ward Fisher
92e8808cd9
Merge pull request #2004 from DennisHeimbigner/dimcount.dmh
Fix counting of dimensions in ncdump
2021-05-19 11:29:48 -06:00
Dennis Heimbigner
c56133d1f9 Update Release Notes 2021-05-18 16:39:35 -06:00
Dennis Heimbigner
fbd0d73c6b Fix counting of dimensions in ncdump
re: issue https://github.com/Unidata/netcdf-c/issues/2002

It turns out that ncdump has an error where it assumes that the set of all dimension ids has no holes. That is that (maxid+1) = ndims. This is incorrect for a variety of reasons for netcdf-4.

So instead of counting total number of dimensions in a dataset, it is necessary to look for the maximum dimension id and use that when allocating a table of all dimensions.
2021-05-18 16:35:08 -06:00
Dennis Heimbigner
3194585c08 add extra test 2021-05-18 14:26:33 -06:00
Dennis Heimbigner
e196234ed9 Update RELEASENOTES 2021-05-18 14:08:41 -06:00
Dennis Heimbigner
51fa5fce1b Fix NCclosedir in dpathmgr.c
re: Issue https://github.com/Unidata/netcdf-c/issues/1999

NCclosedir code is incorrect. Fix.
Note that this issue crops up when using a non-VisualStudio windows build
such as Mingw because Mingq defines dirent.h, but Visual Studio does not.
2021-05-18 14:06:12 -06:00
Dennis Heimbigner
432477c1d0 Update RELEASE NOTES 2021-05-17 19:53:15 -06:00
Dennis Heimbigner
74e7812d83 Improve error message when non-existent filter is encountered.
re: https://github.com/Unidata/netcdf-c/issues/1996

Improve the error message and location that is reported when reading a filter with a variable that uses a filter that is not available on the reading platform.

This requires checking the availability of the filter, recording it, and failing when any attempt is made to read or write that variable. A test case was added for this in tst_filter.sh. Also, LOG level 0 message is generated giving the variable and the filter id.

Note that by design if there is no attempt to read or write the variable, then no error is reported; this means that, for example, ncdump -h will list the filter even though it is not actually available. This is important for allowing a user to see the filter details.
2021-05-17 19:49:58 -06:00
Ward Fisher
44d9d365e9
Merge pull request #1993 from DennisHeimbigner/jsonquotes.dmh
Fix JSON quoted string processing in libnczarr
2021-05-10 14:42:40 -06:00
Dennis Heimbigner
7b0168a079 Update RELEASE_NOTES 2021-05-06 16:43:01 -06:00
Dennis Heimbigner
91168e33a0 Fix JSON quoted string processing in libnczarr
re: github issue https://github.com/Unidata/netcdf-c/issues/1982

The problem was that the libnczarr/zsjon.c handling of strings with
embedded double quotes was wrong; a one line fix.
Also added a test case.

Misc. other changes:

1. I Discovered, en passant, that the handling of 64 bit constants
had an error that was fixed.
2. cleanup of the constant conversion code to recurse on arrays of values.
2021-05-06 16:39:44 -06:00
Ward Fisher
e6bdee5930
Merge pull request #1990 from DennisHeimbigner/nczarr_enhance1.dmh
Upgrade the nczarr code to match Zarr V2
2021-04-26 16:13:41 -06:00
Dennis Heimbigner
5873c627db remove push signal 2021-04-25 22:03:03 -06:00
Dennis Heimbigner
1243c3d866 Allow .rc tests to work in parallel by isolation 2021-04-25 22:02:29 -06:00
Dennis Heimbigner
dec9e74107 logdepend 2021-04-25 13:41:50 -06:00
Dennis Heimbigner
1f51ec56aa LGTM cleanup 2021-04-24 21:44:57 -06:00
Dennis Heimbigner
ed70a2e463 try 2: fix test properties 2021-04-24 20:49:03 -06:00
Dennis Heimbigner
05b4046173 try 1: fix test properties 2021-04-24 20:41:59 -06:00
Dennis Heimbigner
f3d118bfa1 reset action signals 2021-04-24 19:54:41 -06:00
Dennis Heimbigner
6ef02261f0 Update RELEASE NOTES 2021-04-24 19:53:18 -06:00
Dennis Heimbigner
74b40fd788 Upgrade the nczarr code to match Zarr V2
Re: https://github.com/zarr-developers/zarr-python/pull/716

The Zarr version 2 spec has been extended to include the ability
to choose the dimension separator in chunk name keys. The legal
separators has been extended from {'.'} to {'.' '/'}.  So now it
is possible to use a key like "0/1/2/0" for chunk names.

This PR implements this for NCZarr. The V2 spec now says that
this separator can be set on a per-variable basis. For now, I
have chosen to allow this be set only globally by adding a key
named "ZARR.DIMENSION_SEPARATOR=<char>" in the
.daprc/.dodsrc/ncrc file. Currently, the only legal separator
characters are '.' (the default) and '/'. On writing, this key
will only be written if its value is different than the default.
This change caused problems because supporting a separator of '/'
is difficult to parse when keys/paths use '/' as the path separator.
A test case was added for this.

Additionally, make nczarr be enabled default by default. This required
some additional changes so that if zip and/or AWS S3 sdk are unavailable,
then they are disabled for NCZarr.

In addition the following unrelated changes were made.

1. Tested that pure-zarr mode could read an nczarr formatted store.
1. The .rc file handling now merges all known .rc files (.ncrc,.daprc, and .dodsrc) in that order and using those in HOME first, then in current directory. For duplicate entries, the later ones override the earlier ones. This change is to remove some of the conflicts inherent in the current .rc file load process. A set of test cases was also added.
1. Re-order tests in configure.ac and CMakeLists.txt so that if libcurl
   is not found then the other options that depend upon it properly
   are disabled.
1. I decided that xarray support should be enabled by default for pure
   zarr. In order to allow disabling, I added a new mode flag "noxarray".
1. Certain test in nczarr_test depend on use of .dodsrc. In order for these
   to work when testing in parallel, some inter-test dependencies needed to
   be added.
1. Improved authorization testing to use changes in thredds.ucar.edu
2021-04-24 19:48:15 -06:00