@@ -38,6 +38,9 @@ class Script(object):
38
38
show_on_webpage : bool
39
39
# additional arguments to be fed to a given script
40
40
additional_arguments : dict
41
+ # Use in the case where we have comparisons? The scripts may be disabled
42
+ # in comparison cases for performance reasons.
43
+ use_for_comparison : bool
41
44
42
45
def __init__ (self , script_dict : dict ):
43
46
"""
@@ -51,6 +54,7 @@ def __init__(self, script_dict: dict):
51
54
self .title = script_dict .get ("title" , "" )
52
55
self .show_on_webpage = script_dict .get ("show_on_webpage" , True )
53
56
self .additional_arguments = script_dict .get ("additional_arguments" , {})
57
+ self .use_for_comparison = script_dict .get ("use_for_comparison" , True )
54
58
return
55
59
56
60
def __str__ (self ):
@@ -85,7 +89,7 @@ class Config(object):
85
89
86
90
# Raw config read directly from the file, before processing.
87
91
raw_config : dict
88
- scripts : List [Script ]
92
+ raw_scripts : List [Script ]
89
93
90
94
# Set up the object.
91
95
__slots__ = list (direct_read .keys ()) + ["scripts" , "config_directory" , "raw_config" ]
@@ -143,6 +147,23 @@ def __extract_scripts(self):
143
147
"""
144
148
145
149
raw_scripts = self .raw_config .get ("scripts" , [])
146
- self .scripts = [Script (script_dict = script_dict ) for script_dict in raw_scripts ]
150
+ self .raw_scripts = [
151
+ Script (script_dict = script_dict ) for script_dict in raw_scripts
152
+ ]
147
153
148
154
return
155
+
156
+ @property
157
+ def scripts (self ):
158
+ """
159
+ Gets all of the scripts defined in the parameter file.
160
+ """
161
+ return self .raw_scripts
162
+
163
+ @property
164
+ def comparison_scripts (self ):
165
+ """
166
+ Gets the scripts only to be used in comparisons from the parameter
167
+ file.
168
+ """
169
+ return [script for script in self .raw_scripts if script .use_for_comparison ]
0 commit comments