Commit Graph

510 Commits

Author SHA1 Message Date
Dennis Heimbigner
fb422e696b Update docs/filters.md and RELEASENOTES.md 2023-06-23 13:42:16 -06:00
Dennis Heimbigner
12ec5711d7 Fix some problems with Earthdata authorization.
re: Issue https://github.com/Unidata/netcdf-c/issues/2704

The issue reported problems accessing e.g. opendap.earthdata.nasa.gov,
which uses the authentication mechanisms of urs.earthdata.nasa.gov.
The file *docs/auth.md* describes how to setup the proper authorization
mechanisms for earthdata, but there turned out to be some bugs
in the code that prevented this from working.

## Primary Changes
* Add some clarification text to *auth.md*.
* Fix the process for loading and merging *.ncrc* and *.dodsrc* file to conform to documentation.
* Fix *NC_s3urlrebuild* so that non-S3 urls are passed through unchanged.
* Fix a bug in the .rc test *test_rcmerge.sh*.
2023-06-10 18:51:13 -06:00
Dennis Heimbigner
fb40a72b45 Improve performance of the nc_reclaim_data and nc_copy_data functions.
re: Issue https://github.com/Unidata/netcdf-c/issues/2685
re: PR https://github.com/Unidata/netcdf-c/pull/2179

As noted in PR https://github.com/Unidata/netcdf-c/pull/2179,
the old code did not allow for reclaiming instances of types,
nor for properly copying them. That PR provided new functions
capable of reclaiming/copying instances of arbitrary types.

However, as noted by Issue https://github.com/Unidata/netcdf-c/issues/2685, using these
most general functions resulted in a significant performance
degradation, even for common cases.

This PR attempts to mitigate the cost of using the general
reclaim/copy functions in two ways.

First, the previous functions operating at the top level by
using ncid and typeid arguments. These functions were augmented
with equivalent versions that used the netcdf-c library internal
data structures to allow direct access to needed information.
These new functions are used internally to the library.

The second mitigation involves optimizing the internal functions
by providing early tests for common cases. This avoids
unnecessary recursive function calls.

The overall result is a significant improvement in speed by a
factor of roughly twenty -- your mileage may vary. These
optimized functions are still not as fast as the original (more
limited) functions, but they are getting close. Additional optimizations are
possible. But the cost is a significant "uglification" of the
code that I deemed a step too far, at least for now.

## Misc. Changes
1. Added a test case to check the proper reclamation/copy of complex types.
2. Found and fixed some places where nc_reclaim/copy should have been used.
3. Replaced, in the netcdf-c library, (almost all) occurrences of nc_reclaim_copy with calls to NC_reclaim/copy. This plus the optimizations is the primary speed-up mechanism.
4. In DAP4, the metadata is held in a substrate in-memory file; this required some changes so that the reclaim/copy code accessed that substrate dispatcher rather than the DAP4 dispatcher.
5. Re-factored and isolated the code that computes if a type is (transitively) variable-sized or not.
6. Clean up the reclamation code in ncgen; adding the use of nc_reclaim exposed some memory problems.
2023-05-20 17:11:25 -06:00
Dennis Heimbigner
98477b9f25 ## Addendum [5/9/23]
It turns out that attempting to test S3 using a github action secret is a very complex process. So, this was disabled for github actions. However, a new *run_tests_s3.yml* action file was added that will eventually encapsulate S3 testing.
2023-05-09 21:13:49 -06:00
Dennis Heimbigner
49737888ca Improve S3 Documentation and Support
## Improvements to S3 Documentation
* Create a new document *quickstart_paths.md* that give a summary of the legal path formats used by netcdf-c. This includes both file paths and URL paths.
* Modify *nczarr.md* to remove most of the S3 related text.
* Move the S3 text from *nczarr.md* to a new document *cloud.md*.
* Add some S3-related text to the *byterange.md* document.

Hopefully, this will make it easier for users to find the information they want.

