Skip to content

Commit cc5ae19

Browse files
committed
Merge release-2025.3.1
2 parents b4b6da3 + 9f0e5d7 commit cc5ae19

File tree

206 files changed

+14746
-2645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+14746
-2645
lines changed

.github/workflows/run-tests-on-push.yml

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,37 @@ env:
66
LOG_CONFIG: test
77

88
jobs:
9-
run-tests-3_9-core-dependencies:
9+
run-mypy-3_11:
1010
runs-on: ubuntu-latest
11-
name: Pytest on Core Dependencies-- Python 3.9
11+
name: MyPy checks on Python 3.11
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-python@v5
1515
with:
16-
python-version: "3.9"
17-
cache: 'pip'
18-
- run: pip install --upgrade pip
19-
- run: pip install poetry
20-
- run: poetry install --with dev
21-
- run: poetry run pytest tests/
22-
23-
run-tests-3_9:
24-
runs-on: ubuntu-latest
25-
name: Pytest on Optional Dependencies-- Python 3.9
26-
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: "3.9"
16+
python-version: "3.11"
3117
cache: 'pip'
3218
- run: sudo apt-get update
3319
- run: sudo apt-get install -y tabix
3420
- run: pip install --upgrade pip
3521
- run: pip install poetry
3622
- run: poetry install --with dev --extras server
37-
- run: poetry run pytest tests/ --show-capture=stdout --cov=src
38-
39-
run-tests-3_10-core-dependencies:
40-
runs-on: ubuntu-latest
41-
name: Pytest on Core Dependencies-- Python 3.10
42-
steps:
43-
- uses: actions/checkout@v4
44-
- uses: actions/setup-python@v5
45-
with:
46-
python-version: "3.10"
47-
cache: 'pip'
48-
- run: pip install --upgrade pip
49-
- run: pip install poetry
50-
- run: poetry install --with dev
51-
- run: poetry run pytest tests/
23+
- run: poetry run mypy src/
5224

53-
run-tests-3_10:
25+
run-ruff-lint:
5426
runs-on: ubuntu-latest
55-
name: Pytest on Optional Dependencies-- Python 3.10
27+
name: Ruff linting on Python 3.11
5628
steps:
5729
- uses: actions/checkout@v4
5830
- uses: actions/setup-python@v5
5931
with:
60-
python-version: "3.10"
32+
python-version: "3.11"
6133
cache: 'pip'
6234
- run: sudo apt-get update
6335
- run: sudo apt-get install -y tabix
6436
- run: pip install --upgrade pip
6537
- run: pip install poetry
6638
- run: poetry install --with dev --extras server
67-
- run: poetry run pytest tests/ --show-capture=stdout --cov=src
39+
- run: poetry run ruff check
6840

6941
run-tests-3_11-core-dependencies:
7042
runs-on: ubuntu-latest
@@ -96,30 +68,32 @@ jobs:
9668
- run: poetry install --with dev --extras server
9769
- run: poetry run pytest tests/ --show-capture=stdout --cov=src
9870

99-
run-mypy-3_10:
71+
run-tests-3_12-core-dependencies:
10072
runs-on: ubuntu-latest
101-
name: MyPy on Full Codebase-- Python 3.10
73+
name: Pytest on Core Dependencies-- Python 3.12
10274
steps:
10375
- uses: actions/checkout@v4
10476
- uses: actions/setup-python@v5
10577
with:
106-
python-version: "3.10"
78+
python-version: "3.12"
10779
cache: 'pip'
10880
- run: pip install --upgrade pip
10981
- run: pip install poetry
110-
- run: poetry install --with dev --extras server
111-
- run: poetry run mypy src/
82+
- run: poetry install --with dev
83+
- run: poetry run pytest tests/
11284

113-
run-ruff-lint:
85+
run-tests-3_12:
11486
runs-on: ubuntu-latest
115-
name: Ruff on Full Codebase-- Python 3.10
87+
name: Pytest on Optional Dependencies-- Python 3.12
11688
steps:
11789
- uses: actions/checkout@v4
11890
- uses: actions/setup-python@v5
11991
with:
120-
python-version: "3.10"
92+
python-version: "3.12"
12193
cache: 'pip'
94+
- run: sudo apt-get update
95+
- run: sudo apt-get install -y tabix
12296
- run: pip install --upgrade pip
12397
- run: pip install poetry
12498
- run: poetry install --with dev --extras server
125-
- run: poetry run ruff check
99+
- run: poetry run pytest tests/ --show-capture=stdout --cov=src

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# python-base
33
# Set up shared environment variables
44
################################
5-
FROM python:3.9 AS python-base
5+
FROM python:3.11 AS python-base
66

