Skip to content

Commit

Permalink
Merge pull request #275 from bluesky/fix-nullable-units
Browse files Browse the repository at this point in the history
Allow descriptor units to be null
  • Loading branch information
danielballan authored Jun 23, 2023
2 parents d71e567 + 217eee5 commit 524f70d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion event_model/documents/event_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class Configuration(TypedDict):
"title": "DataType",
"patternProperties": {"^([^./]+)$": {"$ref": "#/definitions/DataType"}},
"additionalProperties": False,
}
},
"DataKey": {"properties": {"units": {"type": ["string", "null"]}}},
},
"additionalProperties": False,
}
Expand Down
5 changes: 4 additions & 1 deletion event_model/schemas/event_descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@
"units": {
"title": "Units",
"description": "Engineering units of the value",
"type": "string"
"type": [
"string",
"null"
]
}
},
"required": [
Expand Down
2 changes: 1 addition & 1 deletion event_model/tests/test_em.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_compose_run():
assert bundle.compose_stop is compose_stop
bundle = compose_descriptor(
data_keys={
"motor": {"shape": [], "dtype": "number", "source": "..."},
"motor": {"shape": [], "dtype": "number", "source": "...", "units": None},
"image": {
"shape": [512, 512],
"dtype": "number",
Expand Down

0 comments on commit 524f70d

Please sign in to comment.