Skip to content

Commit

Permalink
fix: add is_standardized back temporarily (#304)
Browse files Browse the repository at this point in the history
fix: use is_standardized rather than is_canonical
  • Loading branch information
jgadling authored Oct 7, 2024
1 parent c65e2f6 commit dfe9a8b
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 54 deletions.

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.

2 changes: 1 addition & 1 deletion apiv2/database/models/tomogram.py

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

2 changes: 1 addition & 1 deletion apiv2/db_import/importers/tomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_computed_fields(self) -> dict[str, Any]:
"key_photo_thumbnail_url": None,
"neuroglancer_config": self.generate_neuroglancer_data(),
"type": self.get_tomogram_type(),
"is_canonical": self.metadata.get("is_standardized") or False,
"is_standardized": self.metadata.get("is_standardized") or False,
"is_portal_standard": self.metadata.get("is_standardized") or False,
}
date_fields = ["deposition_date", "release_date", "last_modified_date"]
Expand Down
6 changes: 3 additions & 3 deletions apiv2/db_import/tests/populate_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def populate_stale_tomogram_voxel_spacing(session: sa.orm.Session, run_id: int =
offset_y=0,
offset_z=0,
is_portal_standard=True,
is_canonical=True,
is_standardized=True,
deposition_date=datetime.min,
release_date=datetime.min,
last_modified_date=datetime.min,
Expand Down Expand Up @@ -291,7 +291,7 @@ def populate_tomograms(session: sa.orm.Session) -> Tomogram:
offset_y=0,
offset_z=0,
is_portal_standard=True,
is_canonical=True,
is_standardized=True,
deposition_date=datetime.min,
release_date=datetime.min,
last_modified_date=datetime.min,
Expand Down Expand Up @@ -325,7 +325,7 @@ def populate_stale_tomograms(session: sa.orm.Session) -> Tomogram:
offset_y=0,
offset_z=0,
is_portal_standard=True,
is_canonical=True,
is_standardized=True,
deposition_date=datetime.min,
release_date=datetime.min,
last_modified_date=datetime.min,
Expand Down
4 changes: 2 additions & 2 deletions apiv2/db_import/tests/test_db_tomo_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def expected_tomograms_by_run(http_prefix: str) -> dict[str, dict[float, list[di
"neuroglancer_config": '{"foo":"bar","baz":"test"}',
"deposition_id": 301,
"is_portal_standard": False,
"is_canonical": False,
"is_standardized": False,
"deposition_date": date(2023, 4, 2),
"release_date": date(2024, 6, 1),
"last_modified_date": date(2023, 9, 2),
Expand Down Expand Up @@ -117,7 +117,7 @@ def expected_tomograms_by_run(http_prefix: str) -> dict[str, dict[float, list[di
"neuroglancer_config": "{}",
"deposition_id": 300,
"is_portal_standard": False,
"is_canonical": False,
"is_standardized": False,
"deposition_date": date(2022, 4, 2),
"release_date": date(2022, 6, 1),
"last_modified_date": date(2022, 9, 2),
Expand Down
2 changes: 1 addition & 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.

14 changes: 7 additions & 7 deletions apiv2/graphql_api/schema.graphql

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

38 changes: 23 additions & 15 deletions apiv2/graphql_api/schema.json

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

18 changes: 6 additions & 12 deletions apiv2/graphql_api/types/tomogram.py

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

2 changes: 1 addition & 1 deletion apiv2/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Tomogram {
float tomogram_version
string processing_software
string reconstruction_software
boolean is_canonical
boolean is_standardized
boolean is_portal_standard
boolean is_author_submitted
boolean is_visualization_default
Expand Down
3 changes: 2 additions & 1 deletion apiv2/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2383,10 +2383,11 @@ classes:
range: string
required: true
description: Name of software used for reconstruction
is_canonical:
is_standardized:
description: whether this tomogram adheres to portal standards
range: boolean
ifabsent: false
required: true
is_portal_standard:
description: whether this tomogram adheres to portal standards
range: boolean
Expand Down
2 changes: 1 addition & 1 deletion apiv2/test_infra/factories/tomogram.py

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

4 changes: 2 additions & 2 deletions apiv2/validators/tomogram.py

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

0 comments on commit dfe9a8b

Please sign in to comment.