## Rebuild NCZarr Testing
In order to avoid problems with running make check in parallel, two changes were made:
1. The *nczarr_test* test system was rebuilt. Now, for each test.
any generated files are kept in a test-specific directory, isolated
from all other test executions.
2. Similarly, since the S3 test bucket is shared, any generated S3 objects
are isolated using a test-specific key path.

## Other S3 Related Changes
* Add code to ensure that files created on S3 are reclaimed at end of testing.
* Used the bash "trap" command to ensure S3 cleanup even if the test fails.
* Cleanup the S3 related configure.ac flag set since S3 is used in several places. So now one should use the option *--enable-s3* instead of *--enable-nczarr-s3*, although the latter is still kept as a deprecated alias for the former.
* Get some of the github actions yml to work with S3; required fixing various test scripts adding a secret to access the Unidata S3 bucket.
* Cleanup S3 portion of libnetcdf.settings.in and netcdf_meta.h.in and test_common.in.
* Merge partial S3 support into dhttp.c.
* Create an experimental s3 access library especially for use with Windows. It is enabled by using the options *--enable-s3-internal* (automake) or *-DENABLE_S3_INTERNAL=ON* (CMake). Also add a unit-test for it.
* Move some definitions from ncrc.h to ncs3sdk.h

## Other Changes
* Provide a default implementation of strlcpy and move this and similar defaults into *dmissing.c*.
2023-04-25 17:15:06 -06:00
Ward Fisher
090f4507b0 Update issue with make distcheck 2023-04-12 14:14:38 -06:00
Ward Fisher
c8b3b37b1a Merge branch 'dap4tests2.dmh' of https://github.com/DennisHeimbigner/netcdf-c 2023-04-11 16:42:32 -06:00
Ward Fisher
91591d37a0
Merge pull request #2660 from Unidata/v4.9.2-wellspring.wif
v4.9.2 Wellspring branch
2023-04-11 15:32:26 -06:00
Edward Hartnett
0c20199272 added fortran 2023-04-06 10:04:12 -06:00
Edward Hartnett
397912bbde documenting logging 2023-04-06 09:05:19 -06:00
Edward Hartnett
ea8d8dd05b documenting logging 2023-04-06 08:04:57 -06:00
Ward Fisher
b41127bec5 Bump version strings to reflect next development version. 2023-03-13 15:43:44 -06:00
Dennis Heimbigner
8f55cf31cf update 2023-02-08 16:17:31 -07:00
Ward Fisher
9be94fe19f Clean up some garbled output from Doxygen. 2023-02-01 11:27:50 -07:00
Ward Fisher
488b83f1f6 re-added quickstart filters document. 2023-02-01 11:20:40 -07:00
Ward Fisher
ff103d4f7c A bit of doxygen cleanup. 2023-02-01 11:19:37 -07:00
Ward Fisher
a89bdd70a1 Remove dangling file. 2023-01-31 15:54:02 -07:00
Ward Fisher
1c4a11ec50 Updating filter documentation with a quickstart guide. 2023-01-31 15:52:51 -07:00
Ward Fisher
8192d69dc1 Small tweak. 2023-01-31 09:49:30 -07:00
Dennis Heimbigner
ebf86ac637 update against main 2023-01-28 13:45:35 -07:00
Dennis Heimbigner
158c790ae5 Fix Memory Leak
re: PR https://github.com/Unidata/netcdf-c/pull/2584
re: PR https://github.com/Unidata/netcdf-c/pull/2596

Repaired a memory leak in *netcdf-c/ncdump/utils.c*. I think introduced
by PR 2584.

## Misc. Other Changes
* Fixed references to *netcdf-c/docs/byterange.dox* ->  *netcdf-c/docs/byterange.md* (PR 2596).
2023-01-26 13:11:25 -07:00
Ward Fisher
78030b1be2 Update additional documentation infrastructure. 2023-01-24 14:46:33 -07:00
Ward Fisher
88fa7c7261 Remove internal flag from byterange documentation. 2023-01-23 10:10:07 -07:00
Dennis Heimbigner
d1d2808919 Additional DAP4 fixes
This change-set modifies PR https://github.com/Unidata/netcdf-c/pull/2555
to add the changes listed below. Most of these changes are required
by changes to the Java remotetest.unidata.ucar.edu server.

