You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constraints.append('todolist.cbv_area IN ('+','.join([str(int(c)) forcinatleast_1d(cbv_area)]) +')')
63
65
64
-
iftmag_minisnotNoneandtmag_maxisnotNone:
65
-
constraints.append(f"(todolist.tmag BETWEEN {tmag_min:f} AND {tmag_max:f} OR (todolist.datasource LIKE 'tpf:%' AND CAST(SUBSTR(todolist.datasource,5) AS INTEGER) IN (SELECT DISTINCT starid FROM todolist t2 WHERE t2.datasource='tpf' AND t2.tmag BETWEEN {tmag_min:f} AND {tmag_max:f})))")
66
-
eliftmag_minisnotNone:
67
-
constraints.append(f"(todolist.tmag >= {tmag_min:f} OR (todolist.datasource LIKE 'tpf:%' AND CAST(SUBSTR(todolist.datasource,5) AS INTEGER) IN (SELECT DISTINCT starid FROM todolist t2 WHERE t2.datasource='tpf' AND t2.tmag >= {tmag_min:f})))")
68
-
eliftmag_maxisnotNone:
69
-
constraints.append(f"(todolist.tmag <= {tmag_max:f} OR (todolist.datasource LIKE 'tpf:%' AND CAST(SUBSTR(todolist.datasource,5) AS INTEGER) IN (SELECT DISTINCT starid FROM todolist t2 WHERE t2.datasource='tpf' AND t2.tmag <= {tmag_max:f})))")
66
+
iftmag_minisnotNoneortmag_maxisnotNone:
67
+
# To avoid having three separate cases, we join all cases by
68
+
# putting in dummy upper and lower bounds in case they are
69
+
# not provided. The values should be outside the range on any normal stars:
70
+
tmag_min=-99iftmag_minisNoneelsetmag_min
71
+
tmag_max=99iftmag_maxisNoneelsetmag_max
72
+
constraints.append(f"((todolist.datasource NOT LIKE 'tpf:%' AND todolist.tmag BETWEEN {tmag_min:f} AND {tmag_max:f}) OR (todolist.datasource LIKE 'tpf:%' AND CAST(SUBSTR(todolist.datasource,5) AS INTEGER) IN (SELECT DISTINCT starid FROM todolist t2 WHERE t2.datasource='tpf' AND t2.tmag BETWEEN {tmag_min:f} AND {tmag_max:f})))")
0 commit comments