Skip to content

Fix circular imports and config - #13

Merged
jairus-m merged 3 commits into
mainfrom
fix/circular-imports-and-config
Aug 21, 2025
Merged

Fix circular imports and config#13
jairus-m merged 3 commits into
mainfrom
fix/circular-imports-and-config

Conversation

@jairus-m

Copy link
Copy Markdown
Owner

Summary

  • Refactored logging and configuration to a single core.logger and config-driven paths.
  • Standardized data/experiment paths across modules; added aws_utils for S3 ops.
  • Introduced a dedicated constants module for training utilities.
  • All tests pass locally (33/33).

Details

  • Refactor logging and configuration management

    • Replaced core/base_logger.py with centralized core/logger.py (renamed from logging_config.py).
    • Removed PROJECT_ROOT; core/asset_resolution.py now resolves via config.
    • Added core/aws_utils.py; updated core/aws.py.
    • Touched: src/core/__init__.py, src/core/asset_resolution.py, src/core/aws.py, src/core/aws_utils.py, src/core/logger.py (from logging_config.py), removed src/core/base_logger.py.
  • Refactor data loading and experiment tracking to use config-based paths

    • sklearn_training/utils/data_loader.py now uses configurable local data dirs.
    • sklearn_training/utils/experiment_tracking.py writes models/metadata to config-defined locations.
    • sklearn_training/utils/model_evaluation.py introduces constants for targets/batch size.
    • Updated references in sklearn_training/train_model.py and fastapi_backend/main.py; adjusted config.yaml.
  • Add new constants module

    • Added src/sklearn_training/utils/constants.py for shared training constants.
  • Notes

    • Potentially breaking: removed PROJECT_ROOT and base_logger; ensure imports use core.logger and path resolution via config.
    • Verified by running pytest: 33 passed.

- Updated data_loader.py to utilize configurable data directories for local storage.
- Modified experiment_tracking.py to implement config-based paths for model and metadata storage.
- Introduced constants for target columns and batch size in model_evaluation.py for better maintainability.
- Removed PROJECT_ROOT constant and updated asset resolution to use config-based paths.
- Consolidated logging setup into a new logger module, replacing the base logger.
- Introduced AWS utility functions for S3 operations to streamline file uploads and downloads.
- Deleted the old base_logger module to simplify the logging structure.
@jairus-m
jairus-m merged commit 8bbbda1 into main Aug 21, 2025
3 checks passed
@jairus-m
jairus-m deleted the fix/circular-imports-and-config branch August 21, 2025 13:59
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.

1 participant