Skip to content

Commit

Permalink
Remove deprecated Tomogram.is_standardized field
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadling committed Oct 10, 2024
1 parent eca7d59 commit a0f984c
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 133 deletions.
45 changes: 13 additions & 32 deletions apiv2/database/migrations/versions/20241010_135050_autogenerated.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apiv2/database/models/tomogram.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apiv2/db_import/common/finders.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import logging
import re
from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions apiv2/db_import/importers/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# s3_frame_path: str
# https_frame_path: str


class FrameItem(ItemDBImporter):
direct_mapped_fields = {}
id_fields = ["run_id", "s3_frame_path"]
Expand Down
1 change: 1 addition & 0 deletions apiv2/db_import/importers/gain.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# s3_file_path: str
# https_file_path: str


class GainItem(ItemDBImporter):
direct_mapped_fields = {}
id_fields = ["run_id", "s3_file_path"]
Expand Down
16 changes: 13 additions & 3 deletions apiv2/db_import/tests/test_frame_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,22 @@ def expected_frames(http_prefix: str) -> list[dict[str, Any]]:
},
]


@write_data
def populate_existing_frames(session: sa.orm.Session) -> models.Frame:
populate_run(session)
stale_frame = models.Frame(run_id=RUN1_ID, deposition_id = DEPOSITION_ID1, https_frame_path="STALE_FRAME", s3_frame_path="STALE_FRAME")
stale_frame = models.Frame(
run_id=RUN1_ID, deposition_id=DEPOSITION_ID1, https_frame_path="STALE_FRAME", s3_frame_path="STALE_FRAME",
)
session.add(stale_frame)
return models.Frame(id=333, run_id=RUN1_ID, deposition_id=DEPOSITION_ID1, s3_frame_path="s3://test-public-bucket/30001/RUN1/Frames/frame1", https_frame_path="https://foo.com/30001/RUN1/Frames/frame1")
return models.Frame(
id=333,
run_id=RUN1_ID,
deposition_id=DEPOSITION_ID1,
s3_frame_path="s3://test-public-bucket/30001/RUN1/Frames/frame1",
https_frame_path="https://foo.com/30001/RUN1/Frames/frame1",
)


# Tests addition of new frames, and updating entries already existing in db
def test_import_frames(
Expand All @@ -45,7 +55,7 @@ def test_import_frames(
sync_db_session.commit()
actual = verify_dataset_import(import_frames=True)
expected_iter = iter(expected_frames)
for run in [run for run in actual.runs if run.name == 'RUN1']:
for run in [run for run in actual.runs if run.name == "RUN1"]:
assert len(run.frames) == 2
assert run.frames[0].id == 333
for frame in run.frames:
Expand Down
11 changes: 9 additions & 2 deletions apiv2/db_import/tests/test_gain_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ def expected_gains(http_prefix: str) -> list[dict[str, Any]]:
},
]


@write_data
def populate_existing_gains(session: sa.orm.Session) -> models.GainFile:
populate_run(session)
stale_frame = models.GainFile(run_id=RUN1_ID, https_file_path="STALE_FRAME", s3_file_path="STALE_FRAME")
session.add(stale_frame)
return models.GainFile(id=333, run_id=RUN1_ID, s3_file_path="s3://test-public-bucket/30001/RUN1/Frames/run1_gain.mrc", https_file_path="meep")
return models.GainFile(
id=333,
run_id=RUN1_ID,
s3_file_path="s3://test-public-bucket/30001/RUN1/Frames/run1_gain.mrc",
https_file_path="meep",
)


# Tests addition of new gains, and updating entries already existing in db, and cleanup of old gains.
def test_import_gains(
Expand All @@ -44,7 +51,7 @@ def test_import_gains(
sync_db_session.commit()
actual = verify_dataset_import(import_gains=True)
expected_iter = iter(expected_gains)
for run in [run for run in actual.runs if run.name == 'RUN1']:
for run in [run for run in actual.runs if run.name == "RUN1"]:
assert len(run.gain_files) == 2
assert run.gain_files[0].id == 333
for gain in run.gain_files:
Expand Down
1 change: 0 additions & 1 deletion apiv2/graphql_api/helpers/tomogram.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions apiv2/graphql_api/schema.graphql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 0 additions & 65 deletions apiv2/graphql_api/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a0f984c

Please sign in to comment.