Skip to content

Add a way to automatically take train ID offsets into account #488

@philsmt

Description

@philsmt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions