Closed evalott100 closed 1 year ago
Currently, compose functions return documents (a dict), and partials of further compose functions, all inside a Bundle:
https://github.com/bluesky/event-model/blob/86474f030294436d33be4ce6d64082a2fc0a8913/event_model/__init__.py#L2180-#L2196
Instead of namedtuple run bundles, and partials, we should use dataclasses, and compose classes of the form
class ComposeDatum: resource: Resource counter: int def __call__(self, uid:str) -> Datum: return Datum(uid=uid, resource=self.resource) compose_datum = back_compat_wrapper(ComposeDatum) # back_compat_wrapper will make something like: # def compose_datum(resource, counter, uid) -> Datum: # return ComposeDatum(resource, counter)(uid)
Then nothing changes from the bluesky bundler level.
We should also change the DescriptorBundle to what is mentioned here.
DescriptorBundle
Currently, compose functions return documents (a dict), and partials of further compose functions, all inside a Bundle:
https://github.com/bluesky/event-model/blob/86474f030294436d33be4ce6d64082a2fc0a8913/event_model/__init__.py#L2180-#L2196
Instead of namedtuple run bundles, and partials, we should use dataclasses, and compose classes of the form
Then nothing changes from the bluesky bundler level.