Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Minor tomogram table update #283

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions apiv2/database/migrations/versions/20240923_130016_autogenerated.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,52 @@
Create Date: 2024-09-23 17:00:19.130349

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = '20240923_130016'
down_revision = '20240828_194323'
revision = "20240923_130016"
down_revision = "20240828_194323"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('dataset', 'organism_name',
existing_type=sa.VARCHAR(),
nullable=True)
op.alter_column('tiltseries', 'microscope_manufacturer',
existing_type=sa.VARCHAR(length=4),
type_=sa.Enum('FEI', 'TFS', 'JEOL', 'SIMULATED', name='tiltseries_microscope_manufacturer_enum', native_enum=False),
existing_nullable=False)
op.alter_column("dataset", "organism_name", existing_type=sa.VARCHAR(), nullable=True)
op.alter_column(
"tiltseries",
"microscope_manufacturer",
existing_type=sa.VARCHAR(length=4),
type_=sa.Enum(
"FEI",
"TFS",
"JEOL",
"SIMULATED",
name="tiltseries_microscope_manufacturer_enum",
native_enum=False,
),
existing_nullable=False,
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('tiltseries', 'microscope_manufacturer',
existing_type=sa.Enum('FEI', 'TFS', 'JEOL', 'SIMULATED', name='tiltseries_microscope_manufacturer_enum', native_enum=False),
type_=sa.VARCHAR(length=4),
existing_nullable=False)
op.alter_column('dataset', 'organism_name',
existing_type=sa.VARCHAR(),
nullable=False)
op.alter_column(
"tiltseries",
"microscope_manufacturer",
existing_type=sa.Enum(
"FEI",
"TFS",
"JEOL",
"SIMULATED",
name="tiltseries_microscope_manufacturer_enum",
native_enum=False,
),
type_=sa.VARCHAR(length=4),
existing_nullable=False,
)
op.alter_column("dataset", "organism_name", existing_type=sa.VARCHAR(), nullable=False)
# ### end Alembic commands ###
1 change: 0 additions & 1 deletion apiv2/database/models/tomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class Tomogram(Base):
tomogram_version: Mapped[float] = mapped_column(Float, nullable=True)
processing_software: Mapped[str] = mapped_column(String, nullable=True)
reconstruction_software: Mapped[str] = mapped_column(String, nullable=False)
is_canonical: Mapped[bool] = mapped_column(Boolean, nullable=True)
s3_omezarr_dir: Mapped[str] = mapped_column(String, nullable=True)
https_omezarr_dir: Mapped[str] = mapped_column(String, nullable=True)
s3_mrc_file: Mapped[str] = mapped_column(String, nullable=True)
Expand Down
1 change: 0 additions & 1 deletion apiv2/graphql_api/helpers/tomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class TomogramGroupByOptions:
tomogram_version: Optional[float] = None
processing_software: Optional[str] = None
reconstruction_software: Optional[str] = None
is_canonical: Optional[bool] = None
s3_omezarr_dir: Optional[str] = None
https_omezarr_dir: Optional[str] = None
s3_mrc_file: Optional[str] = None
Expand Down
12 changes: 0 additions & 12 deletions apiv2/graphql_api/types/tomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ class TomogramWhereClause(TypedDict):
tomogram_version: Optional[FloatComparators] | None
processing_software: Optional[StrComparators] | None
reconstruction_software: Optional[StrComparators] | None
is_canonical: Optional[BoolComparators] | None
s3_omezarr_dir: Optional[StrComparators] | None
https_omezarr_dir: Optional[StrComparators] | None
s3_mrc_file: Optional[StrComparators] | None
Expand Down Expand Up @@ -276,7 +275,6 @@ class TomogramOrderByClause(TypedDict):
tomogram_version: Optional[orderBy] | None
processing_software: Optional[orderBy] | None
reconstruction_software: Optional[orderBy] | None
is_canonical: Optional[orderBy] | None
s3_omezarr_dir: Optional[orderBy] | None
https_omezarr_dir: Optional[orderBy] | None
s3_mrc_file: Optional[orderBy] | None
Expand Down Expand Up @@ -341,9 +339,6 @@ class Tomogram(EntityInterface):
description="Processing software used to derive the tomogram", default=None,
)
reconstruction_software: str = strawberry.field(description="Name of software used for reconstruction")
is_canonical: Optional[bool] = strawberry.field(
description="whether this tomogram is canonical for the run", default=None,
)
s3_omezarr_dir: Optional[str] = strawberry.field(
description="S3 path to this tomogram in multiscale OME-Zarr format", default=None,
)
Expand Down Expand Up @@ -467,7 +462,6 @@ class TomogramCountColumns(enum.Enum):
tomogramVersion = "tomogram_version"
processingSoftware = "processing_software"
reconstructionSoftware = "reconstruction_software"
isCanonical = "is_canonical"
s3OmezarrDir = "s3_omezarr_dir"
httpsOmezarrDir = "https_omezarr_dir"
s3MrcFile = "s3_mrc_file"
Expand Down Expand Up @@ -552,9 +546,6 @@ class TomogramCreateInput:
description="Processing software used to derive the tomogram", default=None,
)
reconstruction_software: str = strawberry.field(description="Name of software used for reconstruction")
is_canonical: Optional[bool] = strawberry.field(
description="whether this tomogram is canonical for the run", default=None,
)
s3_omezarr_dir: Optional[str] = strawberry.field(
description="S3 path to this tomogram in multiscale OME-Zarr format", default=None,
)
Expand Down Expand Up @@ -620,9 +611,6 @@ class TomogramUpdateInput:
description="Processing software used to derive the tomogram", default=None,
)
reconstruction_software: Optional[str] = strawberry.field(description="Name of software used for reconstruction")
is_canonical: Optional[bool] = strawberry.field(
description="whether this tomogram is canonical for the run", default=None,
)
s3_omezarr_dir: Optional[str] = strawberry.field(
description="S3 path to this tomogram in multiscale OME-Zarr format", default=None,
)
Expand Down
5 changes: 0 additions & 5 deletions apiv2/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2326,11 +2326,6 @@ classes:
range: string
required: true
description: Name of software used for reconstruction
is_canonical:
name: is_canonical
description: whether this tomogram is canonical for the run
from_schema: cdp-dataset-config
range: boolean
s3_omezarr_dir:
name: s3_omezarr_dir
description: S3 path to this tomogram in multiscale OME-Zarr format
Expand Down
1 change: 0 additions & 1 deletion apiv2/test_infra/factories/tomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class Meta:
tomogram_version = fuzzy.FuzzyFloat(1, 100)
processing_software = fuzzy.FuzzyText()
reconstruction_software = fuzzy.FuzzyText()
is_canonical = factory.Faker("boolean")
s3_omezarr_dir = fuzzy.FuzzyText()
https_omezarr_dir = fuzzy.FuzzyText()
s3_mrc_file = fuzzy.FuzzyText()
Expand Down
2 changes: 0 additions & 2 deletions apiv2/validators/tomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class TomogramCreateInputValidator(BaseModel):
strip_whitespace=True,
),
]
is_canonical: Annotated[bool | None, Field()]
s3_omezarr_dir: Annotated[
str | None,
StringConstraints(
Expand Down Expand Up @@ -190,7 +189,6 @@ class TomogramUpdateInputValidator(BaseModel):
strip_whitespace=True,
),
]
is_canonical: Annotated[bool | None, Field()]
s3_omezarr_dir: Annotated[
str | None,
StringConstraints(
Expand Down
Loading