At times, devices incur an offset between the train ID saved and the actual train ID the data belongs to. This can happen in particular for devices that synchronize the train ID in software rather than hardware, e.g. to integrate vendor software. While there is no easy automatic way to figure out this offset, once determined empirically it would be useful if EXtra-data provides a mechanism to automatically take this into account.
An easy way would simply be as part of the SourceData interface, e.g. some
class SourceData:
def with_train_offset(self, offset: int) -> SourceData:
Still, this makes matching such data to other sources with different or no offset hard, as this happens within DataCollection. Since a while DataCollection.select() actually accepts KeyData objects (which would also carry the offset). This should be extended to SourceData objects anyway, and could extract the offset this way for the selection.
At times, devices incur an offset between the train ID saved and the actual train ID the data belongs to. This can happen in particular for devices that synchronize the train ID in software rather than hardware, e.g. to integrate vendor software. While there is no easy automatic way to figure out this offset, once determined empirically it would be useful if EXtra-data provides a mechanism to automatically take this into account.
An easy way would simply be as part of the
SourceDatainterface, e.g. someStill, this makes matching such data to other sources with different or no offset hard, as this happens within
DataCollection. Since a whileDataCollection.select()actually acceptsKeyDataobjects (which would also carry the offset). This should be extended toSourceDataobjects anyway, and could extract the offset this way for the selection.