(revision: Optional[str])
Defines the revision -> model mapping
Defines the revision -> model mapping
Defines the revision - > model mapping
def _model_from_revision(revision: Optional[str]) -> str:
        """Defines the revision -> model mapping"""
        if not revision or "v" not in revision:
            log.error(f"bad revision: {revision}")
            return "magneticModuleV1"
        try:
            revision_num = float(revision.split("v")[-1])
        except (ValueError, TypeError):
            log.exception("bad revision: {revision}")
            return "magneticModuleV1"
        if revision_num < MagDeck.FIRST_GEN2_REVISION:
            return "magneticModuleV1"
        else:
            return "magneticModuleV2"
def _model_from_revision ( revision : Optional [ str ] ) -> str : if not revision or "v" not in revision : log . error ( f"bad revision: {revision}" ) return "magneticModuleV1" try : revision_num = float ( revision . split ( "v" ) [ - 1 ] ) except ( ValueError , TypeError ) : log . exception ( "bad revision: {revision}" ) return "magneticModuleV1" if revision_num < MagDeck . FIRST_GEN2_REVISION : return "magneticModuleV1" else : return "magneticModuleV2"