77
# Poetry
88
# https://python-poetry.org/docs/configuration/#using-environment-variables

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Or add `mavedb` to your Python project's dependencies.
2424

2525
### Prerequisites
2626

27-
- Python 3.9 or later
27+
- Python 3.11 or later
2828
- PIP
2929
- [Poetry](https://python-poetry.org/) for building and publishing distributions. For details on installing poetry, consult its [documentation](https://python-poetry.org/docs/#installation).
3030

alembic/manual_migrations/migrate_consolidated_score_ranges_and_calibrations.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ def do_migration(db: Session):
3636

3737
for score_set in score_sets_with_ranges_or_calibrations:
3838
if score_set.score_ranges is not None:
39-
investigator_ranges = InvestigatorScoreRangesCreate(**score_set.score_ranges)
39+
investigator_ranges = InvestigatorScoreRangesCreate(
40+
**score_set.score_ranges
41+
)
42+
for score_range in investigator_ranges.ranges:
43+
score_range.inclusive_lower_bound = False if score_range.range[0] is None else True
44+
score_range.inclusive_upper_bound = False
45+
4046
else:
4147
investigator_ranges = None
4248

@@ -60,6 +66,8 @@ def do_migration(db: Session):
6066
label=str(evidence_strength),
6167
evidence_strength=evidence_strength,
6268
positive_likelihood_ratio=positive_likelihood_ratio,
69+
inclusive_lower_bound=False,
70+
inclusive_upper_bound=False,
6371
))
6472
elif idx == len(thresholds) - 1:
6573
calculated_range = (threshold, None)
@@ -69,6 +77,8 @@ def do_migration(db: Session):
6977
evidence_strength=evidence_strength,
7078
label=str(evidence_strength),
7179
positive_likelihood_ratio=positive_likelihood_ratio,
80+
inclusive_lower_bound=True,
81+
inclusive_upper_bound=False,
7282
))
7383
else:
7484
if boundary_direction < 0:
@@ -82,6 +92,8 @@ def do_migration(db: Session):
8292
label=str(evidence_strength),
8393
evidence_strength=evidence_strength,
8494
positive_likelihood_ratio=positive_likelihood_ratio,
95+
inclusive_lower_bound=True,
96+
inclusive_upper_bound=False,
8597
))
8698

8799
# Set boundary_direction if the sign of evidence_strength flips compared to the next one
@@ -99,7 +111,7 @@ def do_migration(db: Session):
99111
score_set.score_ranges = ScoreSetRangesCreate(
100112
investigator_provided=investigator_ranges if investigator_ranges else None,
101113
pillar_project=pillar_project_ranges if pillar_project_ranges else None,
102-
).dict()
114+
).model_dump()
103115
db.add(score_set)
104116

