Skip to content

Commit d0fcff1

Browse files
committed
Remove 'name' field and add 'notes' field to score calibrations
1 parent 6c77410 commit d0fcff1

File tree

5 files changed

+33
-11
lines changed

5 files changed

+33
-11
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""remove name add notes to calibrations
2+
3+
Revision ID: 8886f0453125
4+
Revises: f5a72192fafd
5+
Create Date: 2025-10-19 13:21:14.338094
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = "8886f0453125"
15+
down_revision = "f5a72192fafd"
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.add_column("score_calibrations", sa.Column("notes", sa.String(), nullable=True))
23+
op.drop_column("score_calibrations", "name")
24+
# ### end Alembic commands ###
25+
26+
27+
def downgrade():
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.add_column("score_calibrations", sa.Column("name", sa.VARCHAR(), autoincrement=False, nullable=False))
30+
op.drop_column("score_calibrations", "notes")
31+
# ### end Alembic commands ###

src/mavedb/models/score_calibration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class ScoreCalibration(Base):
3131
score_set: Mapped["ScoreSet"] = relationship("ScoreSet", back_populates="score_calibrations")
3232

3333
title = Column(String, nullable=False)
34-
name = Column(String, nullable=False)
3534
research_use_only = Column(Boolean, nullable=False, default=False)
3635
primary = Column(Boolean, nullable=False, default=False)
3736
investigator_provided = Column(Boolean, nullable=False, default=False)
3837
private = Column(Boolean, nullable=False, default=True)
38+
notes = Column(String, nullable=True)
3939

4040
baseline_score = Column(Float, nullable=True)
4141
baseline_score_description = Column(String, nullable=True)

src/mavedb/view_models/score_calibration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ class ScoreCalibrationBase(BaseModel):
178178
"""
179179

180180
title: str
181-
name: str
182181
investigator_provided: bool
183182
research_use_only: bool = False
184183

185184
baseline_score: Optional[float] = None
186185
baseline_score_description: Optional[str] = None
186+
notes: Optional[str] = None
187187

188188
functional_ranges: Optional[Sequence[FunctionalRangeBase]] = None
189189
threshold_sources: Optional[Sequence[PublicationIdentifierBase]] = None

tests/helpers/constants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,6 @@
14851485

14861486
TEST_BRNICH_SCORE_CALIBRATION = {
14871487
"title": "Test BRNICH Score Calibration",
1488-
"name": "brnich_style",
14891488
"research_use_only": False,
14901489
"investigator_provided": False,
14911490
"baseline_score": TEST_BASELINE_SCORE,
@@ -1542,19 +1541,16 @@
15421541

15431542
TEST_INVESTIGATOR_PROVIDED_SCORE_CALIBRATION = {
15441543
**TEST_BRNICH_SCORE_CALIBRATION,
1545-
"name": "investigator_provided",
15461544
"investigator_provided": True,
15471545
}
15481546

15491547
TEST_SAVED_INVESTIGATOR_PROVIDED_SCORE_CALIBRATION = {
15501548
**TEST_SAVED_BRNICH_SCORE_CALIBRATION,
1551-
"name": "investigator_provided",
15521549
"investigatorProvided": True,
15531550
}
15541551

15551552
TEST_PATHOGENICITY_SCORE_CALIBRATION = {
15561553
"title": "Test Pathogenicity Score Calibration",
1557-
"name": "pathogenicity",
15581554
"research_use_only": False,
15591555
"investigator_provided": False,
15601556
"baseline_score": TEST_BASELINE_SCORE,

tests/view_models/test_score_calibration.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ def test_can_create_valid_score_calibration(valid_calibration):
173173
sc = ScoreCalibrationCreate.model_validate(valid_calibration)
174174

175175
assert sc.title == valid_calibration["title"]
176-
assert sc.name == valid_calibration["name"]
177176
assert sc.research_use_only == valid_calibration.get("research_use_only", False)
178177
assert sc.investigator_provided == valid_calibration.get("investigator_provided", False)
179178
assert sc.baseline_score == valid_calibration.get("baseline_score")
@@ -225,7 +224,6 @@ def test_can_create_valid_score_calibration_without_functional_ranges(valid_cali
225224
sc = ScoreCalibrationCreate.model_validate(valid_calibration)
226225

227226
assert sc.title == valid_calibration["title"]
228-
assert sc.name == valid_calibration["name"]
229227
assert sc.research_use_only == valid_calibration.get("research_use_only", False)
230228
assert sc.investigator_provided == valid_calibration.get("investigator_provided", False)
231229
assert sc.baseline_score == valid_calibration.get("baseline_score")
@@ -336,7 +334,6 @@ def test_can_create_valid_score_calibration_from_attributed_object(valid_calibra
336334
sc = ScoreCalibration.model_validate(dummy_attributed_object_from_dict(valid_calibration))
337335

338336
assert sc.title == valid_calibration["title"]
339-
assert sc.name == valid_calibration["name"]
340337
assert sc.research_use_only == valid_calibration.get("researchUseOnly", False)
341338
assert sc.primary == valid_calibration.get("primary", True)
342339
assert sc.investigator_provided == valid_calibration.get("investigatorProvided", False)
@@ -411,7 +408,6 @@ def test_can_create_score_calibration_from_association_style_publication_identif
411408
sc = ScoreCalibration.model_validate(dummy_attributed_object_from_dict(data))
412409

413410
assert sc.title == orig_data["title"]
414-
assert sc.name == orig_data["name"]
415411
assert sc.research_use_only == orig_data.get("research_use_only", False)
416412
assert sc.primary == orig_data.get("primary", False)
417413
assert sc.investigator_provided == orig_data.get("investigator_provided", False)
@@ -474,7 +470,6 @@ def test_score_calibration_with_score_set_urn_can_be_created_from_attributed_obj
474470
sc = ScoreCalibrationWithScoreSetUrn.model_validate(dummy_attributed_object_from_dict(data))
475471

476472
assert sc.title == data["title"]
477-
assert sc.name == data["name"]
478473
assert sc.score_set_urn == data["score_set"].urn
479474

480475

0 commit comments

Comments
 (0)