DiamondLightSource / mx-bluesky

Bluesky plans, plan stubs, and utilities for MX beamlines
https://diamondlightsource.github.io/mx-bluesky/
Apache License 2.0
0 stars 2 forks source link

Update pydantic and ophyd_async to latest versions #456

Closed DominicOram closed 1 month ago

DominicOram commented 2 months ago

Fixes #454

Most changes should just be like for like behaviour. The only functional change should is that we now by default allow extra fields when constructing models. However, when doing the conversion in the external facing API we error if there are extra fields. Previously we would disallow extra fields but optionally change it at runtime in from_json. In pydantic 2 it is harder to change at runtime and we probably want to allow the flexibility by default so we can easily convert between parameter models. Ideally this would mean we can get rid of from_json but this proved a bit tricky so I spun into https://github.com/DiamondLightSource/mx-bluesky/issues/457.

Also needs https://github.com/DiamondLightSource/dodal/pull/779 from dodal

To test:

DominicOram commented 1 month ago

Looks OK I think. The linting is failing because of the recent change to detector.py in dodal. We just need to remove the line...

You mean like https://github.com/DiamondLightSource/mx-bluesky/pull/456/commits/04a006e38b309061983d9eb9fa23e55fafdcf631 ;)

DominicOram commented 1 month ago

I would still appreciate a review from others as it's a reasonably big change but I'm going to merge and we can spin out new issues if required so that we're back in sync with dodal

olliesilvester commented 1 month ago

Yeah, I wasn't 100% on why a few of the changes were made but they looked sensible enough