@@ -43,15 +43,16 @@ def computeLambdaConditions(line_dict,args):
43
43
44
44
# Lists determine a range of values to plot
45
45
if isinstance (value ,list ):
46
- lambda_expression = addConditionToLambda (lambda_expression ,f"x['{ key } '] >= { value [0 ]} " ,"and" )
47
- lambda_expression = addConditionToLambda (lambda_expression ,f"x['{ key } '] <= { value [1 ]} " ,"and" )
46
+ lambda_expression = addConditionToLambda (lambda_expression ,f"x['{ key } '] >= { value [0 ]} " ,"and" )
47
+ lambda_expression = addConditionToLambda (lambda_expression ,f"x['{ key } '] <= { value [1 ]} " ,"and" )
48
48
49
- elif isinstance (value , int ) or isinstance ( value ,float ):
50
- lambda_expression = addConditionToLambda (lambda_expression ,f"x['{ key } '] == { value } " ,"and" )
49
+ elif type (value ) in ( int ,float ):
50
+ lambda_expression = addConditionToLambda (lambda_expression ,f"x['{ key } '] == { value } " ,"and" )
51
51
52
52
# A bool determines whether to include all available values of a field or not
53
53
# Being false is equal to not being declared
54
- elif isinstance (value ,bool ):
54
+ # https://stackoverflow.com/questions/37888620/comparing-boolean-and-int-using-isinstance
55
+ elif type (value ) == bool :
55
56
# Retrieve the value, if the key doesn't exist .get() returns None
56
57
if value :
57
58
lambda_expression = addConditionToLambda (lambda_expression ,f"x.get('{ key } ')" ,"and" )
@@ -153,6 +154,9 @@ def main():
153
154
y_data .append (round (float (line [1 ]),4 ))
154
155
155
156
# Sorting data --> https://stackoverflow.com/questions/9764298/given-parallel-lists-how-can-i-sort-one-while-permuting-rearranging-the-other
157
+ print (x_data )
158
+ print (y_data )
159
+ exit ()
156
160
x_data_sorted ,y_data_sorted = zip (* sorted (zip (x_data ,y_data )))
157
161
158
162
plot_line ['x_values' ] = x_data_sorted
0 commit comments