DiamondLightSource / DiamondLightSource/mx-bluesky

Omega start degree must be int due to event model validation

Open
#1,631 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4
Forks
5
Avg merge
1d 30m
Merged PRs (30d)
2

Description

(Relevant after https://github.com/DiamondLightSource/mx-bluesky/pull/1623 is merged)

`kickoff_and_complete_gridscan` attaches an `omega_to_scan_spec` dictionary to document metadata which our ispyb callbacks later use. If we the keys in this dictionary to be a float, we get a jsonschema validation error (see bottom of this post).

For now this means the keys in this dictionary are cast to an int, even though we should eventually allow omega to be a float.

Perhaps in the meantime we should instead be requiring that `omega_starts_deg` is a list of integers?

```
File "/cache/venv-for/scratch/qqh35939/bluesky-development/mx-bluesky/lib/python3.14/site-packages/bluesky/run_engine.py", line 1880, in _open_run
new_uid = await current_run.open_run(msg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/cache/venv-for/scratch/qqh35939/bluesky-development/mx-bluesky/lib/python3.14/site-packages/bluesky/bundlers.py", line 131, in open_run
run = compose_run(uid=self._run_start_uid, event_counters=self._sequence_counters, metadata=self._md)
File "/cache/venv-for/scratch/qqh35939/bluesky-development/mx-bluesky/lib/python3.14/site-packages/event_model/__init__.py", line 2618, in compose_run
schema_validators[DocumentNames.start].validate(doc)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
File "/cache/venv-for/scratch/qqh35939/bluesky-development/mx-bluesky/lib/python3.14/site-packages/jsonschema/validators.py", line 450, in validate
raise error
jsonschema.exceptions.ValidationError: '0.0', '90.0' do not match any of the regexes: '^([^./]+)$'

Failed validating 'additionalProperties' in schema['patternProperties']['^([^./]+)$']:
{'title': 'data_type',
'patternProperties': {'^([^./]+)$': {'$ref': '#/$defs/DataType'}},
'additionalProperties': False,
'default': None}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.