mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-06 15:34:44 +08:00
74b40fd788
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
75 lines
2.6 KiB
C
75 lines
2.6 KiB
C
/*********************************************************************
|
|
* Copyright 2018, UCAR/Unidata
|
|
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
|
|
*********************************************************************/
|
|
#ifndef ZDEBUG_H
|
|
#define ZDEBUG_H
|
|
|
|
#undef ZDEBUG /* general debug */
|
|
#undef ZDEBUG1 /* detailed debug */
|
|
|
|
#undef ZCATCH /* Warning: significant performance impact */
|
|
#define ZTRACING /* Warning: significant performance impact */
|
|
|
|
#include "ncexternl.h"
|
|
#include "nclog.h"
|
|
|
|
#ifdef ZCATCH
|
|
/* Place breakpoint on zbreakpoint to catch errors close to where they occur*/
|
|
#define THROW(e) zthrow((e),__FILE__, __func__, __LINE__)
|
|
#define ZCHECK(e) if((e)) {THROW(stat); goto done;} else {}
|
|
EXTERNL int zbreakpoint(int err);
|
|
EXTERNL int zthrow(int err, const char* fname, const char* fcn, int line);
|
|
#else
|
|
#define ZCHECK(e) {if((e)) {goto done;}}
|
|
#define THROW(e) (e)
|
|
#endif
|
|
|
|
#ifdef ZTRACING
|
|
#define ZTRACE(level,fmt,...) nctrace((level),__func__,fmt,##__VA_ARGS__)
|
|
#define ZTRACEMORE(level,fmt,...) nctracemore((level),fmt,##__VA_ARGS__)
|
|
#define ZUNTRACE(e) ncuntrace(__func__,(e),NULL)
|
|
#define ZUNTRACEX(e,fmt,...) ncuntrace(__func__,(e),fmt,##__VA_ARGS__)
|
|
#else
|
|
#define ZTRACE(level,fmt,...)
|
|
#define ZTRACEMORE(level,fmt,...)
|
|
#define ZUNTRACE(e) (e)
|
|
#define ZUNTRACEX(e,fmt,...) (e)
|
|
#endif
|
|
|
|
/* printers */
|
|
EXTERNL void nczprint_reclaim(void);
|
|
EXTERNL char* nczprint_slice(NCZSlice);
|
|
EXTERNL char* nczprint_slices(int rank, const NCZSlice*);
|
|
EXTERNL char* nczprint_slab(int rank, const NCZSlice*);
|
|
EXTERNL char* nczprint_odom(const NCZOdometer*);
|
|
EXTERNL char* nczprint_chunkrange(const NCZChunkRange);
|
|
EXTERNL char* nczprint_projection(const NCZProjection);
|
|
EXTERNL char* nczprint_sliceprojections(const NCZSliceProjections);
|
|
EXTERNL char* nczprint_allsliceprojections(int r, const NCZSliceProjections* slp);
|
|
EXTERNL char* nczprint_slicex(const NCZSlice slice, int raw);
|
|
EXTERNL char* nczprint_slicesx(int rank, const NCZSlice* slices, int raw);
|
|
EXTERNL char* nczprint_projectionx(const NCZProjection proj, int raw);
|
|
EXTERNL char* nczprint_sliceprojectionsx(const NCZSliceProjections slp, int raw);
|
|
EXTERNL char* nczprint_vector(size_t,const size64_t*);
|
|
EXTERNL char* nczprint_idvector(size_t,const int*);
|
|
EXTERNL char* nczprint_sizevector(size_t,const size_t*);
|
|
EXTERNL char* nczprint_envv(const char** envv);
|
|
|
|
EXTERNL void zdumpcommon(const struct Common*);
|
|
|
|
/* Define the possible unit tests (powers of 2) */
|
|
#define UTEST_RANGE 1
|
|
#define UTEST_WALK 2
|
|
#define UTEST_TRANSFER 4
|
|
#define UTEST_WHOLECHUNK 8
|
|
|
|
struct ZUTEST {
|
|
int tests;
|
|
void (*print)(int sort,...);
|
|
};
|
|
EXTERNL struct ZUTEST* zutest;
|
|
|
|
#endif /*ZDEBUG_H*/
|
|
|