PPeitsch / pkynetics

Pkynetics is a comprehensive library for thermal analysis kinetic methods, including traditional model-fitting and model-free methods, advanced computational techniques, machine learning approaches, and result visualization.
MIT License
0 stars 0 forks source link

Project Structure Reorganization #27

Open PPeitsch opened 3 weeks ago

PPeitsch commented 3 weeks ago

Project Structure Reorganization

Overview

This proposal aims to improve the Pkynetics library structure to enhance modularity, maintainability, and adherence to Python packaging best practices, with a focus on automation and quality assurance. The reorganization emphasizes better separation between theoretical methods and practical implementations, clear organization of technique-specific functionalities, and robust automation practices.

Current Issues

  1. Mixed concerns in some modules:
    • Theoretical methods mixed with their implementations
    • Data preprocessing mixed with analysis logic
  2. Inconsistent structure across similar components:
    • Different approaches for similar techniques
    • Inconsistent method signatures
  3. Limited reusability of common functionality:
    • Duplicate code across techniques
    • Non-standardized base implementations
  4. Potential code duplication across techniques:
    • Similar data processing routines
    • Common mathematical operations
  5. Complex testing structure:
    • Difficult to maintain test coverage
    • Inconsistent test organization
  6. Lack of automated quality controls:
    • Manual testing processes
    • Inconsistent code style
    • No automated deployment

Proposed Structure

src/pkynetics/
├── __init__.py
├── core/
│   ├── __init__.py
│   ├── base.py      # Abstract base classes
│   └── exceptions.py
├── data_import/
│   ├── __init__.py
│   ├── base.py
│   └── implementations/
│       ├── __init__.py
│       ├── tga.py
│       ├── dsc.py
│       └── dilatometry.py
├── data_preprocessing/
│   ├── __init__.py
│   ├── base.py
│   ├── filters.py
│   └── implementations/
│       ├── __init__.py
│       ├── tga.py
│       ├── dsc.py
│       └── dilatometry.py
├── kinetic_methods/
│   ├── __init__.py
│   ├── base.py
│   ├── model_fitting/
│   │   ├── __init__.py
│   │   ├── base.py
│   │   └── methods/
│   │       ├── __init__.py
│   │       ├── avrami.py
│   │       ├── coats_redfern.py
│   │       ├── freeman_carroll.py
│   │       ├── horowitz_metzger.py
│   │       └── kissinger.py
│   ├── model_free/
│   │   ├── __init__.py
│   │   ├── base.py
│   │   └── methods/
│   │       ├── __init__.py
│   │       ├── friedman.py
│   │       ├── ozawa_flynn_wall.py
│   │       └── kissinger_akahira_sunose.py
│   └── utils/
│       ├── __init__.py
│       ├── math.py
│       └── validation.py
├── technique_analysis/
│   ├── __init__.py
│   ├── base.py
│   ├── tga/
│   │   ├── __init__.py
│   │   ├── core.py
│   │   ├── analysis.py
│   │   └── methods/
│   │       ├── __init__.py
│   │       ├── single_step.py
│   │       └── multi_step.py
│   ├── dsc/
│   │   ├── __init__.py
│   │   ├── core.py
│   │   ├── analysis.py
│   │   └── methods/
│   │       ├── __init__.py
│   │       ├── crystallization.py
│   │       └── glass_transition.py
│   └── dilatometry/
│       ├── __init__.py
│       ├── core.py
│       ├── analysis.py
│       └── methods/
│           ├── __init__.py
│           ├── lever.py
│           └── tangent.py
└── visualization/
    ├── __init__.py
    ├── base.py
    ├── common.py
    └── technique/
        ├── __init__.py
        ├── tga.py
        ├── dsc.py
        └── dilatometry.py

Implementation Phases

Phase 1: Project Infrastructure (Priority: Highest)

Phase 2: Base Structure Implementation (Priority: High)

src/pkynetics/
├── __init__.py
├── core/
│   ├── __init__.py
│   ├── base.py      # Abstract base classes
│   └── exceptions.py
├── data_import/
│   ├── __init__.py
│   ├── base.py
│   └── implementations/
│       ├── __init__.py
│       ├── tga.py
│       ├── dsc.py
│       └── dilatometry.py
└── [other modules follow similar pattern]

Phase 3: Testing Infrastructure (Priority: High)

Phase 4: Documentation and Examples (Priority: Medium)

Phase 5: Quality Assurance (Priority: Medium)

Compatibility Strategy

Version 1.0.0

Automated Processes

Release Schedule

  1. v0.9.0: Infrastructure and base structure
  2. v0.9.1-v0.9.9: Incremental improvements
  3. v1.0.0-rc1: Release candidate
  4. v1.0.0: Stable release

Quality Metrics

CI/CD Pipeline

Pipeline Stages:
1. Code Quality
   - Black formatting
   - isort check
   - mypy type checking
2. Testing
   - Unit tests
   - Integration tests
   - Coverage report
3. Documentation
   - Build docs
   - Test examples
4. Publishing
   - Build package
   - Upload to PyPI
PPeitsch commented 3 weeks ago

structure.md