@@ -30,17 +30,14 @@ def setup(self):
30
30
31
31
ai = self .import_from_inputs ()
32
32
33
- # self.wsBackIC = ai.LoadVesuvioBackParameters
34
- # self.wsFrontIC = ai.LoadVesuvioFrontParameters
35
- self .bckwdIC = ai .BackwardInitialConditions
36
- self .fwdIC = ai .ForwardInitialConditions
37
- self .yFitIC = ai .YSpaceFitInitialConditions
38
- # self.userCtr = ai.UserScriptControls
33
+ self .bckwd_ai = ai .BackwardAnalysisInputs
34
+ self .fwd_ai = ai .ForwardAnalysisInputs
35
+ self .yFitIC = ai .YSpaceFitInputs
39
36
40
37
# Names of workspaces to check if they exist to skip analysis
41
38
self .ws_to_fit_y_space = []
42
39
self .classes_to_fit_y_space = []
43
- for ai_cls in [self .bckwdIC , self .fwdIC ]:
40
+ for ai_cls in [self .bckwd_ai , self .fwd_ai ]:
44
41
if ai_cls .fit_in_y_space :
45
42
self .ws_to_fit_y_space .append (name_for_starting_ws (ai_cls ) + '_' + str (ai_cls .noOfMSIterations ))
46
43
self .classes_to_fit_y_space .append (ai_cls )
@@ -56,12 +53,12 @@ def setup(self):
56
53
self .input_ws_path .mkdir (parents = True , exist_ok = True )
57
54
58
55
# TODO: Output paths should probably not be set like this
59
- self ._set_output_paths (self .bckwdIC )
60
- self ._set_output_paths (self .fwdIC )
56
+ self ._set_output_paths (self .bckwd_ai )
57
+ self ._set_output_paths (self .fwd_ai )
61
58
62
59
# TODO: remove this by fixing circular import
63
- self .fwdIC .name = name_for_starting_ws (self .fwdIC )
64
- self .bckwdIC .name = name_for_starting_ws (self .bckwdIC )
60
+ self .fwd_ai .name = name_for_starting_ws (self .fwd_ai )
61
+ self .bckwd_ai .name = name_for_starting_ws (self .bckwd_ai )
65
62
66
63
# TODO: sort out yfit inputs
67
64
figSavePath = self .experiment_path / "figures"
@@ -79,7 +76,7 @@ def import_from_inputs(self):
79
76
80
77
81
78
def run (self ):
82
- if not self .bckwdIC .run_this_scattering_type and not self .fwdIC .run_this_scattering_type :
79
+ if not self .bckwd_ai .run_this_scattering_type and not self .fwd_ai .run_this_scattering_type :
83
80
return
84
81
# Default workflow for procedure + fit in y space
85
82
@@ -104,25 +101,25 @@ def runAnalysisFitting(self):
104
101
105
102
def runAnalysisRoutine (self ):
106
103
107
- if self .bckwdIC .run_this_scattering_type :
104
+ if self .bckwd_ai .run_this_scattering_type :
108
105
109
- if is_hydrogen_present (self .fwdIC .masses ) & (self .bckwdIC .HToMassIdxRatio == 0 ):
106
+ if is_hydrogen_present (self .fwd_ai .masses ) & (self .bckwd_ai .HToMassIdxRatio == 0 ):
110
107
self .run_estimate_h_ratio ()
111
108
return
112
109
113
110
# TODO: make this automatic
114
- assert is_hydrogen_present (self .fwdIC .masses ) != (
115
- self .bckwdIC .HToMassIdxRatio == 0
111
+ assert is_hydrogen_present (self .fwd_ai .masses ) != (
112
+ self .bckwd_ai .HToMassIdxRatio == 0
116
113
), "No Hydrogen detected, HToMassIdxRatio has to be set to 0"
117
114
118
- if self .bckwdIC .run_this_scattering_type and self .fwdIC .run_this_scattering_type :
115
+ if self .bckwd_ai .run_this_scattering_type and self .fwd_ai .run_this_scattering_type :
119
116
self .run_joint_analysis ()
120
117
return
121
- if self .bckwdIC .run_this_scattering_type :
122
- self .run_single_analysis (self .bckwdIC )
118
+ if self .bckwd_ai .run_this_scattering_type :
119
+ self .run_single_analysis (self .bckwd_ai )
123
120
return
124
- if self .fwdIC .run_this_scattering_type :
125
- self .run_single_analysis (self .fwdIC )
121
+ if self .fwd_ai .run_this_scattering_type :
122
+ self .run_single_analysis (self .fwd_ai )
126
123
return
127
124
return
128
125
@@ -137,8 +134,8 @@ def run_single_analysis(self, ai):
137
134
138
135
def run_joint_analysis (self ):
139
136
AnalysisDataService .clear ()
140
- back_alg = self ._create_analysis_algorithm (self .bckwdIC )
141
- front_alg = self ._create_analysis_algorithm (self .fwdIC )
137
+ back_alg = self ._create_analysis_algorithm (self .bckwd_ai )
138
+ front_alg = self ._create_analysis_algorithm (self .fwd_ai )
142
139
self .run_joint_algs (back_alg , front_alg )
143
140
return
144
141
@@ -187,8 +184,8 @@ def run_estimate_h_ratio(self):
187
184
188
185
table_h_ratios = create_table_for_hydrogen_to_mass_ratios ()
189
186
190
- back_alg = self ._create_analysis_algorithm (self .bckwdIC )
191
- front_alg = self ._create_analysis_algorithm (self .fwdIC )
187
+ back_alg = self ._create_analysis_algorithm (self .bckwd_ai )
188
+ front_alg = self ._create_analysis_algorithm (self .fwd_ai )
192
189
193
190
front_alg .execute ()
194
191
0 commit comments