Coverage for src/scrilla/gui/definitions.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-07-18 18:14 +0000

1# using literal class here causes circular import 

2 

3FUNC_WIDGETS = { 

4 'correlation': { 

5 'name': 'Correlation Matrix', 

6 'shortcut': 'Ctrl+1', 

7 'group': 'analysis' 

8 }, 

9 'discount_dividend': { 

10 'name': 'Discount Dividend Model', 

11 'shortcut': 'Ctrl+2', 

12 'group': 'analysis' 

13 }, 

14 'plot_return_dist': { 

15 'name': 'Distribution of Returns', 

16 'shortcut': 'Ctrl+7', 

17 'group': 'analysis' 

18 }, 

19 'efficient_frontier': { 

20 'name': 'Efficient Frontiers', 

21 'shortcut': 'Ctrl+3', 

22 'group': 'analysis' 

23 }, 

24 'moving_averages': { 

25 'name': 'Moving Averages', 

26 'shortcut': 'Ctrl+4', 

27 'group': 'analysis' 

28 }, 

29 'optimize_portfolio': { 

30 'name': 'Portfolio Optimization', 

31 'shortcut': 'Ctrl+5', 

32 'group': 'allocation' 

33 }, 

34 'risk_profile': { 

35 'name': 'Risk Profile', 

36 'shortcut': 'Ctrl+8', 

37 'group': 'analysis' 

38 

39 }, 

40 'yield_curve': { 

41 'name': 'Yield Curve', 

42 'shortcut': 'Ctrl+9', 

43 'group': 'prices' 

44 } 

45} 

46 

47MENUBAR_WIDGET = { 

48 'Account': [ 

49 { 

50 'name': 'Add API Key', 

51 'shortcut': 'Ctrl+A', 

52 'options': ['AlphaVantage', 'IEX', 'Quandl'] 

53 } 

54 ], 

55 'View': [ 

56 { 

57 'name': 'Function Menu', 

58 'shortcut': 'Ctrl+F' 

59 }, 

60 { 

61 'name': 'Splash Menu', 

62 'shortcut': 'Ctrl+S' 

63 } 

64 ], 

65 'Functions': [ 

66 { 

67 'name': FUNC_WIDGETS[func_widget]['name'], 

68 'shortcut': FUNC_WIDGETS[func_widget]['shortcut'] 

69 } for func_widget in FUNC_WIDGETS 

70 ], 

71} 

72 

73FACTORIES = { 

74 'ATOMIC':{ 

75 'TYPES': ['widget', 'title', 'subtitle', 'heading', 'label', 'error', 'text', 

76 'splash', 'figure', 'footer','calculate-button', 'clear-button', 'hide-button', 

77 'download-button', 'source-button', 'package-button', 'documentation-button', 

78 'okay-button', 'button','save-dialog' , 'table', 'table-item', 'menu-bar'], 

79 'LABEL': ['title', 'subtitle', 'heading', 'label', 'error', 'text', 'splash', 'figure', 

80 'footer', 'input-label'], 

81 'BUTTON': [ 'calculate-button', 'clear-button', 'hide-button', 'download-button', 

82 'source-button', 'package-button', 'documentation-button', 'okay-button', 'button'], 

83 'DIALOG': [ 'save-dialog' ], 

84 'TABLE': [ 'table' ], 

85 'ITEM': [ 'table-item' ], 

86 'MENU': [ 'menu-bar' ], 

87 'SIZING':{ 

88 'EXPANDEXPAND': [ 'figure' ], 

89 'EXPANDMIN': [ 'table' ], 

90 'MINMAX': [ 'splash', 'calculate-button', 'clear-button', 'package-button', 'documentation-button', 

91 'okay-button', 'button' ], 

92 'MAXMAX': [ 'hide-button', 'download-button', 'source-button', ], 

93 'MINMIN': [ 'widget' ] 

94 }, 

95 'ALIGN': { 

96 'TOP': [ 'title', 'subtitle', 'label' ], 

97 'LEFT': [ 'heading' ], 

98 'CENTER': [ 'figure' ], 

99 'HCENTER': [ 'error' ], 

100 'BOTTOM': [ 'text', 'footer' ] 

101 }, 

102 'TEMPLATE': [ 'splash' ], 

103 'TITLED': [ 'hide-button', 'download-button', 'source-button'], 

104 'UNTITLED': [ 'input-label' ] 

105 }, 

106 'ARGUMENTS': { 

107 'TYPES': [ 'date', 'decimal', 'currency', 'integer', 'flag', 'symbol', 'symbols'], 

108 'LINE': [ 'decimal', 'currency', 'integer', 'symbol', 'symbols'], 

109 'DATE': [ 'date' ], 

110 'RADIO': [ 'flag' ], 

111 'SIZING':{ 

112 'MAXMAX': [ 'decimal', 'currency', 'integer', 'flag' ], 

113 'MINMAX': [ 'symbol', 'symbols' ] 

114 }, 

115 'CONSTRAINTS': { 

116 'LENGTH': ['symbol', 'symbols'] 

117 }, 

118 'DISABLED': [ 'date', 'decimal', 'currency', 'integer'] 

119 } 

120}