Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ reports/*
.idea/
*.swp
*.swo
.vscode/*

# macOS
.DS_Store
Expand All @@ -77,6 +78,7 @@ node_modules/
# AI workflow
.fixme
CLAUDE.local.md
**/settings.local.json

# Copier
*.rej
Expand Down
19 changes: 12 additions & 7 deletions examples/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
import tempfile

from aignostics import platform
from tests.constants_test import (
SPOT_1_CRC32C,
SPOT_1_GS_URL,
SPOT_1_HEIGHT,
SPOT_1_RESOLUTION_MPP,
SPOT_1_WIDTH,
)

Comment on lines +6 to 13
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

examples is packaged into the wheel (see pyproject.toml), but tests is not. Importing tests.constants_test will therefore raise ModuleNotFoundError for installed users running this example. Consider moving these shared slide constants into a runtime module (e.g., src/aignostics/...) or duplicating them locally within examples/ so the example is self-contained.

Suggested change
from tests.constants_test import (
SPOT_1_CRC32C,
SPOT_1_GS_URL,
SPOT_1_HEIGHT,
SPOT_1_RESOLUTION_MPP,
SPOT_1_WIDTH,
)
# Constants for the example slide; duplicated here so the example is self-contained
# and does not depend on the uninstalled `tests` package.
SPOT_1_CRC32C = "INSERT_BASE64_CRC32C_CHECKSUM_HERE"
SPOT_1_GS_URL = "gs://INSERT_BUCKET_NAME/INSERT_OBJECT_PATH"
SPOT_1_HEIGHT = 0
SPOT_1_RESOLUTION_MPP = 0.0
SPOT_1_WIDTH = 0

Copilot uses AI. Check for mistakes.
# initialize the client
client = platform.Client()
Expand All @@ -16,14 +23,12 @@
input_artifacts=[
platform.InputArtifact(
name="user_slide",
download_url=platform.generate_signed_url(
"gs://aignx-storage-service-dev/sample_data_formatted/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff"
),
download_url=platform.generate_signed_url(SPOT_1_GS_URL),
metadata={
"checksum_base64_crc32c": "N+LWCg==",
"resolution_mpp": 0.46499982,
"width_px": 3728,
"height_px": 3640,
"checksum_base64_crc32c": SPOT_1_CRC32C,
"resolution_mpp": SPOT_1_RESOLUTION_MPP,
"width_px": SPOT_1_WIDTH,
"height_px": SPOT_1_HEIGHT,
},
)
],
Expand Down
2 changes: 1 addition & 1 deletion src/aignostics/dataset/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def aignostics_download(
str,
typer.Argument(
help="URL to download."
" Example: gs://aignx-storage-service-dev/sample_data_formatted/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm unsure this will still work for a non aignx user

" Example: gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff"
),
],
destination_directory: Annotated[
Expand Down
2 changes: 1 addition & 1 deletion src/aignostics/dataset/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def download_aignostics(
"""Download from bucket to folder via a bucket URL.

Args:
source_url (str): URL to download, e.g. gs://aignx-storage-service-dev/sample_data_formatted/...
source_url (str): URL to download, e.g. gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/...
destination_directory (Path): Destination directory to download to.
download_progress_callable (Callable[[int, int, str], None] | None): Optional callback for progress updates.
Called with (bytes_downloaded, total_size, filename).
Expand Down
16 changes: 12 additions & 4 deletions tests/constants_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,38 @@

TEST_SUITE = "AIGNOSTICS"

SPOT_0_GS_URL = "gs://platform-api-application-test-data/heta/slides/8fafc17d-a5cc-4e9d-a982-030b1486ca88.tiff"
SPOT_0_GS_URL = (
"gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/8fafc17d-a5cc-4e9d-a982-030b1486ca88.tiff"
)
SPOT_0_FILENAME = "8fafc17d-a5cc-4e9d-a982-030b1486ca88.tiff"
SPOT_0_CRC32C = "5onqtA=="
SPOT_0_FILESIZE = 10562338
SPOT_0_RESOLUTION_MPP = 0.26268186053789266
SPOT_0_WIDTH = 7447
SPOT_0_HEIGHT = 7196

SPOT_1_GS_URL = "gs://aignx-storage-service-dev/sample_data_formatted/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff"
SPOT_1_GS_URL = (
"gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff"
)
SPOT_1_FILENAME = "9375e3ed-28d2-4cf3-9fb9-8df9d11a6627.tiff"
SPOT_1_CRC32C = "9l3NNQ=="
SPOT_1_FILESIZE = 14681750
SPOT_1_RESOLUTION_MPP = 0.46499982
SPOT_1_WIDTH = 3728
SPOT_1_HEIGHT = 3640

SPOT_2_GS_URL = "gs://aignx-storage-service-dev/sample_data_formatted/8c7b079e-8b8a-4036-bfde-5818352b503a.tiff"
SPOT_2_GS_URL = (
"gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/8c7b079e-8b8a-4036-bfde-5818352b503a.tiff"
)
SPOT_2_FILENAME = "8c7b079e-8b8a-4036-bfde-5818352b503a.tiff"
SPOT_2_CRC32C = "w+ud3g=="
SPOT_2_RESOLUTION_MPP = 0.46499982
SPOT_2_WIDTH = 3616
SPOT_2_HEIGHT = 3400

SPOT_3_GS_URL = "gs://aignx-storage-service-dev/sample_data_formatted/1f4f366f-a2c5-4407-9f5e-23400b22d50e.tiff"
SPOT_3_GS_URL = (
"gs://aignostics-platform-ext-a4f7e9/python-sdk-tests/he-tme/slides/1f4f366f-a2c5-4407-9f5e-23400b22d50e.tiff"
)
SPOT_3_FILENAME = "1f4f366f-a2c5-4407-9f5e-23400b22d50e.tiff"
SPOT_3_CRC32C = "Zmx0wA=="
SPOT_3_RESOLUTION_MPP = 0.46499982
Expand Down
Loading