Refactor optimization configuration and constants integration
haileyhalimj@gmail.com
fa2c20f
- Updated `optimization_config.py` to utilize constants from `constants.py` for better maintainability.
- Added new constants for line counts, maximum parallel workers, and default rates.
- Enhanced session state initialization in `config_page.py` to use values from `DefaultConfig`.
- Improved architecture diagram to reflect changes in optimization flow.
✅ Add demand check to product readiness validation
haileyhalimj@gmail.com
272b077
- Add demand > 0 check as first criterion in is_product_ready_for_optimization()
- Products with zero or negative demand now get exclusion reason: 'No demand or zero demand'
- Remove redundant demand <= 0 check from filter_products() loop
- Simplify filter_products() by consolidating all checks in is_product_ready_for_optimization()
- Update docstrings to reflect all 5 readiness criteria:
1) Positive demand
2) Correct product type
3) Line assignment
4) Staffing requirements
5) Production speed data
- Improve consistency and reduce code duplication
✅ Add production speed check to product readiness validation
haileyhalimj@gmail.com
852cd18
- Add speed_data to DemandFilter class initialization
- Load speed data in load_data() method alongside other required data
- Add production speed check to is_product_ready_for_optimization()
- Products without speed data are now excluded from optimization
- Remove redundant speed data loading and warning in filter_products()
- Speed check is now part of the core readiness criteria
- Prevents optimization errors from missing speed data
- Improves data validation feedback with 'Missing production speed data' reason
🔄 Replace get_per_product_speed() with direct extract.read_package_speed_data() calls
haileyhalimj@gmail.com
60e706b
- Remove redundant get_per_product_speed() wrapper function
- Replace all 6 usage locations with direct extract.read_package_speed_data() calls
- Updated files:
- src/config/optimization_config.py: Remove function definition and update calls
- src/models/optimizer_real.py: Remove import and update calls
- src/demand_filtering.py: Direct import and call (2 locations)
- ui/pages/optimization_results.py: Direct import and call
- src/demand_validation_viz.py: Direct import and call
- Eliminate unnecessary abstraction layer
- Improve code clarity by using direct function calls
- Reduce function call overhead
🔧 Fix import error: Replace singleton pattern with direct instantiation
haileyhalimj@gmail.com
d6dee1d
- Remove redundant convenience functions from demand_filtering.py (34 lines removed)
- Fix optimization_config.py to use DemandFilter() directly instead of get_shared_filter_instance()
- Eliminate unnecessary singleton pattern - each call creates fresh instance
- Resolves import error: 'cannot import name get_shared_filter_instance'
- Simplify codebase while maintaining functionality
- File size reduced from 376 to 342 lines in demand_filtering.py
- Rename classify_product_type() method to standalone_master_filter() for better clarity
- Update all 4 method calls within the same file
- Method functionality remains unchanged - still classifies product type and checks if it's a standalone master
- Improves code readability and method naming consistency
🗑️ Remove PostgreSQL database dependencies and related files
haileyhalimj@gmail.com
d45fa12
- Delete docker-compose.yaml (PostgreSQL and pgAdmin services)
- Remove src/preprocess/db.py (database connection file)
- Clean up setup.py: remove psycopg2-binary and SQLAlchemy dependencies
- Remove docker/ directory and initialization files
- Update README.md to reflect simplified structure
- Add Excel processing dependencies (openpyxl, xlrd) to setup.py
- Project now uses CSV files directly without database layer
- Simplified deployment without Docker dependencies
Fix: Remove non-existent set_global_dates call
haileyhalimj@gmail.com
07cab60
- Remove call to extract.set_global_dates() which doesn't exist
- Extract functions take start_date as parameter directly
- No need for global date setting
Clean up: remove old src/utils files (moved to preprocess)
haileyhalimj@gmail.com
3e33d31
Recover and restore preprocessing improvements from d54de4e
haileyhalimj@gmail.com
8504f5a
Restored all preprocessing work that was done today:
- Add data_preprocess.py: Helper functions for data preprocessing
- Improve extract.py: Better data extraction logic (108 lines modified)
- Enhance kit_composition_cleaner.py: Major improvements (260 lines, 361 lines modified)
- Update transform.py: Better transformation logic (36 lines modified)
- Add paths.yaml: Configuration for data paths
Total: 505 lines changed across preprocessing module
This represents a full day's work on improving the preprocessing pipeline.
Restore improved optimizer and simplify demand validation
haileyhalimj@gmail.com
acd1110
Major improvements:
- Remove IDLE employee tracking from optimizer_real.py
- Improve variable naming: Z/T/U → Assignment/Hours/Units
- Add new employee tracking system: EMPLOYEE_COUNT and EMPLOYEE_HOURS
- Simplify demand_validation_viz.py (371→270 lines)
- Remove idle employee display from optimization_results.py
Code reorganization:
- Rename src/utils to src/preprocess for better organization
Testing: ✅ Optimization runs successfully with 3 products, €419.10 total cost
Update all imports from src.etl to src.preprocess
haileyhalimj@gmail.com
c9c4af4
Rename src/etl to src/preprocess for better code organization
haileyhalimj@gmail.com
1131bea
deleting the variables in the config to prevent infinite loop
haileyhalimj@gmail.com
e26abe9
remove reload to stop ultimate loop in hugging face
haileyhalimj@gmail.com
dd8a521
delete vision material master data
haileyhalimj@gmail.com
99c7d69
Refactor optimization function: renamed
haileyhalimj@gmail.com
ebdc033
clean code for optimizer
haileyhalimj@gmail.com
d8fcfd0
daily mode deleted
haileyhalimj@gmail.com
951e634
Refactor configuration management to use dynamic calls for optimization parameters. Added a helper function to refresh module-level variables after configuration changes. Introduced new CSV files for kit composition and real data, while cleaning up old demand files.
HaLim
e892a6b
demand filtering / visualization done.
HaLim
709359a
data validation in progress and hierarchy parser fixed
HaLim
e542954
remove end date
HaLim
5afa2a4
remove end datae
HaLim
11f91a6
kit composition data cleaner to generate Kit_Composition_and_relation_cleaned_with_line_type
HaLim
17be6b7
demand validation page
HaLim
7181629
Touchpoint - complete idle analysis data
HaLim
868114c
constants file
HaLim
cc411d5
add configuration class
HaLim
de19c07
Add streamlit
HaLim
131af7c
migrate core code name
HaLim
4003592
Delete unncessesary files
HaLim
f73a608
Finalize optimizer with shift type / partial&bulk work type etc
HaLim
42b5ea5
Update csv for unit testing. The optimization most up to date. Streamlit bit fixed
HaLim
26ebf77
Change based on discussion with Christian. Humanizer and Fixed staff are not anymore interchangeable.
HaLim
c21f7f2
add streamlit and clean the optimizer
HaLim
46e0ea9
Finalize ETL and optimization
HaLim
89d7197
finalize etl / optimization configuration
HaLim
08284a1
Update main optimizer as the variable names changed to more intuitive ones
HaLim
8726cfd
Adding etl process and change fixed numbers into variables
HaLim
51181a6
Update the variable name into more intuitive names.
HaLim
f8a0929
Change fixed values into variables from the UI or the database