Skip to content

feat: use values for all types #152

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

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions docs/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ All axes support `metadata`, a string-valued dictionary of arbitrary, JSON-like

The following storages are supported:

* `"int"`: A collection of integers. Boost-histogram's `Int64` and `AtomicInt64`
* `"int"`: A collection of integers under `"value"`. Boost-histogram's `Int64` and `AtomicInt64`
map to this, and sometimes `Unlimited`.
* `"double"`: A collection of 64-bit floating point values. Boost-histogram's
* `"double"`: A collection of 64-bit floating point values under `"value"`. Boost-histogram's
`Double` storage maps to this, and sometimes `Unlimited`.
* `"weighted"`: A collection of two arrays of 64-bit floating point values,
`"value"` and `"variance"`. Boost-histogram's `Weight` storage maps to this.
Expand Down
20 changes: 17 additions & 3 deletions src/uhi/resources/histogram.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,16 @@
"oneOf": [
{
"type": "string",
"description": "A path (URI?) to the integer bin data."
"description": "A path (URI?) to the floating point bin data."
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "A path (URI?) to the floating point bin data."
"description": "A path (URI?) to the integer bin data."

Copy and paste mistake

},
{ "type": "array", "items": { "type": "integer" } }
{
"type": "object",
"required": ["values"],
"additionalProperties": false,
"properties": {
"values": { "type": "array", "items": { "type": "integer" } }
}
}
]
}
}
Expand All @@ -197,7 +204,14 @@
"type": "string",
"description": "A path (URI?) to the floating point bin data."
},
{ "type": "array", "items": { "type": "number" } }
{
"type": "object",
"required": ["values"],
"additionalProperties": false,
"properties": {
"values": { "type": "array", "items": { "type": "number" } }
}
}
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/reg.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"circular": false
}
],
"storage": { "type": "int", "data": [1, 2, 3, 4, 5] }
"storage": { "type": "int", "data": { "values": [1, 2, 3, 4, 5] } }
},
"two": {
"axes": [
Expand Down
Loading