wrap_plain_types_in_rootmodel now uses a subclass called LabThingsRootModelWrapper to make it explicit when things have been wrapped, and thus to make it easier to unwrap them. It would be worth looking through the code and checking the various places where that function is used to see if we can simplify the code.
Also, I think it would be possible to type hint wrap_plain_types_in_rootmodel such that it's clear to mypy that the return value is either type[Value] or type[RootModel[Value]]. That would make mypy super happy in certain places.
wrap_plain_types_in_rootmodelnow uses a subclass calledLabThingsRootModelWrapperto make it explicit when things have been wrapped, and thus to make it easier to unwrap them. It would be worth looking through the code and checking the various places where that function is used to see if we can simplify the code.Also, I think it would be possible to type hint
wrap_plain_types_in_rootmodelsuch that it's clear tomypythat the return value is eithertype[Value]ortype[RootModel[Value]]. That would makemypysuper happy in certain places.