## DAP4 Related Changes
* Add tests *dap4_test/test_constraints.sh* and *dap4_test/test_hyrax.sh*.
* Provide explicit list of remotetest files to test.
* Cleanup local checksum computing and verification.
* Define a temporary Hyrax hack flag to deal with the way Hyrax handles checksums and add "#hyrax" fragment flag for it.
* Add a hack to get past an LGTM problem with using "http:".
* Improve debug support.

## Other Changes
* Cleanup the recipe in *docs/nczarr.md* for building *aws-sdk-cpp* library.
2023-01-18 19:47:29 -07:00
Dennis Heimbigner
9dfafe6c63 Bring up-to-date with main 2023-01-17 16:28:45 -07:00
Ward Fisher
b67583f0b1 Fix a doxygen warning-treated-as-error 2023-01-10 13:51:34 -08:00
Ward Fisher
00065451fc Merging https://github.com/Unidata/netcdf-c/pull/2583 manually into the v4.9.1 wellspring branch. 2023-01-10 13:42:41 -08:00
Ward Fisher
dd99d60294 Added another old static html page in preparation for updating. 2022-12-19 14:55:31 -07:00
Ward Fisher
9226b52ca5 Add an old static file. 2022-12-19 10:23:10 -07:00
Dennis Heimbigner
591e6b2f6d Fix DAP4 remotetest server
Warning: This PR is a follow on to PR https://github.com/Unidata/netcdf-c/pull/2555 and should not be merged until that prior PR has been merged. The changeset for this PR is a delta on the PR https://github.com/Unidata/netcdf-c/pull/2555.

