2025-12-07 14:52:25 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
"""
|
|
|
|
|
{STUDY_NAME} - Optimization Script (Simplified)
|
|
|
|
|
================================================================
|
|
|
|
|
|
|
|
|
|
This script uses the ConfigDrivenRunner for config-driven optimization.
|
|
|
|
|
The ~300 lines of boilerplate code is now handled automatically.
|
|
|
|
|
|
|
|
|
|
Workflow:
|
|
|
|
|
---------
|
|
|
|
|
1. python run_optimization.py --discover # Model introspection
|
|
|
|
|
2. python run_optimization.py --validate # Single trial validation
|
|
|
|
|
3. python run_optimization.py --test # Quick 3-trial test
|
|
|
|
|
4. python run_optimization.py --run # Full optimization
|
|
|
|
|
|
|
|
|
|
Generated by Atomizer StudyWizard
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
# Add project root to path
|
|
|
|
|
project_root = Path(__file__).resolve().parents[2]
|
|
|
|
|
sys.path.insert(0, str(project_root))
|
|
|
|
|
|
refactor: Major reorganization of optimization_engine module structure
BREAKING CHANGE: Module paths have been reorganized for better maintainability.
Backwards compatibility aliases with deprecation warnings are provided.
New Structure:
- core/ - Optimization runners (runner, intelligent_optimizer, etc.)
- processors/ - Data processing
- surrogates/ - Neural network surrogates
- nx/ - NX/Nastran integration (solver, updater, session_manager)
- study/ - Study management (creator, wizard, state, reset)
- reporting/ - Reports and analysis (visualizer, report_generator)
- config/ - Configuration management (manager, builder)
- utils/ - Utilities (logger, auto_doc, etc.)
- future/ - Research/experimental code
Migration:
- ~200 import changes across 125 files
- All __init__.py files use lazy loading to avoid circular imports
- Backwards compatibility layer supports old import paths with warnings
- All existing functionality preserved
To migrate existing code:
OLD: from optimization_engine.nx_solver import NXSolver
NEW: from optimization_engine.nx.solver import NXSolver
OLD: from optimization_engine.runner import OptimizationRunner
NEW: from optimization_engine.core.runner import OptimizationRunner
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 12:30:59 -05:00
|
|
|
from optimization_engine.core.base_runner import ConfigDrivenRunner
|
2025-12-07 14:52:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
"""Run optimization using config-driven runner."""
|
|
|
|
|
# Create runner - all config read from optimization_config.json
|
|
|
|
|
runner = ConfigDrivenRunner(__file__)
|
|
|
|
|
|
|
|
|
|
# Element type: 'auto' detects from DAT file
|
|
|
|
|
# Override if needed: runner.element_type = 'cquad4' (shell) or 'ctetra' (solid)
|
|
|
|
|
|
|
|
|
|
return runner.run()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
exit(main())
|