Skip to content

Commit 8b328d1

Browse files
authored
Merge pull request #2197 from DennisHeimbigner/zquantize.dmh
Add complete bitgroom support to NCZarr
2 parents a052420 + 610d8eb commit 8b328d1

55 files changed

Lines changed: 4166 additions & 3341 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run_tests_osx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
name: Run macOS-based netCDF Tests
88

99

10-
on: [ pull_request ]
10+
on: [pull_request]
1111

1212
jobs:
1313

.github/workflows/run_tests_ubuntu.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
name: Run Ubuntu/Linux netCDF Tests
66

7-
on: [ pull_request ]
8-
7+
on: [pull_request]
98

109
jobs:
1110

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.8.2 - TBD
99

10+
* [Enhancement] Add complete bitgroom support to NCZarr. See [Github #2197](https://github.com/Unidata/netcdf-c/pull/2197).
1011
* [Bug Fix] Clean up the handling of deeply nested VLEN types. Marks nc_free_vlen() and nc_free_string as deprecated in favor of ncaux_reclaim_data(). See [Github #2179(https://github.com/Unidata/netcdf-c/pull/2179).
1112
* [Bug Fix] Make sure that netcdf.h accurately defines the flags in the open/create mode flags. See [Github #2183](https://github.com/Unidata/netcdf-c/pull/2183).
1213
* [Enhancement] Improve support for msys2+mingw platform. See [Github #2171](https://github.com/Unidata/netcdf-c/pull/2171).

acinclude.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,4 @@ MOSTLYCLEANFILES += $(valgrind_log_files)
384384
AC_SUBST([VALGRIND_CHECK_RULES])
385385
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])])
386386
])
387+
AC_DEFUN([_AC_FINALIZE],[])

include/ncuri.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ EXTERNL int ncurisetquery(NCURI*,const char* query);
7979
/* Replace the fragment list */
8080
EXTERNL int ncurisetfragments(NCURI*, const char* fragments);
8181

82+
/* Rebuild the uri */
83+
EXTERNL int ncurirebuild(NCURI*);
84+
8285
/* Replace a specific &key=...& in uri fragment */
8386
EXTERNL int ncurisetfragmentkey(NCURI* duri,const char* key, const char* value);
8487

include/netcdf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ there. */
330330

331331
#define NC_NOQUANTIZE 0 /**< No quantization in use. */
332332
#define NC_QUANTIZE_BITGROOM 1 /**< Use BitGroom quantization. */
333-
#define NC_QUANTIZE_GRANULARBG 2 /**< Use Granular BitGroom quantization. */
333+
#define NC_QUANTIZE_GRANULARBR 2 /**< Use Granular BitRound quantization. */
334334

335335
/** When quantization is used for a variable, an attribute of the
336336
* appropriate name is added. */
337337
#define NC_QUANTIZE_BITGROOM_ATT_NAME "_QuantizeBitgroomNumberOfSignificantDigits"
338-
#define NC_QUANTIZE_GRANULARBG_ATT_NAME "_QuantizeGranularBitGroomNumberOfSignificantDigits"
338+
#define NC_QUANTIZE_GRANULARBR_ATT_NAME "_QuantizeGranularBitRoundNumberOfSignificantDigits"
339339

340340
/** For quantization, the allowed value of number of significant
341341
* digits for float. */

libdap4/ncd4dispatch.c

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,42 @@ NCD4_get_var_chunk_cache(int ncid, int p2, size_t* p3, size_t* p4, float* p5)
763763
return (ret);
764764
}
765765

766+
static int
767+
NCD4_inq_var_quantize(int ncid, int varid, int *quantize_modep, int *nsdp)
768+
{
769+
NC* ncp;
770+
int ret;
771+
int substrateid;
772+
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
773+
substrateid = makenc4id(ncp,ncid);
774+
ret = nc_inq_var_quantize(substrateid, varid, quantize_modep, nsdp);
775+
return (ret);
776+
}
777+
778+
static int
779+
NCD4_inq_var_filter_ids(int ncid, int varid, size_t* nfilters, unsigned int* filterids)
780+
{
781+
NC* ncp;
782+
int ret;
783+
int substrateid;
784+
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
785+
substrateid = makenc4id(ncp,ncid);
786+
ret = nc_inq_var_filter_ids(substrateid, varid, nfilters, filterids);
787+
return (ret);
788+
}
789+
790+
static int
791+
NCD4_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params)
792+
{
793+
NC* ncp;
794+
int ret;
795+
int substrateid;
796+
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
797+
substrateid = makenc4id(ncp,ncid);
798+
ret = nc_inq_var_filter_info(substrateid, varid, id, nparams, params);
799+
return (ret);
800+
}
801+
766802
/**************************************************/
767803
/*
768804
Following functions are overridden to handle
@@ -970,9 +1006,9 @@ NCD4_def_var_filter,
9701006
NCD4_set_var_chunk_cache,
9711007
NCD4_get_var_chunk_cache,
9721008

973-
NC_NOTNC4_inq_var_filter_ids,
974-
NC_NOTNC4_inq_var_filter_info,
1009+
NCD4_inq_var_filter_ids,
1010+
NCD4_inq_var_filter_info,
9751011

9761012
NC_NOTNC4_def_var_quantize,
977-
NC_NOTNC4_inq_var_quantize,
1013+
NCD4_inq_var_quantize,
9781014
};

0 commit comments

Comments
 (0)