Skip to content

Commit

Permalink
fix: address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Oct 17, 2023
1 parent 1e97b73 commit 9b51b47
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions docs/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following formats are being targeted:
Other formats can be used as well, assuming they support out-of-band data and
text attributes or files for the metadata.

## Drawbacks
## Caveats

This structure was based heavily on boost-histogram, but it is intended to be
general, and can be expanded in the future as needed. As such, the following
Expand All @@ -32,8 +32,8 @@ limitations are required:
lost, etc.
* Metadata must be expressible as JSON. It should also be reasonably sized; some
formats like HDF5 may limit the size of attributes to 64K.
* Floating point variations could be introduced in storages, as the storage
format uses a stable but different representation.
* Floating point errors could be incurred on conversion, as the storage format
uses a stable but different representation.
* Axis `name` is only part of the metadata, and is not standardized. This is
due to lack of support from boost-histogram.

Expand All @@ -49,15 +49,15 @@ The following axes types are supported:
is either an in-line list of numbers or a string pointing to an out-of-band data source.
Also has `underflow`, `overflow`, and `circular` properties. `circular`
defaults to False if not present.
* `"int_category"`: A list of integer bins, non-continuous. Has `categories`,
* `"category_int"`: A list of integer bins, non-continuous. Has `categories`,
which is an in-line list of integers. Also has `flow`.
* `"str_category"`: A list of string bins. Has `categories`,
* `"category_str"`: A list of string bins. Has `categories`,
which is an in-line list of strings. Also has `flow`.
* `"bool"`: A true/false axis.
* `"boolean"`: A true/false axis.

Axes with gaps are currently not supported.

All axes support `metadata`.
All axes support `metadata`, a string-valued dictionary of arbitrary, JSON-like data.

The following storages are supported:

Expand Down
12 changes: 6 additions & 6 deletions src/uhi/resources/histogram.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"oneOf": [
{ "$ref": "#/$defs/regular_axis" },
{ "$ref": "#/$defs/variable_axis" },
{ "$ref": "#/$defs/str_category_axis" },
{ "$ref": "#/$defs/int_category_axis" },
{ "$ref": "#/$defs/category_str_axis" },
{ "$ref": "#/$defs/category_int_axis" },
{ "$ref": "#/$defs/boolean_axis" }
]
}
Expand Down Expand Up @@ -101,13 +101,13 @@
}
}
},
"str_category_axis": {
"category_str_axis": {
"type": "object",
"description": "A set of string categorical bins.",
"required": ["type", "categories", "flow"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "str_category" },
"type": { "type": "string", "const": "category_str" },
"categories": {
"type": "array",
"items": { "type": "string" },
Expand All @@ -123,13 +123,13 @@
}
}
},
"int_category_axis": {
"category_int_axis": {
"type": "object",
"description": "A set of integer categorical bins in any order.",
"required": ["type", "categories", "flow"],
"additionalProperties": false,
"properties": {
"type": { "type": "string", "const": "int_category" },
"type": { "type": "string", "const": "category_int" },
"categories": {
"type": "array",
"items": { "type": "integer" },
Expand Down

0 comments on commit 9b51b47

Please sign in to comment.