Migration Guide

Transitioning to the Modular Structure

With version 0.1.0, ArchetypAX has adopted a more modular structure to enhance maintainability and extensibility. This guide outlines the changes and provides recommendations for transitioning existing code.

Key Changes

The package has been reorganized into a modular structure:

archetypax/
├── models/                  # Core model implementations
│   ├── base.py              # Base archetypal analysis implementation
│   ├── archetypes.py        # Improved archetypal analysis implementation
│   └── biarchetypes.py      # Biarchetypal analysis implementation
└── tools/                   # Utility modules
    ├── evaluation.py        # Evaluation metrics and analysis
    ├── visualization.py     # Visualization utilities
    └── interpret.py         # Interpretation methods

Backward Compatibility

Important: Full backward compatibility is maintained. All existing code will continue to function without modification.

The package implements a transparent module aliasing system that ensures imports using the previous structure will continue to work seamlessly.

Examples

Before

from archetypax import ArchetypalAnalysis
from archetypax.evaluation import ArchetypalAnalysisEvaluator
from archetypax.visualization import ArchetypalAnalysisVisualizer

Benefits of the New Structure

  1. Improved Organization: Related functionality is grouped together

  2. Enhanced Maintainability: Clearer separation of concerns

  3. Better Extensibility: Easier to add new components

  4. Reduced Namespace Pollution: More explicit imports reduce the risk of name collisions

Timeline

The legacy import paths will be maintained indefinitely to ensure backward compatibility. However, we encourage adopting the new import patterns for all new code.