"""
Data management module.

As of v1.0.0, dataset-specific modules (BatchManager, PairedDatasetLoader,
IntermediateResultsRegistry, DatasetRegistry) have moved to the
cardiac-private package for IP protection.

If you need these modules, install cardiac-private locally:
    cd ~/projects/cardiac-private && pip install -e .

Then import from cardiac_private:
    from cardiac_private.data import BatchManager, PairedDatasetLoader
"""


def __getattr__(name):
    """Provide helpful migration guidance for moved classes."""
    _MOVED = {
        'BatchManager': 'cardiac_private.data.batch_manager',
        'BatchManifest': 'cardiac_private.data.batch_manager',
        'PatientEntry': 'cardiac_private.data.batch_manager',
        'ConsumerRecord': 'cardiac_private.data.batch_manager',
        'create_nifti_batch': 'cardiac_private.data.batch_manager',
        'load_batch': 'cardiac_private.data.batch_manager',
        'BatchDiscovery': 'cardiac_private.data.batch_discovery',
        'BatchInfo': 'cardiac_private.data.batch_discovery',
        'IntermediateResultsRegistry': 'cardiac_private.data.registry',
        'RegistryEntry': 'cardiac_private.data.registry',
        'get_registry': 'cardiac_private.data.registry',
        'DatasetRegistry': 'cardiac_private.data.datasets',
        'Dataset': 'cardiac_private.data.datasets',
        'PairedSample': 'cardiac_private.data.paired_dataset',
        'PairedDatasetConfig': 'cardiac_private.data.paired_dataset',
        'PairedDatasetLoader': 'cardiac_private.data.paired_dataset',
    }
    if name in _MOVED:
        new_loc = _MOVED[name]
        raise ImportError(
            f"{name} has moved to cardiac-private in v1.0.0.\n"
            f"  Old: from cardiac_shared.data import {name}\n"
            f"  New: from {new_loc} import {name}\n"
            f"  Install: cd ~/projects/cardiac-private && pip install -e ."
        )
    raise AttributeError(f"module 'cardiac_shared.data' has no attribute '{name}'")
