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>
This commit is contained in:
51
optimization_engine/nx/__init__.py
Normal file
51
optimization_engine/nx/__init__.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
NX Integration
|
||||
==============
|
||||
|
||||
Siemens NX and Nastran integration modules.
|
||||
|
||||
Modules:
|
||||
- solver: NXSolver for running simulations
|
||||
- updater: NXParameterUpdater for design updates
|
||||
- session_manager: NX session lifecycle management
|
||||
- solve_simulation: Low-level simulation execution
|
||||
"""
|
||||
|
||||
# Lazy imports to avoid import errors when NX modules aren't available
|
||||
def __getattr__(name):
|
||||
if name == 'NXSolver':
|
||||
from .solver import NXSolver
|
||||
return NXSolver
|
||||
elif name == 'run_nx_simulation':
|
||||
from .solver import run_nx_simulation
|
||||
return run_nx_simulation
|
||||
elif name == 'NXParameterUpdater':
|
||||
from .updater import NXParameterUpdater
|
||||
return NXParameterUpdater
|
||||
elif name == 'update_nx_model':
|
||||
from .updater import update_nx_model
|
||||
return update_nx_model
|
||||
elif name == 'NXSessionManager':
|
||||
from .session_manager import NXSessionManager
|
||||
return NXSessionManager
|
||||
elif name == 'NXSessionInfo':
|
||||
from .session_manager import NXSessionInfo
|
||||
return NXSessionInfo
|
||||
elif name == 'ModelCleanup':
|
||||
from .model_cleanup import ModelCleanup
|
||||
return ModelCleanup
|
||||
elif name == 'cleanup_substudy':
|
||||
from .model_cleanup import cleanup_substudy
|
||||
return cleanup_substudy
|
||||
raise AttributeError(f"module 'optimization_engine.nx' has no attribute '{name}'")
|
||||
|
||||
__all__ = [
|
||||
'NXSolver',
|
||||
'run_nx_simulation',
|
||||
'NXParameterUpdater',
|
||||
'update_nx_model',
|
||||
'NXSessionManager',
|
||||
'NXSessionInfo',
|
||||
'ModelCleanup',
|
||||
'cleanup_substudy',
|
||||
]
|
||||
Reference in New Issue
Block a user