bluesky / event-model

data model for event-based data collection and analysis
https://blueskyproject.io/event-model
BSD 3-Clause "New" or "Revised" License
13 stars 29 forks source link

What should event counters do if seq_num is specified? #284

Closed coretl closed 9 months ago

coretl commented 11 months ago

In ComposeEvent: https://github.com/bluesky/event-model/blob/ef8ee4b6040e647883d8adbe6c5fa9da33ac984a/event_model/__init__.py#L2292-L2344

You can specify a seq_num, but the event counter is just incremented. Should it instead do self.event_counters[self.descriptor["name"]] = seq_num + 1? I don't know if seq_num is specified anywhere, I don't think it's used in the RunEngine

danielballan commented 11 months ago

Yes, I think the current implementation is a bug, and your proposal is correct.

I think this might potentially be useful in the context of testing, of creating particular document streams---for example, with repeated seq_num (indicated a "rewound" plan that re-took some data points) or with missing seq_num (not valid, but perhaps useful to construct to test failure modes).

evalott100 commented 10 months ago

This is handled in #272