Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions stratevo/ml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,21 @@
__all__.append("WalkForwardPipeline")
except ImportError:
pass

try:
from stratevo.ml.model_selection import ModelSelector
__all__.append("ModelSelector")
except ImportError:
pass

try:
from stratevo.ml.prediction_tracker import PredictionTracker
__all__.append("PredictionTracker")
except ImportError:
pass

try:
from stratevo.ml.data_splitter import FinancialDataSplitter
__all__.append("FinancialDataSplitter")
except ImportError:
pass
3 changes: 2 additions & 1 deletion stratevo/strategies/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"""stratevo.strategies - Trading strategies."""

from stratevo.strategies.momentum_jt import MomentumJTStrategy
from stratevo.strategies.combiner import StrategyCombiner
from stratevo.strategies.combiner import StrategyCombiner, MomentumAdapter

__all__ = [
"MomentumJTStrategy",
"StrategyCombiner",
"MomentumAdapter",
]

try:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_security_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def test_factor_eval_cannot_import(self):
volume = np.array([100.0, 200.0, 300.0])

# Attempting to import in a sandboxed eval should fail
with pytest.raises((NameError, TypeError)):
with pytest.raises((NameError, TypeError, ValueError)):
evaluate_formula(
"__import__('os').system('echo pwned')",
close, high, low, volume,
Expand All @@ -761,7 +761,7 @@ def test_factor_eval_cannot_access_builtins(self):
low = np.array([0.5, 1.5, 2.5])
volume = np.array([100.0, 200.0, 300.0])

with pytest.raises((NameError, TypeError, KeyError)):
with pytest.raises((NameError, TypeError, KeyError, ValueError)):
evaluate_formula(
"__builtins__['__import__']('os').listdir('.')",
close, high, low, volume,
Expand Down
Loading