Skip to content

Directory Restructuring - Modern src/ Layout #26

@iAmGiG

Description

@iAmGiG

Goal

Restructure project to modern Python package layout with proper separation of concerns.

Current Issues

  • Inconsistent naming: anomaly-detection vs classification
  • Mixed concerns: models, logs, lime outputs in module dirs
  • No tests/ directory
  • No proper package structure

Target Structure

project/
├── src/                           # All source code
│   ├── anomaly_detection/         # Renamed from anomaly-detection
│   │   ├── models/
│   │   ├── training/
│   │   ├── evaluation/
│   │   └── utils/
│   ├── classification/
│   ├── federated_learning/        # NEW
│   ├── data/                      # Data utilities
│   │   ├── loaders/
│   │   ├── preprocessing/
│   │   └── validation/
│   ├── common/                    # Shared utilities
│   └── analysis/
├── tests/                         # NEW
│   ├── unit/
│   └── integration/
├── outputs/                       # All outputs (gitignored)
│   ├── models/
│   ├── logs/
│   └── lime_explanations/
└── ...

Migration Tasks

  • Create new directory structure
  • Create all init.py files
  • Migrate anomaly-detection → src/anomaly_detection
  • Migrate classification → src/classification
  • Create federated_learning module structure
  • Create data utilities module
  • Create common utilities module
  • Move outputs to outputs/ directory
  • Update ALL import paths throughout codebase
  • Create setup.py / pyproject.toml
  • Test that everything still works

Breaking Changes

This will change all import paths:

# OLD
from anomaly-detection.train_autoencoder import train

# NEW
from src.anomaly_detection.training.train import train_autoencoder

Related

Priority

HIGH - Required before most other modernization work

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmodernizationModernizing code, dependencies, and structurerefactorCode refactoring and reorganization

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions