From cd632e64fb7d62c37e6c090ae134573a94395780 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 11 Apr 2016 19:43:31 -0700 Subject: [PATCH 1/2] Close #219 SDC GlobalAttibute Path to "/" Close #219 by letting the `SerialDataCollector` write to `/` by default, too. Follow-up to the change in `1.3.0` for the PDC (see #173). Needed by several users to fulfill the `openPMD` standard with serial files where they actually want to write to pathes starting from `/`. --- src/DCGroup.cpp | 4 +++- src/include/splash/sdc_defines.hpp | 2 +- tests/readBoolChar.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/DCGroup.cpp b/src/DCGroup.cpp index bc4a996..512b9d1 100644 --- a/src/DCGroup.cpp +++ b/src/DCGroup.cpp @@ -103,8 +103,10 @@ namespace splash throw (DCException) { H5Handle newHandle; + const bool is_basepath(path == std::string("/")); - if (checkExistence && !H5Lexists(base, path.c_str(), H5P_DEFAULT)) + if (checkExistence && !H5Lexists(base, path.c_str(), H5P_DEFAULT) && + !is_basepath) throw DCException(getExceptionString("Failed to open group", path)); newHandle = H5Gopen(base, path.c_str(), H5P_DEFAULT); diff --git a/src/include/splash/sdc_defines.hpp b/src/include/splash/sdc_defines.hpp index d81c1f0..d5c0568 100644 --- a/src/include/splash/sdc_defines.hpp +++ b/src/include/splash/sdc_defines.hpp @@ -28,7 +28,7 @@ namespace splash #define SDC_GROUP_HEADER "/header" #define SDC_GROUP_DATA "/data" #define SDC_GROUP_ITERATION "iteration" -#define SDC_GROUP_CUSTOM "/custom" +#define SDC_GROUP_CUSTOM "/" #define SDC_ATTR_DIM_LOCAL "dim_local" #define SDC_ATTR_DIM_GLOBAL "dim_global" #define SDC_ATTR_MAX_ID "max_id" diff --git a/tests/readBoolChar.py b/tests/readBoolChar.py index 705ea55..ebabea3 100755 --- a/tests/readBoolChar.py +++ b/tests/readBoolChar.py @@ -52,7 +52,7 @@ f = h5py.File("h5/attributes_array_0_0_0.h5", "r") # array attributes -dg = f["custom"].attrs["testposition"] +dg = f.attrs["testposition"] print(dg, type(dg), dg.dtype) ref_dg = np.array([17, 12, -99], dtype="int") From 7d6fd1add03ce015959b7780706f33aaa4590959 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 11 Apr 2016 21:50:13 -0700 Subject: [PATCH 2/2] ChangeLog: 1.4.0 Release - SDC global Attributes Interface change for `SerialDataCollector` (SDC): reading old files needs manual tuning for global attributes: API increased to `1.4.0` and file format bumped to `4.0` since the changes in SDC are not backwards compatible. --- CHANGELOG.md | 13 +++++++++++++ src/include/splash/version.hpp | 10 +++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 079df96..98db746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ Change Log for libSplash ================================================================ +Release 1.4.0 +------------- +**Date:** 2016-04-12 + +The `SerialDataCollector` now also writes global attributes +to `/`, allowing serial files to fulfill the openPMD standard. + +**Interface Changes** + + - `SerialDataCollector::writeGlobalAttribute` now writes to `/` + instead of `/custom` (follow-up to #182) #229 + + Release 1.3.1 ------------- **Date:** 2016-04-12 diff --git a/src/include/splash/version.hpp b/src/include/splash/version.hpp index 22bfd09..0ac255f 100644 --- a/src/include/splash/version.hpp +++ b/src/include/splash/version.hpp @@ -1,5 +1,5 @@ /** - * Copyright 2013-2015 Felix Schmitt, Axel Huebl + * Copyright 2013-2016 Felix Schmitt, Axel Huebl * * This file is part of libSplash. * @@ -25,14 +25,14 @@ /** the splash version reflects the changes in API */ #define SPLASH_VERSION_MAJOR 1 -#define SPLASH_VERSION_MINOR 3 -#define SPLASH_VERSION_PATCH 1 +#define SPLASH_VERSION_MINOR 4 +#define SPLASH_VERSION_PATCH 0 /** we can always handle files from the same major release * changes in the minor number have to be backwards compatible */ -#define SPLASH_FILE_FORMAT_MAJOR 3 -#define SPLASH_FILE_FORMAT_MINOR 3 +#define SPLASH_FILE_FORMAT_MAJOR 4 +#define SPLASH_FILE_FORMAT_MINOR 0 /** The version of HDF5 that was used to compile splash */ #define SPLASH_HDF5_VERSION "${HDF5_VERSION}"