105117

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""Make faf95_max and ancestry possibly nullable
2+
3+
Revision ID: 2b7a977e7e98
4+
Revises: a8e345cca190
5+
Create Date: 2025-08-21 10:08:58.565416
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = "2b7a977e7e98"
15+
down_revision = "a8e345cca190"
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.alter_column("gnomad_variants", "faf95_max", existing_type=sa.DOUBLE_PRECISION(precision=53), nullable=True)
23+
op.alter_column("gnomad_variants", "faf95_max_ancestry", existing_type=sa.VARCHAR(), nullable=True)
24+
# ### end Alembic commands ###
25+
26+
27+
def downgrade():
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.alter_column("gnomad_variants", "faf95_max_ancestry", existing_type=sa.VARCHAR(), nullable=False)
30+
op.alter_column("gnomad_variants", "faf95_max", existing_type=sa.DOUBLE_PRECISION(precision=53), nullable=False)
31+
# ### end Alembic commands ###
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""add uniprot id field for mapped metadata
2+
3+
Revision ID: 4b9fb51a460d
4+
Revises: aa3933cf0cb3
5+
Create Date: 2025-07-24 16:07:51.548202
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = "4b9fb51a460d"
15+
down_revision = "aa3933cf0cb3"
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("target_genes", sa.Column("uniprot_id_from_mapped_metadata", sa.String(), nullable=True))
23+
# ### end Alembic commands ###
24+
25+
26+
def downgrade():
27+
# ### commands auto generated by Alembic - please adjust! ###
28+
op.drop_column("target_genes", "uniprot_id_from_mapped_metadata")
29+
# ### end Alembic commands ###
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
"""add gnomad variants table
2+
3+
Revision ID: 79b28316dd0c
4+
Revises: 4b9fb51a460d
5+
Create Date: 2025-06-17 08:38:51.954238
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = "79b28316dd0c"
15+
down_revision = "4b9fb51a460d"
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.create_table(
23+
"gnomad_variants",
24+
sa.Column("id", sa.Integer(), nullable=False),
25+
sa.Column("db_name", sa.String(), nullable=False),
26+
sa.Column("db_identifier", sa.String(), nullable=False),
27+
sa.Column("db_version", sa.String(), nullable=False),
28+
sa.Column("allele_count", sa.Integer(), nullable=False),
29+
sa.Column("allele_number", sa.Integer(), nullable=False),
30+
sa.Column("allele_frequency", sa.Float(), nullable=False),
31+
sa.Column("faf95_max", sa.Float(), nullable=False),
32+
sa.Column("faf95_max_ancestry", sa.String(), nullable=False),
33+
sa.Column("creation_date", sa.Date(), nullable=False),
34+
sa.Column("modification_date", sa.Date(), nullable=False),
35+
sa.PrimaryKeyConstraint("id"),
36+
)
37+
op.create_index(op.f("ix_gnomad_variants_db_identifier"), "gnomad_variants", ["db_identifier"], unique=False)
38+
# ### end Alembic commands ###
39+
40+
41+
def downgrade():
42+
# ### commands auto generated by Alembic - please adjust! ###
43+
op.drop_index(op.f("ix_gnomad_variants_db_identifier"), table_name="gnomad_variants")
44+
op.drop_table("gnomad_variants")
45+
# ### end Alembic commands ###
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""Variant translations data model
2+
3+
Revision ID: 986b635a697f
4+
Revises: af87c9953d2d
5+
Create Date: 2025-03-24 14:00:18.063245
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = "986b635a697f"
15+
down_revision = "af87c9953d2d"
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.create_table(
23+
"variant_translations",
24+
sa.Column("aa_clingen_id", sa.String(), nullable=False),
25+
sa.Column("nt_clingen_id", sa.String(), nullable=False),
26+
sa.Column("creation_date", sa.Date(), nullable=False),
27+
sa.Column("modification_date", sa.Date(), nullable=False),
28+
sa.PrimaryKeyConstraint("aa_clingen_id", "nt_clingen_id"),
29+
)
30+
# ### end Alembic commands ###
31+
32+
33+
def downgrade():
34+
# ### commands auto generated by Alembic - please adjust! ###
35+
op.drop_table("variant_translations")
36+
# ### end Alembic commands ###
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
"""cast db_identifier in clinical controls table to a string
2+
3+
Revision ID: a8e345cca190
4+
Revises: 986b635a697f
5+
Create Date: 2025-08-20 12:30:05.388503
6+
7+
"""
8+
9+
from alembic import op
10+
import sqlalchemy as sa
11+
12+
13+
# revision identifiers, used by Alembic.
14+
revision = "a8e345cca190"
15+
down_revision = "986b635a697f"
16+
branch_labels = None
17+
depends_on = None
18+
19+
20+
def upgrade():
21+
# ### commands auto generated by Alembic - please adjust! ###
22+
op.alter_column(
23+
"clinical_controls", "db_identifier", existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=False
24+
)
25+
op.alter_column(
26+
"publication_identifiers", "title", existing_type=sa.TEXT(), type_=sa.String(), existing_nullable=False
27+
)
28+
op.alter_column(
29+
"publication_identifiers", "abstract", existing_type=sa.TEXT(), type_=sa.String(), existing_nullable=True
30+
)
31+
op.alter_column(
32+
"publication_identifiers",
33+
"publication_journal",
34+
existing_type=sa.TEXT(),
35+
type_=sa.String(),
36+
existing_nullable=True,
37+
)
38+
# ### end Alembic commands ###
39+
40+
41+
def downgrade():
42+
# ### commands auto generated by Alembic - please adjust! ###
43+
op.alter_column(
44+
"publication_identifiers",
45+
"publication_journal",
46+
existing_type=sa.String(),
47+
type_=sa.TEXT(),
48+
existing_nullable=True,
49+
)
50+
op.alter_column(
51+
"publication_identifiers", "abstract", existing_type=sa.String(), type_=sa.TEXT(), existing_nullable=True
52+
)
53+
op.alter_column(
54+
"publication_identifiers", "title", existing_type=sa.String(), type_=sa.TEXT(), existing_nullable=False
55+
)
56+
op.alter_column(
57+
"clinical_controls", "db_identifier", existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=False
58+
)
59+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)