Skip to content

perf(backend): enhance backend for reproducible builds and modular structure#24

Merged
cristofima merged 9 commits intomainfrom
dev
Dec 26, 2025
Merged

perf(backend): enhance backend for reproducible builds and modular structure#24
cristofima merged 9 commits intomainfrom
dev

Conversation

@cristofima
Copy link
Copy Markdown
Owner

@cristofima cristofima commented Dec 25, 2025

This PR enhances the backend architecture by restructuring the training module into a proper Python package with modular organization, updating dependencies to use flexible version ranges for better maintainability, and expanding the test suite. The modular structure improves code organization by separating core ML components, report generation, and utilities into distinct packages with absolute imports.

Key Changes:

  • Restructured backend/training/ from flat scripts to a modular package structure with core/, reports/, and utils/ subdirectories
  • Updated dependency management from pinned versions to flexible version ranges (e.g., fastapi>=0.115.0,<1.0.0)
  • Expanded test suite from 197 to 263 tests with new test files for EDA and training report generation

…uilds

- Enhanced Dockerfile to utilize a lock file for consistent dependency versions.
- Added fallback mechanism to install from requirements.txt if lock file is absent.
- Updated FastAPI version to 1.1.0 in main.py for improved features and fixes.
- Introduced requirements.lock and updated requirements-dev.txt for better dependency management.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the backend architecture by restructuring the training module into a proper Python package with modular organization, updating dependencies to use flexible version ranges for better maintainability, and expanding the test suite. The modular structure improves code organization by separating core ML components, report generation, and utilities into distinct packages with absolute imports.

Key Changes:

  • Restructured backend/training/ from flat scripts to a modular package structure with core/, reports/, and utils/ subdirectories
  • Updated dependency management from pinned versions to flexible version ranges (e.g., fastapi>=0.115.0,<1.0.0)
  • Expanded test suite from 197 to 263 tests with new test files for EDA and training report generation

Reviewed changes

Copilot reviewed 29 out of 32 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
backend/training/__init__.py Adds package root with documentation for the new modular structure
backend/training/main.py Updates entry point with absolute imports and adds default parameter value
backend/training/core/ New directory containing preprocessor, trainer, and ONNX exporter modules
backend/training/reports/ New directory containing EDA and training report generators
backend/training/utils/detection.py Extracts shared detection utilities (problem type, ID columns, etc.)
backend/training/Dockerfile Updates to copy package structure and use python -m training.main
backend/training/requirements.txt Replaces pinned versions with flexible ranges and adds inline documentation
backend/requirements.txt Updates API dependencies with flexible ranges, notably FastAPI >=0.115.0 for ReDoc fix
backend/requirements-dev.txt Updates dev dependencies to use version ranges
backend/tests/training/conftest.py Simplifies path setup for package imports
backend/tests/training/unit/test_*.py Updates imports to use new package structure
backend/tests/training/unit/test_eda.py New comprehensive test suite for EDA report generation (485 tests)
backend/tests/training/unit/test_training_report.py New comprehensive test suite for training report generation (552 tests)
docs/UNIT_TESTING_ANALYSIS.md Updates test counts and coverage metrics, documents new modular structure
docs/LESSONS_LEARNED.md Adds lessons about ReDoc CDN issues and cross-platform lock files
CHANGELOG.md Documents dependency updates and test suite expansion
.github/workflows/*.yml Adds requirements-dev.txt to deployment triggers
.gitignore Broadens coverage file pattern matching

@cristofima cristofima merged commit 629c2b6 into main Dec 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants