-
Notifications
You must be signed in to change notification settings - Fork 4
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
Migrate annotations (old) (Sourcery refactored) #318
base: migrate_annotations
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,17 +96,15 @@ def from_annotations( | |
image_width: int, image_height: int, annotations: Sequence[Annotation] | ||
) -> Sequence["BoundingBox"]: | ||
return tuple( | ||
[ | ||
BoundingBox.from_relative_coordinates( | ||
annotation.geometry.x, | ||
annotation.geometry.y, | ||
annotation.geometry.width, | ||
annotation.geometry.height, | ||
image_width, | ||
image_height, | ||
) | ||
for annotation in annotations | ||
] | ||
BoundingBox.from_relative_coordinates( | ||
annotation.geometry.x, | ||
annotation.geometry.y, | ||
annotation.geometry.width, | ||
annotation.geometry.height, | ||
image_width, | ||
image_height, | ||
) | ||
for annotation in annotations | ||
Comment on lines
-99
to
+107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
) | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,14 +58,14 @@ def test_find_many(collection): | |
collection.insert_one(document_match2) | ||
collection.insert_one(document_no_match) | ||
|
||
assert [document for document in collection.find_many({"data": "payload"})] == [ | ||
assert list(collection.find_many({"data": "payload"})) == [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
document_match1, | ||
document_match2, | ||
] | ||
|
||
|
||
def test_find_many_document_not_found(collection): | ||
assert list(collection.find_many({})) == [] | ||
assert not list(collection.find_many({})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
def test_aggregate(collection): | ||
|
@@ -76,9 +76,10 @@ def test_aggregate(collection): | |
collection.insert_one(document_match2) | ||
collection.insert_one(document_no_match) | ||
|
||
assert [ | ||
document for document in collection.aggregate([{"$match": {"data": "payload"}}]) | ||
] == [document_match1, document_match2] | ||
assert list(collection.aggregate([{"$match": {"data": "payload"}}])) == [ | ||
document_match1, | ||
document_match2, | ||
] | ||
Comment on lines
-79
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
|
||
def test_update(collection): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
CroppedAnnotationService.find_annotations_by_sign
refactored with the following changes:use-named-expression
)