Skip to content

Commit

Permalink
remove support types and rely on EvidenceType Value error
Browse files Browse the repository at this point in the history
  • Loading branch information
tab-cmd committed Oct 29, 2024
1 parent 3dd8822 commit d243c04
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions bcipy/simulator/task/copy_phrase.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,23 @@
from bcipy.task.paradigm.rsvp.copy_phrase import RSVPCopyPhraseTask

DEFAULT_EVIDENCE_TYPE = EvidenceType.ERP
SUPPORTED_EVIDENCE_TYPES = {EvidenceType.ERP.value}


def get_evidence_type(model: SignalModel) -> EvidenceType:
"""Get the evidence type provided by the given model and return it as an enum (EvidenceType).
If the model does not provide an evidence type, the default evidence type is returned.
If the model does not provide an evidence type, the default evidence type is returned (ERP).
"""
evidence_type = model.metadata.evidence_type

# Note: once more than one evidence type is supported, this should be updated to throw an error
if not evidence_type:
return DEFAULT_EVIDENCE_TYPE

# Check if the evidence type is supported
if evidence_type not in SUPPORTED_EVIDENCE_TYPES:
raise ValueError(f"Unsupported evidence type: {evidence_type}. Supported types: {SUPPORTED_EVIDENCE_TYPES}")

# Return the evidence type as an enum
else:
try:
return EvidenceType(evidence_type)
except ValueError:
raise ValueError(f"Unsupported evidence type: {evidence_type}. Supported types: {EvidenceType.list()}")


class SimulatorCopyPhraseTask(RSVPCopyPhraseTask):
Expand Down

0 comments on commit d243c04

Please sign in to comment.