@@ -171,6 +171,18 @@ def verify_orientation(data):
171
171
index2
172
172
):
173
173
flag_first_sample = "Index1_and_Index2_RC"
174
+ elif subset [0 ]["idx1" ] == index2 and subset [0 ]["idx2" ] == index1 :
175
+ flag_first_sample = "Index1_and_Index2_Swapped"
176
+ elif subset [0 ]["idx1" ] == rc (index2 ) and subset [0 ]["idx2" ] == index1 :
177
+ flag_first_sample = "Index1_and_Index2_Swapped_plus_Index1_RC"
178
+ elif subset [0 ]["idx1" ] == index2 and subset [0 ]["idx2" ] == rc (index1 ):
179
+ flag_first_sample = "Index1_and_Index2_Swapped_plus_Index2_RC"
180
+ elif subset [0 ]["idx1" ] == rc (index2 ) and subset [0 ]["idx2" ] == rc (
181
+ index1
182
+ ):
183
+ flag_first_sample = (
184
+ "Index1_and_Index2_Swapped_plus_Index1_and_Index2_RC"
185
+ )
174
186
# Check the last sample
175
187
if subset [- 1 ]["idx1" ] == index1 and subset [- 1 ]["idx2" ] == index2 :
176
188
flag_last_sample = "CORRECT"
@@ -182,6 +194,18 @@ def verify_orientation(data):
182
194
index2
183
195
):
184
196
flag_last_sample = "Index1_and_Index2_RC"
197
+ elif subset [0 ]["idx1" ] == index2 and subset [0 ]["idx2" ] == index1 :
198
+ flag_last_sample = "Index1_and_Index2_Swapped"
199
+ elif subset [0 ]["idx1" ] == rc (index2 ) and subset [0 ]["idx2" ] == index1 :
200
+ flag_last_sample = "Index1_and_Index2_Swapped_plus_Index1_RC"
201
+ elif subset [0 ]["idx1" ] == index2 and subset [0 ]["idx2" ] == rc (index1 ):
202
+ flag_last_sample = "Index1_and_Index2_Swapped_plus_Index2_RC"
203
+ elif subset [0 ]["idx1" ] == rc (index2 ) and subset [0 ]["idx2" ] == rc (
204
+ index1
205
+ ):
206
+ flag_last_sample = (
207
+ "Index1_and_Index2_Swapped_plus_Index1_and_Index2_RC"
208
+ )
185
209
# Make a conclusion
186
210
if flag_first_sample == flag_last_sample == "CORRECT" :
187
211
flag_idx_search = True
@@ -204,6 +228,42 @@ def verify_orientation(data):
204
228
)
205
229
flag_idx_search = True
206
230
break
231
+ elif flag_first_sample == flag_last_sample == "Index1_and_Index2_Swapped" :
232
+ message .append (
233
+ f"Seems that Index 1 and Index 2 are swapped for pool { p } "
234
+ )
235
+ flag_idx_search = True
236
+ break
237
+ elif (
238
+ flag_first_sample
239
+ == flag_last_sample
240
+ == "Index1_and_Index2_Swapped_plus_Index1_RC"
241
+ ):
242
+ message .append (
243
+ f"Seems that Index 1 and Index 2 are swapped, and Index 1 needs to be converted to RC for pool { p } "
244
+ )
245
+ flag_idx_search = True
246
+ break
247
+ elif (
248
+ flag_first_sample
249
+ == flag_last_sample
250
+ == "Index1_and_Index2_Swapped_plus_Index2_RC"
251
+ ):
252
+ message .append (
253
+ f"Seems that Index 1 and Index 2 are swapped, and Index 2 needs to be converted to RC for pool { p } "
254
+ )
255
+ flag_idx_search = True
256
+ break
257
+ elif (
258
+ flag_first_sample
259
+ == flag_last_sample
260
+ == "Index1_and_Index2_Swapped_plus_Index1_and_Index2_RC"
261
+ ):
262
+ message .append (
263
+ f"Seems that Index 1 and Index 2 are swapped, and both Index 1 and Index 2 need to be converted to RC for pool { p } "
264
+ )
265
+ flag_idx_search = True
266
+ break
207
267
elif flag_first_sample != flag_last_sample :
208
268
message .append (f"Inconsistent Index pattern detected for pool { p } " )
209
269
flag_idx_search = True
0 commit comments