Coverage for src / monte_neo / cli / menu / mc_config.py: 0%

16 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-28 16:27 +0200

1"""Monte Carlo configuration workflow.""" 

2 

3from __future__ import annotations 

4 

5from typing import TYPE_CHECKING 

6 

7import questionary 

8from rich.console import Console 

9 

10from monte_neo.cli.styles import CUSTOM_STYLE 

11 

12if TYPE_CHECKING: 

13 from monte_neo.cli.menu.main import InteractiveMenu 

14 

15console = Console() 

16 

17 

18def configure_mc_workflow(menu: InteractiveMenu) -> None: 

19 """Configure Monte Carlo methods workflow.""" 

20 console.print("\n[bold cyan]🎲 Configure Monte Carlo Methods[/]\n") 

21 

22 methods_choices = [ 

23 {"name": "🔀 Return Shuffling", "value": "shuffling", "checked": "shuffling" in menu._mc_methods}, 

24 {"name": "🎲 Noise Injection", "value": "noise", "checked": "noise" in menu._mc_methods}, 

25 {"name": "📏 Sensitivity Analysis (±10%)", "value": "sensitivity", "checked": "sensitivity" in menu._mc_methods}, 

26 {"name": "📅 Walk-Forward Analysis", "value": "walk_forward", "checked": "walk_forward" in menu._mc_methods}, 

27 {"name": "📦 Block Bootstrap", "value": "block_bootstrap", "checked": "block_bootstrap" in menu._mc_methods}, 

28 ] 

29 

30 selected = questionary.checkbox( 

31 "Select MC methods:", 

32 choices=methods_choices, 

33 style=CUSTOM_STYLE, 

34 ).ask() 

35 

36 if selected is not None: 

37 menu._mc_methods = selected 

38 

39 console.print("\n[green]✓ Monte Carlo methods configured:[/]") 

40 for method in menu._mc_methods: 

41 console.print(f" • {method}") 

42 console.print() 

43