Merged
Conversation
SAM-RFI now depends on rfi_toolbox for shared utilities. ## Changes **src/samrfi/data/__init__.py**: - Forward import MSLoader, Preprocessor, GPUPreprocessor from rfi_toolbox - Forward import TorchDataset, BatchWriter from rfi_toolbox.datasets - Keep SAM2-specific modules (SAMDataset, AdaptivePatcher, GPU utilities) **src/samrfi/evaluation/__init__.py**: - Forward import all metrics from rfi_toolbox.evaluation - Forward import inject_synthetic_data from rfi_toolbox.io - All core metrics now shared via rfi_toolbox **src/samrfi/data_generation/__init__.py**: - Forward import SyntheticDataGenerator from rfi_toolbox - Keep MSDataGenerator (SAM2-specific) **pyproject.toml**: - Added note about rfi_toolbox dependency ## Testing ✓ All imports work: MSLoader, Preprocessor, metrics, SyntheticDataGenerator ✓ Backward compatibility maintained via forward imports ✓ No breaking changes for existing SAM-RFI code ## Status - rfi_toolbox: Phases 1-3 complete (commit 6d8d29f) - SAM-RFI: Phase 4 complete (this commit)
… rfi_toolbox - Removes circular import issues by not loading rfi_toolbox at samrfi import time - Tests that don't need rfi_toolbox (e.g., test_errors.py) won't trigger its initialization - Updated all imports to use rfi_toolbox directly: - from rfi_toolbox.preprocessing import Preprocessor - from rfi_toolbox.datasets import BatchWriter, TorchDataset - from rfi_toolbox.io import MSLoader - Clearer separation of SAM-specific vs shared utilities
- Same fix as previous commit - remove rfi_toolbox re-exports - Import directly: from rfi_toolbox.data_generation import SyntheticDataGenerator - Prevents rfi_toolbox initialization when importing samrfi
…ke tests - Removed all rfi_toolbox.evaluation re-exports from samrfi.evaluation - Updated test imports to use rfi_toolbox.evaluation directly - Added comprehensive import smoke tests (test_aaa_imports.py) that: - Run first to catch import issues early - Verify samrfi imports don't trigger rfi_toolbox initialization - Test rfi_toolbox imports work without circular dependencies - Verify import order independence - Provide clear error messages for debugging This completes the removal of all rfi_toolbox re-exports from samrfi.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal here is more more general RFI generation code into rfi toolbox and it has been done. I think this branch is good to go into main. Once tested.