Spaces:
Running on Zero
Running on Zero
Commit History
-
Add comprehensive tests for settings upload functionality
Unverified signature- Add new test suite for CSV settings upload - Test validation of sex, site type, and other parameters - Test error handling for invalid or missing required fields - Ensure proper DataFrame structure and column handling7bdb8f6 -
Update tests to use required sex parameter
Unverified signature- Replace 'Unknown' sex values with 'Male' or 'Female' in test fixtures - Update test CSV files to include sex column with valid values - Fix test assertions to account for new UI component visibility behavior - Adjust expected output structure to include settings_input in yields6ba0947 -
Add mock Gradio components for testing
Unverified signature- Create MockComponent class to track visibility attributes - Add mocks for DownloadButton, DataFrame, Label, and Textbox - Enables proper testing of UI component state changes76070ab
-
Apply Black code formatting to test files
Unverified signature6241f9d -
Fix test failures in CI environment
Unverified signature- Fix GradioMock.Warning to properly accept message argument - Add torch.cuda.get_device_properties and memory_allocated mocks for GPU tests - All 107 tests now pass in both local and CI environmentsb52343d -
Add GitHub Actions workflows and comprehensive test suite
Unverified signature- Add CI/CD workflows for tests, code quality, and Docker builds - Add comprehensive Makefile with test, lint, format, and Docker targets - Add new test files for CLI, fixtures, UI components, and UI events - Refactor batch analysis into main analysis module - Update model manager and inference modules - Add .dockerignore for cleaner Docker builds - Update dependencies in uv.lock4780d8d
-
Fix all failing batch processing tests
Unverified signatureFixed mock configuration issues in batch analysis and model manager tests: Batch Analysis Tests: - Fixed DataFrame mock to return new instances each time (side_effect) - Fixed aeon_results DataFrame structure: Cancer Subtype should be index, not a column (matches actual implementation) - This prevented ValueError when batch_analysis tried to rename columns Model Manager Tests: - Fixed test_load_models_missing_aeon_file to properly mock Path.exists - Now checks filename instead of using fragile call_count logic Root Cause: The batch_analysis code does `aeon_results.columns = [slide_name]` which requires a single-column DataFrame. The real aeon_results has 'Cancer Subtype' as an index (set by _run_inference_pipeline_with_models), not as a column. Tests were mocking it incorrectly with 2 columns. All 27 tests now pass: - 14/14 model_manager tests ✓ - 8/8 batch_analysis tests ✓ - 6/6 regression tests ✓ Coverage: - batch_analysis.py: 99% - model_manager.py: 96% 🤖 Generated with [Cl…e706d9f -
Fix test mocks for segment_tissue return value
Unverified signaturesegment_tissue returns 4 values (polygon, _, coords, attrs) but tests were mocking it to return only 2 values, causing unpacking errors. Fixes: - Mock segment_tissue to return all 4 values - Mock gr.Warning to avoid argument mismatch errors - Use tempfile for directory creation in Gradio test - Mock DataFrame.to_csv to avoid file system issues All regression tests now pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>b6dcc8c -
Add batch processing optimization for slide analysis
Unverified signatureImplements batch processing to reduce model loading overhead by ~90% when processing multiple slides. Models are now loaded once per batch instead of once per slide, providing 25-45% overall speedup for multi-slide batches. New features: - ModelCache class with adaptive memory management (T4 vs A100 GPUs) - Batch coordinator that loads models once and reuses across all slides - Automatic batch mode for >1 slide in both Gradio UI and CLI - GPU type detection for memory-optimized strategies - Comprehensive test suite with unit, integration, and regression tests Implementation: - src/mosaic/model_manager.py: Model loading and caching infrastructure - src/mosaic/batch_analysis.py: Batch processing coordinator - src/mosaic/analysis.py: Batch-optimized pipeline functions - src/mosaic/inference/aeon.py: Add run_with_model() for pre-loaded models - src/mosaic/inference/paladin.py: Add run_with_models() for batch mode - src/mosaic/ui/app.py: Integrate batch mode in Gradio UI - src/mosaic/grad…0234c58
-
Remove unused global cancer type mappings from aeon.py
Unverified signature- Remove unused imports of INT_TO_CANCER_TYPE_MAP and CANCER_TYPE_TO_INT_MAP - Remove unused col_indices_to_drop global variable - Simplify CANCER_TYPES_TO_DROP to only the 5 types that are excluded - Update tests to import mappings from data.py instead of aeon.py - All 8 tests pass successfully The Aeon inference now exclusively uses metadata-loaded mappings (160 classes) instead of the old global constants (183 classes), eliminating confusion. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>bac4d5d
-
Fix unit tests by removing torch mock from conftest.py
copilot-swe-agent[bot] +1: raylimCo-authored-by: raylim <3074310+raylim@users.noreply.github.com>5601c38
-
Merge with main branch: refactor UI into separate modules and update tests
copilot-swe-agent[bot] +1: raylimCo-authored-by: raylim <3074310+raylim@users.noreply.github.com>b05124c -
Address code review feedback: add deterministic seeds and improve mocks
copilot-swe-agent[bot] +1: raylimCo-authored-by: raylim <3074310+raylim@users.noreply.github.com>6fcc1b9 -
Add comprehensive unit tests for mosaic package
copilot-swe-agent[bot] +1: raylimCo-authored-by: raylim <3074310+raylim@users.noreply.github.com>8f383ed