Skip to content

Commit

Permalink
Lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgadling committed Oct 17, 2024
1 parent 0f6435f commit cf871d8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 41 deletions.
2 changes: 1 addition & 1 deletion client/python/cryoet_data_portal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := /bin/bash
export BACKEND_DIR=/tmp/cryoet-data-portal-backend-test-infra
.PHONY: set-api-version
set-api-version:
if [ ! -e $(BACKEND_DIR) ]; then git clone git@github.com:chanzuckerberg/cryoet-data-portal-backend.git $(BACKEND_DIR); fi
if [ ! -e $(BACKEND_DIR) ]; then git clone https://github.com/chanzuckerberg/cryoet-data-portal-backend.git $(BACKEND_DIR); fi
export STAGING_SHA=$$(./tests/test_infra/get_deployment.sh staging); \
if [ -n "$${STAGING_SHA}" ]; then \
echo "Setting backend to SHA: $${STAGING_SHA}"; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ def __init__(self, url: Optional[str] = None):
self.ds = DSLSchema(self.client.schema)

def build_query(
self, cls, root_field: str, gql_class_name: str, query_filters=None,
self,
cls,
root_field: str,
gql_class_name: str,
query_filters=None,
):
ds = self.ds
query_filters = {} if not query_filters else {"where": query_filters}
Expand Down
6 changes: 4 additions & 2 deletions client/python/cryoet_data_portal/tests/test_get_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def test_relationships_reverse(client) -> None:

def test_correct_number_of_related_objects(client: Client):
annos = Annotation.find(
client, [Annotation.object_name == "Test Annotation Object Name"],
client,
[Annotation.object_name == "Test Annotation Object Name"],
)

assert len(annos) == 1
Expand All @@ -74,7 +75,8 @@ def test_correct_number_of_related_objects(client: Client):

def test_item_relationship_with_missing_id(client: Client):
annos = Annotation.find(
client, [Annotation.object_name == "Test Annotation Object Name"],
client,
[Annotation.object_name == "Test Annotation Object Name"],
)

assert len(annos) == 1
Expand Down
56 changes: 40 additions & 16 deletions client/python/cryoet_data_portal/tests/test_infra/seed_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,51 +261,75 @@ def use_factoryboy() -> None:
)

AnnotationAuthorFactory.create(
annotation=a40, name="Author 1", orcid="0000-0000-0000-0007",
annotation=a40,
name="Author 1",
orcid="0000-0000-0000-0007",
)
AnnotationAuthorFactory.create(
annotation=a40, name="Author 2", orcid="0000-0000-0000-0008",
annotation=a40,
name="Author 2",
orcid="0000-0000-0000-0008",
)
AnnotationAuthorFactory.create(
annotation=a41, name="Author 1", orcid="0000-0000-0000-0007",
annotation=a41,
name="Author 1",
orcid="0000-0000-0000-0007",
)
AnnotationAuthorFactory.create(
annotation=a41, name="Author 2", orcid="0000-0000-0000-0008",
annotation=a41,
name="Author 2",
orcid="0000-0000-0000-0008",
)
AnnotationAuthorFactory.create(
annotation=a42, name="Author 3", orcid="0000-0000-0000-0039",
annotation=a42,
name="Author 3",
orcid="0000-0000-0000-0039",
)
AnnotationAuthorFactory.create(
annotation=a42, name="Author 4", orcid="0000-0000-0000-0049",
annotation=a42,
name="Author 4",
orcid="0000-0000-0000-0049",
)
AnnotationAuthorFactory.create(
annotation=a43, name="Author 5", orcid="0000-0000-0000-0059",
annotation=a43,
name="Author 5",
orcid="0000-0000-0000-0059",
)
AnnotationAuthorFactory.create(
annotation=a44, name="Author 6", orcid="0000-0000-0000-0069",
annotation=a44,
name="Author 6",
orcid="0000-0000-0000-0069",
)
AnnotationAuthorFactory.create(
annotation=a45, name="Author 7", orcid="0000-0000-0000-0079",
annotation=a45,
name="Author 7",
orcid="0000-0000-0000-0079",
)
AnnotationAuthorFactory.create(
annotation=a45, name="Author 8", orcid="0000-0000-0000-0089",
annotation=a45,
name="Author 8",
orcid="0000-0000-0000-0089",
)

as40op = AnnotationShapeFactory.create(annotation=a40, shape_type="OrientedPoint")
as40sm = AnnotationShapeFactory.create(
annotation=a40, shape_type="SegmentationMask",
annotation=a40,
shape_type="SegmentationMask",
)
as41pt = AnnotationShapeFactory.create(annotation=a41, shape_type="Point")
as41sm = AnnotationShapeFactory.create(
annotation=a41, shape_type="SegmentationMask",
annotation=a41,
shape_type="SegmentationMask",
)
as42op = AnnotationShapeFactory.create(annotation=a42, shape_type="OrientedPoint")
as42sm = AnnotationShapeFactory.create(
annotation=a42, shape_type="SegmentationMask",
annotation=a42,
shape_type="SegmentationMask",
)
as43op = AnnotationShapeFactory.create(annotation=a43, shape_type="OrientedPoint")
as44sm = AnnotationShapeFactory.create(
annotation=a44, shape_type="SegmentationMask",
annotation=a44,
shape_type="SegmentationMask",
)
as45pt = AnnotationShapeFactory.create(annotation=a45, shape_type="Point")

Expand Down Expand Up @@ -479,6 +503,6 @@ def use_factoryboy() -> None:


if __name__ == "__main__":
print("Seeding database")
print("Seeding database") # noqa
use_factoryboy()
print("Seeding complete")
print("Seeding complete") # noqa
21 changes: 0 additions & 21 deletions client/python/cryoet_data_portal/tests/tmp.py

This file was deleted.

0 comments on commit cf871d8

Please sign in to comment.