This PR re-enables the use of the server *remotetest.unidata.ucar.edu/d4ts*
to test several features:
1. Show that access over the Internet to servers using the DAP4 protocol works.
2. Test that DAP4 support in the [Thredds Data Server](https://github.com/Unidata/tds) is operating correctly.
4. Test that the DAP4 support in the [netcdf-java library](https://github.com/Unidata/netcdf-java) library and the DAP4 support in the netcdf-c library are consistent and are interoperable.

The test inputs (primarily *\*.nc* files) provided in the netcdf-c library
are also used by the DAP4 Test Server (aka d4ts) to present web access to a
collection of data files accessible via the DAP4 protocol and which can be
used for testing Internet access to a working server.

To be precise, this version of d4ts is currently in unmerged branches
of the *netcdf-java* and *tds* Github repositories and so are not actually
in the main repositories *yet*. However, the *d4ts.war* file was created
from that branch and used to populate the *remotetest.unidata.ucar.edu*
server

The two other remote servers that were used in the past are *Hyrax* (OPenDAP.org)
and *thredds-test*. These will continue to remain disabled until
those servers can be fixed.

## Primary Changes

* Rebuild the *baselineremote* directory. This directory contains the validation data needed to test the remote servers.
* Re-enable using remotetest.unidata.ucar.edu as part of the DAP4 testing process.
* Fix the *dap4_test/test_remote.sh* test script to match the current available test data.
* Make some changes to libdap4 to improve the ability to catch malformed data streams [affects a lot of files in libdap4].

## Misc. Unrelated Changes

* Remove a raft of warnings, especially in nc_test4/tst_quantize.c.
* Add some additional explanatory information to the NCZarr documentation.
* Cleanup some Doxygen errors in the docs file and reorder some files.
2022-11-15 20:29:21 -07:00
Ward Fisher
87b50932de
Merge pull request #2530 from Unidata/v4.9.1-wellspring.wif
Merge subset of v4.9.1 files back into main development branch
2022-11-09 12:44:18 -07:00
Ward Fisher
39aeb2f30d
Merge branch 'v4.9.1-wellspring.wif' into filter_quickstart_guide.wif 2022-10-19 12:23:40 -06:00
Ward Fisher
ccd1e6a633 Updated for next release cycle. 2022-10-17 13:34:11 -06:00
DWesl
adde7f55ab BLD: Get CMake build compiling on Cygwin.
Mostly changing to Markdown files to a format Doxygen recognizes.
2022-10-12 13:00:03 -04:00
Ward Fisher
8f1d1034fb Further editing. 2022-10-11 16:17:29 -06:00
Ward Fisher
d28922a2f5 Continuing to flesh out the quick-start guide. 2022-10-11 11:15:06 -06:00
Ward Fisher
1ba435edd8 Working on filter quickstart document. 2022-10-06 15:34:08 -06:00
Ward Fisher
4eb601dbac Roughed in initial quickstart 2022-10-05 15:28:50 -06:00
Ward Fisher
a0184d7678 Working towards writing the quick start for plugins and integrating it into doxygen. 2022-10-05 13:31:49 -06:00
Ward Fisher
6754be1223 Add blank filter quickstart guide file. 2022-10-03 15:40:51 -06:00
Dennis Heimbigner
1a45ee025f Fix some addtional errors in NCZarr
re: Issue https://github.com/Unidata/netcdf-c/issues/2502

H/T Charlie Zender

* Fix NCZarr handling of endianness value NC_ENDIAN_NATIVE. This now matches how it is handled in libhdf5
* Fix NCZarr handling of char typed attribute with value "". This now matches how it is handled in libhdf5
* Add test for various char attribute values
* Change the mapping of NC_CHAR and NC_STRING to dtype; requires changing some test files also.
* Optimize the testing for NC_ENOTBUILT in NC_open.
* Turn off debugging left on accidentally
* Fix memory leak in tst_pnetcdf.c
* Fix blosc test
2022-09-09 14:25:24 -06:00
Ward Fisher
4fdfb6c911
Merge pull request #2501 from WardF/error-code-list.wif
Adding all-error-codes.md back in to distribution documentation.
2022-09-08 17:06:00 -06:00
Ward Fisher
9c09966896
Merge pull request #2482 from WardF/gh2481.wif
Changed attribute case in documentation
2022-09-08 16:38:29 -06:00
Ward Fisher
0c5fc4c2cd Doxygen update, reorganizing. 2022-09-08 16:36:53 -06:00
Ward Fisher
60552dbc65 Updating doxygen files. 2022-09-08 16:28:43 -06:00
Ward Fisher
6cf6677b2c Remove obsolete tags from Doxyfile. 2022-09-08 16:21:39 -06:00
Ward Fisher
0d24a1c278 Adding all-error-codes.md back in to distribution documentation. 2022-09-08 16:16:21 -06:00
Dennis Heimbigner
6abaab967b Fix some problems with PR https://github.com/Unidata/netcdf-c/pull/2492
re: PR https://github.com/Unidata/netcdf-c/pull/2492
re: Issue https://github.com/Unidata/netcdf-c/issues/2494

This PR fixes some problems with the pull request https://github.com/Unidata/netcdf-c/pull/2492 in response to Issue https://github.com/Unidata/netcdf-c/issues/2494.

* Found and fixed more scalar handling problems and add a test case for scalars.
* Cleanup nczarr_test/run_string.sh test
* Document *_nczarr_default_maxstrlen* and *_nczarr_maxstrlen*.

* Support both "Nan" and *Nan* as being floating point constants
  for attributes. It is unclear from the Zarr V2 spec if
  unquoted *Nan* is legal or not, but support for reading.
  Write the quoted versions when writing an attribute.  Similar
  for Infinity constants.
  So NCZarr supports the following constants for use in Attributes
    * *Nan*, "Nan", *-Nan*, "-Nan"
    * *Nanf*, "Nanf", *-Nanf*, "-Nanf"
    * *Infinity*, "Infinity", *-Infinity*, "-Infinity"
    * *Infinityf*, "Infinityf", *-Infinityf*, "-Infinityf"
2022-09-03 14:21:48 -06:00
Dennis Heimbigner
f4e181bc99 Update nczarr documentation 2022-08-29 12:01:23 -06:00
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