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

Fixing tests to work for CH DB #13

Merged
merged 1 commit into from
Jul 11, 2024
Merged
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
34 changes: 18 additions & 16 deletions tests/examples/wds_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://i.imgur.com/mXQrfNs.png",
"key": "000000000000",
"status": "success",
"error_message": None,
"error_message": "",
"width": 512,
"height": 270,
"original_width": 1704,
Expand All @@ -29,7 +29,7 @@
"url": "http://i.ytimg.com/vi/if2V1iszwuA/default.jpg",
"key": "000000000001",
"status": "success",
"error_message": None,
"error_message": "",
"width": 120,
"height": 90,
"original_width": 120,
Expand All @@ -44,7 +44,7 @@
"url": "http://t0.gstatic.com/images?q=tbn:ANd9GcScIHR33LnMpupkxbZRqnj1YMvOXsc9uUTj8Wa2v8bhSjWTxTRo1w",
"key": "000000000002",
"status": "success",
"error_message": None,
"error_message": "",
"width": 275,
"height": 183,
"original_width": 275,
Expand All @@ -59,7 +59,7 @@
"url": "http://thumbs.ebaystatic.com/images/g/5kAAAOSwc1FXcDFI/s-l225.jpg",
"key": "000000000003",
"status": "success",
"error_message": None,
"error_message": "",
"width": 80,
"height": 80,
"original_width": 80,
Expand All @@ -74,7 +74,7 @@
"url": "https://www.dhresource.com/600x600/f2/albu/g8/M00/78/73/rBVaV150TlWAcLR4AAHizzfChbU318.jpg",
"key": "000000000004",
"status": "success",
"error_message": None,
"error_message": "",
"width": 512,
"height": 384,
"original_width": 600,
Expand All @@ -86,6 +86,8 @@


# data that represents metadata and goes to webdataset parquet file of webdataset
# TODO change float values to something other than 0.5 to test if double precision
# works as expected when https://github.com/iterative/datachain/issues/12 is done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use something like pytest's approx to test floats rather than use 0.5 everywhere? 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, we could but approx is also just masking the problem, which is basically a bug in a system of not supporting double precision for CH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added a TODO to use normal values when issue is resolved

WDS_META = {
"uid": {
"0": "d142ae70686e14ccc379c01a571501b5",
Expand Down Expand Up @@ -123,22 +125,22 @@
"4": 450,
},
"clip_b32_similarity_score": {
"0": 0.2734375,
"1": 0.3813476562,
"2": 0.3312988281,
"3": 0.2091064453,
"4": 0.2038574219,
"0": 0.5,
"1": 0.5,
"2": 0.5,
"3": 0.5,
"4": 0.5,
},
"clip_l14_similarity_score": {
"0": 0.2553710938,
"1": 0.3391113281,
"2": 0.2318115234,
"3": 0.1966552734,
"4": 0.1300048828,
"0": 0.5,
"1": 0.5,
"2": 0.5,
"3": 0.5,
"4": 0.5,
},
"face_bboxes": {
"0": [],
"1": [[0.5005972981, 0.1360414922, 0.8109994531, 0.7247588038]],
"1": [[0.5, 0.5, 0.5, 0.5]],
"2": [],
"3": [],
"4": [],
Expand Down
Loading