@@ -78,19 +78,30 @@ def diff_header_fields(key, inputs):
78
78
keyed_inputs = []
79
79
80
80
for i in inputs : # stores each file's respective header files
81
+ field_value = i [key ]
81
82
82
83
try :
83
- if np .all (np .isnan (i [ key ] )):
84
+ if np .all (np .isnan (field_value )):
84
85
continue
85
86
except TypeError :
86
87
pass
87
88
88
- if i [key ].ndim < 1 :
89
- keyed_inputs .append ("{}@{}" .format (i [key ], i [key ].dtype ))
90
- elif i [key ].ndim == 1 :
91
- keyed_inputs .append ("{}@{}" .format (list (i [key ]), i [key ].dtype ))
89
+ for x in inputs [1 :]:
90
+ data_diff = diff_values (str (x [key ].dtype ), str (field_value .dtype ))
91
+
92
+ if data_diff :
93
+ break
94
+
95
+ if data_diff :
96
+ if field_value .ndim < 1 :
97
+ keyed_inputs .append ("{}@{}" .format (field_value , field_value .dtype ))
98
+ elif field_value .ndim == 1 :
99
+ keyed_inputs .append ("{}@{}" .format (list (field_value ), field_value .dtype ))
92
100
else :
93
- pass
101
+ if field_value .ndim < 1 :
102
+ keyed_inputs .append ("{}" .format (field_value ))
103
+ elif field_value .ndim == 1 :
104
+ keyed_inputs .append ("{}" .format (list (field_value )))
94
105
95
106
if keyed_inputs : # sometimes keyed_inputs is empty lol
96
107
comparison_input = keyed_inputs [0 ]
@@ -139,8 +150,7 @@ def main():
139
150
140
151
diff = get_headers_diff (files , opts )
141
152
142
- if opts .text :
143
-
153
+ if opts .text : # using string formatting to print a table of the results
144
154
print ("{:<11}" .format ('Field' ), end = "" , flush = True )
145
155
146
156
for f in files :
0 commit comments