Skip to content

Commit fe5b29d

Browse files
committed
Add all ACMG evidence codes, make OddsPath evidence optional
1 parent 3f119b9 commit fe5b29d

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/mavedb/view_models/odds_path.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Literal
1+
from typing import Literal, Optional
22
from pydantic import validator
33

44
from mavedb.view_models import record_type_validator, set_record_type
@@ -7,7 +7,18 @@
77

88
class OddsPathBase(BaseModel):
99
ratio: float
10-
evidence: Literal["BS3_STRONG", "PS3_STRONG"]
10+
evidence: Optional[
11+
Literal[
12+
"BS3_STRONG",
13+
"BS3_MODERATE",
14+
"BS3_SUPPORTING",
15+
"INDETERMINATE",
16+
"PS3_VERY_STRONG",
17+
"PS3_STRONG",
18+
"PS3_MODERATE",
19+
"PS3_SUPPORTING",
20+
]
21+
] = None
1122

1223

1324
class OddsPathModify(OddsPathBase):

tests/view_models/test_odds_path.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ def test_odds_path_base_valid_data(valid_data):
1313
assert odds_path.evidence == valid_data["evidence"]
1414

1515

16+
def test_odds_path_base_no_evidence():
17+
odds_with_no_evidence = TEST_BS3_ODDS_PATH.copy()
18+
odds_with_no_evidence["evidence"] = None
19+
20+
odds_path = OddsPathBase(**odds_with_no_evidence)
21+
assert odds_path.ratio == odds_with_no_evidence["ratio"]
22+
assert odds_path.evidence is None
23+
24+
1625
@pytest.mark.parametrize("valid_data", [TEST_BS3_ODDS_PATH, TEST_PS3_ODDS_PATH])
1726
def test_odds_path_base_invalid_data(valid_data):
1827
odds_path = OddsPathModify(**valid_data)

0 commit comments

Comments
 (0)