Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add complete bitgroom support to NCZarr #2197

Merged
merged 4 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name: Run macOS-based netCDF Tests


on: [ pull_request ]
on: [pull_request]

jobs:

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_tests_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

name: Run Ubuntu/Linux netCDF Tests

on: [ pull_request ]

on: [pull_request]

jobs:

Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release

## 4.8.2 - TBD

* [Enhancement] Add complete bitgroom support to NCZarr. See [Github #2197](https://github.com/Unidata/netcdf-c/pull/2197).
* [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).
* [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).
* [Enhancement] Improve support for msys2+mingw platform. See [Github #2171](https://github.com/Unidata/netcdf-c/pull/2171).
Expand Down
1 change: 1 addition & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,4 @@ MOSTLYCLEANFILES += $(valgrind_log_files)
AC_SUBST([VALGRIND_CHECK_RULES])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])])
])
AC_DEFUN([_AC_FINALIZE],[])
3 changes: 3 additions & 0 deletions include/ncuri.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ EXTERNL int ncurisetquery(NCURI*,const char* query);
/* Replace the fragment list */
EXTERNL int ncurisetfragments(NCURI*, const char* fragments);

/* Rebuild the uri */
EXTERNL int ncurirebuild(NCURI*);

/* Replace a specific &key=...& in uri fragment */
EXTERNL int ncurisetfragmentkey(NCURI* duri,const char* key, const char* value);

Expand Down
4 changes: 2 additions & 2 deletions include/netcdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ there. */

#define NC_NOQUANTIZE 0 /**< No quantization in use. */
#define NC_QUANTIZE_BITGROOM 1 /**< Use BitGroom quantization. */
#define NC_QUANTIZE_GRANULARBG 2 /**< Use Granular BitGroom quantization. */
#define NC_QUANTIZE_GRANULARBR 2 /**< Use Granular BitRound quantization. */

/** When quantization is used for a variable, an attribute of the
* appropriate name is added. */
#define NC_QUANTIZE_BITGROOM_ATT_NAME "_QuantizeBitgroomNumberOfSignificantDigits"
#define NC_QUANTIZE_GRANULARBG_ATT_NAME "_QuantizeGranularBitGroomNumberOfSignificantDigits"
#define NC_QUANTIZE_GRANULARBR_ATT_NAME "_QuantizeGranularBitRoundNumberOfSignificantDigits"

/** For quantization, the allowed value of number of significant
* digits for float. */
Expand Down
42 changes: 39 additions & 3 deletions libdap4/ncd4dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,42 @@ NCD4_get_var_chunk_cache(int ncid, int p2, size_t* p3, size_t* p4, float* p5)
return (ret);
}

static int
NCD4_inq_var_quantize(int ncid, int varid, int *quantize_modep, int *nsdp)
{
NC* ncp;
int ret;
int substrateid;
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
substrateid = makenc4id(ncp,ncid);
ret = nc_inq_var_quantize(substrateid, varid, quantize_modep, nsdp);
return (ret);
}

static int
NCD4_inq_var_filter_ids(int ncid, int varid, size_t* nfilters, unsigned int* filterids)
{
NC* ncp;
int ret;
int substrateid;
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
substrateid = makenc4id(ncp,ncid);
ret = nc_inq_var_filter_ids(substrateid, varid, nfilters, filterids);
return (ret);
}

static int
NCD4_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params)
{
NC* ncp;
int ret;
int substrateid;
if((ret = NC_check_id(ncid, (NC**)&ncp)) != NC_NOERR) return (ret);
substrateid = makenc4id(ncp,ncid);
ret = nc_inq_var_filter_info(substrateid, varid, id, nparams, params);
return (ret);
}

/**************************************************/
/*
Following functions are overridden to handle
Expand Down Expand Up @@ -970,9 +1006,9 @@ NCD4_def_var_filter,
NCD4_set_var_chunk_cache,
NCD4_get_var_chunk_cache,

NC_NOTNC4_inq_var_filter_ids,
NC_NOTNC4_inq_var_filter_info,
NCD4_inq_var_filter_ids,
NCD4_inq_var_filter_info,

NC_NOTNC4_def_var_quantize,
NC_NOTNC4_inq_var_quantize,
NCD4_inq_var_quantize,
};
Loading