Skip to content

Commit 4bf84bb

Browse files
committed
chore(tests): add HETA 1.2.0 parquet outputs to SPOT_0 and update gui_test file count
SPOT_0_EXPECTED_RESULT_FILES updated with 3 new parquet artifacts (tissue_qc, tissue_segmentation, cell_classification) from a HETA 1.2.0 run. gui_test updated to assert 12 result files and validate parquet↔GeoJSON row count parity for all 3 paired outputs.
1 parent 835f57e commit 4bf84bb

2 files changed

Lines changed: 48 additions & 21 deletions

File tree

tests/aignostics/application/gui_test.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ async def test_gui_download_dataset_via_application_to_run_cancel_to_find_back(
354354
@pytest.mark.flaky(retries=1, delay=5)
355355
@pytest.mark.timeout(timeout=60 * 10)
356356
@pytest.mark.sequential # Helps on Linux with image analysis step otherwise timing out
357-
async def test_gui_run_download( # noqa: PLR0915
357+
async def test_gui_run_download( # noqa: PLR0914, PLR0915
358358
user: User, runner: CliRunner, tmp_path: Path, silent_logging: None, record_property
359359
) -> None:
360360
"""Test that the user can download a run result via the GUI."""
@@ -440,8 +440,8 @@ async def test_gui_run_download( # noqa: PLR0915
440440

441441
# Check for files in the results directory
442442
files_in_results_dir = list(results_dir.glob("*"))
443-
assert len(files_in_results_dir) == 9, (
444-
f"Expected 9 files in {results_dir}, but found {len(files_in_results_dir)}: "
443+
assert len(files_in_results_dir) == 12, (
444+
f"Expected 12 files in {results_dir}, but found {len(files_in_results_dir)}: "
445445
f"{[f.name for f in files_in_results_dir]}"
446446
)
447447

@@ -464,6 +464,27 @@ async def test_gui_run_download( # noqa: PLR0915
464464
f"({min_size} to {max_size} bytes, ±{tolerance_percent}% of {expected_size})"
465465
)
466466

467+
# Validate parquet <-> GeoJSON row count parity for the 3 paired outputs
468+
import json
469+
470+
import pandas as pd
471+
472+
parquet_geojson_pairs = [
473+
("tissue_qc_parquet_polygons.parquet", "tissue_qc_geojson_polygons.json"),
474+
("tissue_segmentation_parquet_polygons.parquet", "tissue_segmentation_geojson_polygons.json"),
475+
("cell_classification_parquet_polygons.parquet", "cell_classification_geojson_polygons.json"),
476+
]
477+
for parquet_filename, geojson_filename in parquet_geojson_pairs:
478+
parquet_path = results_dir / parquet_filename
479+
geojson_path = results_dir / geojson_filename
480+
parquet_row_count = len(pd.read_parquet(parquet_path))
481+
with geojson_path.open() as f:
482+
geojson_feature_count = len(json.load(f)["features"])
483+
assert parquet_row_count == geojson_feature_count, (
484+
f"Row count mismatch between {parquet_filename} ({parquet_row_count} rows) "
485+
f"and {geojson_filename} ({geojson_feature_count} features)"
486+
)
487+
467488

468489
@pytest.mark.integration
469490
@pytest.mark.sequential

tests/constants_test.py

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,18 @@
8383
# SPOT_0: uv run pytest tests/aignostics/application/gui_test.py::test_gui_run_download -s --no-cov
8484
# SPOT_1: uv run pytest tests/aignostics/application/cli_test.py::test_cli_run_execute -s --no-cov
8585
SPOT_0_EXPECTED_RESULT_FILES = [
86-
("tissue_qc_segmentation_map_image.tiff", 1642856, 10),
87-
("tissue_qc_geojson_polygons.json", 259955, 10),
88-
("tissue_segmentation_geojson_polygons.json", 887003, 10),
89-
("readout_generation_slide_readouts.csv", 303217, 10),
90-
("readout_generation_cell_readouts.csv", 1658344, 10),
91-
("cell_classification_geojson_polygons.json", 11218951, 10),
92-
("tissue_segmentation_segmentation_map_image.tiff", 2945078, 10),
93-
("tissue_segmentation_csv_class_information.csv", 452, 10),
94-
("tissue_qc_csv_class_information.csv", 285, 10),
86+
("tissue_qc_segmentation_map_image.tiff", 470150, 10),
87+
("tissue_qc_geojson_polygons.json", 171251, 10),
88+
("tissue_segmentation_geojson_polygons.json", 185516, 10),
89+
("readout_generation_slide_readouts.csv", 300205, 10),
90+
("readout_generation_cell_readouts.csv", 2417117, 10),
91+
("cell_classification_geojson_polygons.json", 16673412, 10),
92+
("tissue_segmentation_segmentation_map_image.tiff", 527264, 10),
93+
("tissue_segmentation_csv_class_information.csv", 443, 10),
94+
("tissue_qc_csv_class_information.csv", 286, 10),
95+
("tissue_qc_parquet_polygons.parquet", 34346, 10),
96+
("tissue_segmentation_parquet_polygons.parquet", 39185, 10),
97+
("cell_classification_parquet_polygons.parquet", 5476364, 10),
9598
]
9699
SPOT_0_EXPECTED_CELLS_CLASSIFIED = (39798, 10)
97100

@@ -127,15 +130,18 @@
127130

128131
# See production block above for instructions on how to update these sizes.
129132
SPOT_0_EXPECTED_RESULT_FILES = [
130-
("tissue_qc_segmentation_map_image.tiff", 1642856, 10),
131-
("tissue_qc_geojson_polygons.json", 259955, 10),
132-
("tissue_segmentation_geojson_polygons.json", 887003, 10),
133-
("readout_generation_slide_readouts.csv", 303217, 10),
134-
("readout_generation_cell_readouts.csv", 1658344, 10),
135-
("cell_classification_geojson_polygons.json", 11218951, 10),
136-
("tissue_segmentation_segmentation_map_image.tiff", 2945078, 10),
137-
("tissue_segmentation_csv_class_information.csv", 452, 10),
138-
("tissue_qc_csv_class_information.csv", 285, 10),
133+
("tissue_qc_segmentation_map_image.tiff", 470150, 10),
134+
("tissue_qc_geojson_polygons.json", 171251, 10),
135+
("tissue_segmentation_geojson_polygons.json", 185516, 10),
136+
("readout_generation_slide_readouts.csv", 300205, 10),
137+
("readout_generation_cell_readouts.csv", 2417117, 10),
138+
("cell_classification_geojson_polygons.json", 16673412, 10),
139+
("tissue_segmentation_segmentation_map_image.tiff", 527264, 10),
140+
("tissue_segmentation_csv_class_information.csv", 443, 10),
141+
("tissue_qc_csv_class_information.csv", 286, 10),
142+
("tissue_qc_parquet_polygons.parquet", 34346, 10),
143+
("tissue_segmentation_parquet_polygons.parquet", 39185, 10),
144+
("cell_classification_parquet_polygons.parquet", 5476364, 10),
139145
]
140146
SPOT_0_EXPECTED_CELLS_CLASSIFIED = (39798, 10)
141147

0 commit comments

Comments
 (0)