Major Features: - Hierarchical substudy system (like NX Solutions/Subcases) * Shared model files across all substudies * Independent configuration per substudy * Continuation support from previous substudies * Real-time incremental history updates - Live history tracking with optimization_history_incremental.json - Complete bracket_displacement_maximizing study with substudy examples Core Fixes: - Fixed expression update workflow to pass design_vars through simulation_runner * Restored working NX journal expression update mechanism * OP2 timestamp verification instead of file deletion * Resolved issue where all trials returned identical objective values - Fixed LLMOptimizationRunner to pass design variables to simulation runner - Enhanced NXSolver with timestamp-based file regeneration verification New Components: - optimization_engine/llm_optimization_runner.py - LLM-driven optimization runner - optimization_engine/optimization_setup_wizard.py - Phase 3.3 setup wizard - studies/bracket_displacement_maximizing/ - Complete substudy example * run_substudy.py - Substudy runner with continuation * run_optimization.py - Standalone optimization runner * config/substudy_template.json - Template for new substudies * substudies/coarse_exploration/ - 20-trial coarse search * substudies/fine_tuning/ - 50-trial refinement (continuation example) * SUBSTUDIES_README.md - Complete substudy documentation Technical Improvements: - Incremental history saving after each trial (optimization_history_incremental.json) - Expression update workflow: .prt update → NX journal receives values → geometry update → FEM update → solve - Trial indexing fix in substudy result saving - Updated README with substudy system documentation Testing: - Successfully ran 20-trial coarse_exploration substudy - Verified different objective values across trials (workflow fix validated) - Confirmed live history updates in real-time - Tested shared model file usage across substudies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
71 lines
1.8 KiB
Python
71 lines
1.8 KiB
Python
"""Quick test of LLM runner initialization"""
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
|
|
from optimization_engine.llm_optimization_runner import LLMOptimizationRunner
|
|
|
|
# Example LLM workflow
|
|
llm_workflow = {
|
|
'engineering_features': [
|
|
{
|
|
'action': 'extract_displacement',
|
|
'domain': 'result_extraction',
|
|
'description': 'Extract displacement from OP2',
|
|
'params': {'result_type': 'displacement'}
|
|
}
|
|
],
|
|
'inline_calculations': [
|
|
{
|
|
'action': 'normalize',
|
|
'params': {
|
|
'input': 'max_displacement',
|
|
'reference': 'max_allowed_disp',
|
|
'value': 5.0
|
|
},
|
|
'code_hint': 'norm_disp = max_displacement / 5.0'
|
|
}
|
|
],
|
|
'post_processing_hooks': [
|
|
{
|
|
'action': 'weighted_objective',
|
|
'params': {
|
|
'inputs': ['norm_disp'],
|
|
'weights': [1.0],
|
|
'objective': 'minimize'
|
|
}
|
|
}
|
|
],
|
|
'optimization': {
|
|
'algorithm': 'TPE',
|
|
'direction': 'minimize',
|
|
'design_variables': [
|
|
{
|
|
'parameter': 'wall_thickness',
|
|
'min': 3.0,
|
|
'max': 8.0
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
def dummy_updater(dv):
|
|
pass
|
|
|
|
def dummy_runner():
|
|
return Path('tests/bracket_sim1-solution_1.op2')
|
|
|
|
print("Initializing LLM runner...")
|
|
runner = LLMOptimizationRunner(
|
|
llm_workflow=llm_workflow,
|
|
model_updater=dummy_updater,
|
|
simulation_runner=dummy_runner,
|
|
study_name='test'
|
|
)
|
|
|
|
print(f"\nSuccess!")
|
|
print(f"Extractors: {len(runner.extractors)}")
|
|
print(f"Inline code: {len(runner.inline_code)}")
|
|
print(f"Hooks: {runner.hook_manager.get_summary()['enabled_hooks']}")
|