refactor: Reorganize code structure and create tests directory

- Consolidate surrogates module to processors/surrogates/
- Move ensemble_surrogate.py to proper location
- Add deprecation shim for old import path
- Create tests/ directory with pytest structure
- Move test files from archive/test_scripts/
- Add conftest.py with shared fixtures

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-07 09:01:37 -05:00
parent 155e2a1b8e
commit 7bdb74f93b
9 changed files with 61 additions and 10 deletions

View File

@@ -59,6 +59,15 @@ def __getattr__(name):
elif name == 'create_exporter_from_config':
from .training_data_exporter import create_exporter_from_config
return create_exporter_from_config
elif name == 'EnsembleSurrogate':
from .ensemble_surrogate import EnsembleSurrogate
return EnsembleSurrogate
elif name == 'OODDetector':
from .ensemble_surrogate import OODDetector
return OODDetector
elif name == 'create_and_train_ensemble':
from .ensemble_surrogate import create_and_train_ensemble
return create_and_train_ensemble
raise AttributeError(f"module 'optimization_engine.processors.surrogates' has no attribute '{name}'")
@@ -76,4 +85,7 @@ __all__ = [
'AutoTrainer',
'TrainingDataExporter',
'create_exporter_from_config',
'EnsembleSurrogate',
'OODDetector',
'create_and_train_ensemble',
]

View File

@@ -1,19 +1,26 @@
"""
Surrogate models for FEA acceleration.
DEPRECATED: This module has been moved to optimization_engine.processors.surrogates
Available surrogates:
- EnsembleSurrogate: Multiple MLPs with uncertainty quantification
- OODDetector: Out-of-distribution detection
Please update your imports:
from optimization_engine.processors.surrogates import EnsembleSurrogate
This module will be removed in a future version.
"""
from .ensemble_surrogate import (
import warnings
warnings.warn(
"optimization_engine.surrogates is deprecated. "
"Use optimization_engine.processors.surrogates instead.",
DeprecationWarning,
stacklevel=2
)
# Redirect imports
from optimization_engine.processors.surrogates import (
EnsembleSurrogate,
OODDetector,
create_and_train_ensemble
)
__all__ = [
'EnsembleSurrogate',
'OODDetector',
'create_and_train_ensemble'
]
__all__ = ['EnsembleSurrogate', 'OODDetector', 'create_and_train_ensemble']