|
37 | 37 | TEST_IMG_URLS, |
38 | 38 | TEST_POLYGON_ANNOTATIONS, |
39 | 39 | TEST_SEGMENTATION_ANNOTATIONS, |
| 40 | + DATASET_WITH_AUTOTAG, |
| 41 | + NUCLEUS_PYTEST_USER_ID, |
40 | 42 | reference_id_from_url, |
41 | 43 | ) |
42 | 44 |
|
43 | | -TEST_AUTOTAG_DATASET = "ds_bz43jm2jwm70060b3890" |
44 | | - |
45 | 45 |
|
46 | 46 | def test_reprs(): |
47 | 47 | # Have to define here in order to have access to all relevant objects |
@@ -325,17 +325,17 @@ def test_raises_error_for_duplicate(): |
325 | 325 | def test_dataset_export_autotag_scores(CLIENT): |
326 | 326 | # This test can only run for the test user who has an indexed dataset. |
327 | 327 | # TODO: if/when we can create autotags via api, create one instead. |
328 | | - if os.environ.get("HAS_ACCESS_TO_TEST_DATA", False): |
329 | | - dataset = CLIENT.get_dataset(TEST_AUTOTAG_DATASET) |
| 328 | + if NUCLEUS_PYTEST_USER_ID in CLIENT.api_key: |
| 329 | + dataset = CLIENT.get_dataset(DATASET_WITH_AUTOTAG) |
330 | 330 |
|
331 | 331 | with pytest.raises(NucleusAPIError) as api_error: |
332 | 332 | dataset.autotag_scores(autotag_name="NONSENSE_GARBAGE") |
333 | 333 | assert ( |
334 | | - f"The autotag NONSENSE_GARBAGE was not found in dataset {TEST_AUTOTAG_DATASET}" |
| 334 | + f"The autotag NONSENSE_GARBAGE was not found in dataset {DATASET_WITH_AUTOTAG}" |
335 | 335 | in str(api_error.value) |
336 | 336 | ) |
337 | 337 |
|
338 | | - scores = dataset.autotag_scores(autotag_name="TestTag") |
| 338 | + scores = dataset.autotag_scores(autotag_name="PytestTestTag") |
339 | 339 |
|
340 | 340 | for column in ["dataset_item_ids", "ref_ids", "scores"]: |
341 | 341 | assert column in scores |
@@ -484,3 +484,10 @@ def sort_labelmap(segmentation_annotation): |
484 | 484 | assert exported[0][ANNOTATIONS_KEY][POLYGON_TYPE][0] == clear_fields( |
485 | 485 | polygon_annotation |
486 | 486 | ) |
| 487 | + |
| 488 | + |
| 489 | +def test_export_embeddings(CLIENT): |
| 490 | + if NUCLEUS_PYTEST_USER_ID in CLIENT.api_key: |
| 491 | + embeddings = Dataset(DATASET_WITH_AUTOTAG, CLIENT).export_embeddings() |
| 492 | + assert "embedding_vector" in embeddings[0] |
| 493 | + assert "reference_id" in embeddings[0] |
0 commit comments