@@ -128,7 +128,7 @@ def make_problem(project: RATapi.Project) -> ProblemDefinition:
128128 contrast_background_params = []
129129
130130 for contrast in project .contrasts :
131- background = project .backgrounds [project . backgrounds . index ( contrast .background ) ]
131+ background = project .backgrounds [contrast .background ]
132132 if background .type == TypeOptions .Data :
133133 contrast_background_params .append (- 1 )
134134 else :
@@ -138,7 +138,7 @@ def make_problem(project: RATapi.Project) -> ProblemDefinition:
138138 contrast_resolution_params = []
139139
140140 for contrast in project .contrasts :
141- resolution = project .resolutions [project . resolutions . index ( contrast .resolution ) ]
141+ resolution = project .resolutions [contrast .resolution ]
142142 if resolution .type == TypeOptions .Data :
143143 contrast_resolution_params .append (- 1 )
144144 else :
@@ -160,7 +160,7 @@ def make_problem(project: RATapi.Project) -> ProblemDefinition:
160160 problem .resolutionParams = [param .value for param in project .resolution_parameters ]
161161 problem .contrastBulkIns = [project .bulk_in .index (contrast .bulk_in , True ) for contrast in project .contrasts ]
162162 problem .contrastBulkOuts = [project .bulk_out .index (contrast .bulk_out , True ) for contrast in project .contrasts ]
163- problem .contrastQzshifts = [0 ] * len (project .contrasts ) # This is marked as "to do" in RAT
163+ problem .contrastQzshifts = [1 ] * len (project .contrasts ) # This is marked as "to do" in RAT
164164 problem .contrastScalefactors = [
165165 project .scalefactors .index (contrast .scalefactor , True ) for contrast in project .contrasts
166166 ]
@@ -239,9 +239,7 @@ def make_data_present(project: RATapi.Project) -> list[int]:
239239 The "dataPresent" field of the problem input used in the compiled RAT code.
240240
241241 """
242- return [
243- 1 if project .data [project .data .index (contrast .data )].data .size != 0 else 0 for contrast in project .contrasts
244- ]
242+ return [1 if project .data [contrast .data ].data .size != 0 else 0 for contrast in project .contrasts ]
245243
246244
247245def check_indices (problem : ProblemDefinition ) -> None :
0 commit comments