From 395cd686cff18781a2c965d8ef2d7d366ffe8441 Mon Sep 17 00:00:00 2001 From: Bob Weigel Date: Mon, 6 Oct 2025 12:33:21 -0400 Subject: [PATCH 1/2] Update fill value specifications in HAPI data access Clarified requirements for fill values in JSON info header, including specifications for numeric representation and handling of NaN values. --- hapi-dev/HAPI-data-access-spec-dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi-dev/HAPI-data-access-spec-dev.md b/hapi-dev/HAPI-data-access-spec-dev.md index 347428e..4d9d01b 100644 --- a/hapi-dev/HAPI-data-access-spec-dev.md +++ b/hapi-dev/HAPI-data-access-spec-dev.md @@ -893,7 +893,7 @@ Note that the fill value in the bin centers column indicates that this `data3` a Recall that the static `centers` and `ranges` objects in the JSON `info` header cannot contain null or fill values. ### 3.6.9 fill Details -Note that fill values for all types must be specified as a string (not just as ASCII within the JSON, but as a literal JSON string inside quotes). For `double` and `integer` types, the string should correspond to a numeric value. In other words, using a string like `invalid_int` would not be allowed for an integer fill value. Care should be taken to ensure that the string value given will have an exact numeric representation and special care should be taken for `double` values, which can suffer from round-off problems. For integers, string fill values must correspond to an integer value small enough to fit into a 4-byte signed integer. For `double` parameters, the fill string must parse to an exact IEEE 754 double representation. One suggestion is to use large negative integers, such as `-1.0E30`. The string `NaN` is allowed, in which the case `csv` output should contain the string `NaN` for fill values. For `binary` data output with double NaN values, the bit pattern for quiet NaN should be used, as opposed to the signaling NaN, which should not be used (see [[6](#6-references)]). For `string` and `isotime` parameters, the string `fill` value is used at face value, and it should have a length that fits in the length of the data parameter. +Note that fill values for all types must be specified as a string (not just as ASCII within the JSON, but as a literal JSON string inside quotes). For `double` and `integer` types, the string should correspond to a numeric value. In other words, using a string like `invalid_int` would not be allowed for an integer fill value. Care should be taken to ensure that the string value given will have an exact numeric representation and special care should be taken for `double` values, which can suffer from round-off problems. For integers, string fill values must correspond to an integer value small enough to fit into a 4-byte signed integer. For `double` parameters, the fill string must parse to an exact IEEE 754 double representation. One suggestion is to use large negative integers, such as `-1.0E30`. The string `NaN` is allowed, in which the case `csv` output should contain the string `NaN` (no quotes) for fill values. For `binary` data output with double NaN values, the bit pattern for quiet NaN should be used, as opposed to the signaling NaN, which should not be used (see [[6](#6-references)]). (We recommend that HAPI clients that read `csv` accept `NaN`, `nan`, `"NaN"`, and `"nan"`, which are commonly used and interpreted by CSV parsing libraries; see [issue #62](https://github.com/hapi-server/data-specification/issues/262).) For `string` and `isotime` parameters, the string `fill` value is used at face value, and it should have a length that fits in the length of the data parameter. ### 3.6.10 units and label Array From 4e6e747da1f36e1309ae5022f5ca7df3657bcbc0 Mon Sep 17 00:00:00 2001 From: Bob Weigel Date: Mon, 6 Oct 2025 12:34:19 -0400 Subject: [PATCH 2/2] Update HAPI-data-access-spec-dev.md --- hapi-dev/HAPI-data-access-spec-dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi-dev/HAPI-data-access-spec-dev.md b/hapi-dev/HAPI-data-access-spec-dev.md index 4d9d01b..5847175 100644 --- a/hapi-dev/HAPI-data-access-spec-dev.md +++ b/hapi-dev/HAPI-data-access-spec-dev.md @@ -893,7 +893,7 @@ Note that the fill value in the bin centers column indicates that this `data3` a Recall that the static `centers` and `ranges` objects in the JSON `info` header cannot contain null or fill values. ### 3.6.9 fill Details -Note that fill values for all types must be specified as a string (not just as ASCII within the JSON, but as a literal JSON string inside quotes). For `double` and `integer` types, the string should correspond to a numeric value. In other words, using a string like `invalid_int` would not be allowed for an integer fill value. Care should be taken to ensure that the string value given will have an exact numeric representation and special care should be taken for `double` values, which can suffer from round-off problems. For integers, string fill values must correspond to an integer value small enough to fit into a 4-byte signed integer. For `double` parameters, the fill string must parse to an exact IEEE 754 double representation. One suggestion is to use large negative integers, such as `-1.0E30`. The string `NaN` is allowed, in which the case `csv` output should contain the string `NaN` (no quotes) for fill values. For `binary` data output with double NaN values, the bit pattern for quiet NaN should be used, as opposed to the signaling NaN, which should not be used (see [[6](#6-references)]). (We recommend that HAPI clients that read `csv` accept `NaN`, `nan`, `"NaN"`, and `"nan"`, which are commonly used and interpreted by CSV parsing libraries; see [issue #62](https://github.com/hapi-server/data-specification/issues/262).) For `string` and `isotime` parameters, the string `fill` value is used at face value, and it should have a length that fits in the length of the data parameter. +Note that fill values for all types must be specified as a string (not just as ASCII within the JSON, but as a literal JSON string inside quotes). For `double` and `integer` types, the string should correspond to a numeric value. In other words, using a string like `invalid_int` would not be allowed for an integer fill value. Care should be taken to ensure that the string value given will have an exact numeric representation and special care should be taken for `double` values, which can suffer from round-off problems. For integers, string fill values must correspond to an integer value small enough to fit into a 4-byte signed integer. For `double` parameters, the fill string must parse to an exact IEEE 754 double representation. One suggestion is to use large negative integers, such as `-1.0E30`. The string `NaN` is allowed, in which the case `csv` output should contain the string `NaN` (no quotes) for fill values. For `binary` data output with double NaN values, the bit pattern for quiet NaN should be used, as opposed to the signaling NaN, which should not be used (see [[6](#6-references)]). (We recommend that HAPI clients that read `csv` accept `NaN`, `nan`, `"NaN"`, and `"nan"`, which are commonly used and interpreted by CSV parsing libraries; see [issue #262](https://github.com/hapi-server/data-specification/issues/262).) For `string` and `isotime` parameters, the string `fill` value is used at face value, and it should have a length that fits in the length of the data parameter. ### 3.6.10 units and label Array