@@ -21,6 +21,7 @@ class MISSING:
21
21
VERBOSE = False
22
22
ENABLE_XML = False
23
23
ENABLE_CSV = True
24
+ ENABLE_JSON = True
24
25
25
26
KNOWN_COM_DIFF = set ([
26
27
# On official COM, uninitialized values for CalcCurrent, AllocFactors
@@ -343,15 +344,20 @@ def compare_all(self):
343
344
try :
344
345
fB = zipB .open (fn , 'r' )
345
346
fA = zipA .open (fn , 'r' )
346
- print (fn )
347
347
except KeyError :
348
- print ('MISSING:' , fn )
348
+ if not fn .endswith ('GISCoords.dss' ):
349
+ print ('MISSING:' , fn )
350
+
349
351
continue
350
352
except BadZipFile :
351
353
print ('BAD:' , fn )
352
354
continue
353
355
354
- if fn .endswith ('.json' ):
356
+ if ENABLE_JSON and fn .endswith ('.json' ):
357
+ if not ENABLE_JSON :
358
+ continue
359
+
360
+ print (fn )
355
361
dataA = json .load (fA )
356
362
dataB = json .load (fB )
357
363
@@ -367,7 +373,12 @@ def compare_all(self):
367
373
print ("COMPARE ERROR:" , fn )
368
374
raise
369
375
370
- elif ENABLE_XML and fn .endswith ('.xml' ):
376
+ elif fn .endswith ('.xml' ):
377
+ if not ENABLE_XML :
378
+ continue
379
+
380
+ print (fn )
381
+
371
382
# Comparing the XMLs is tricky, but this initial implementation
372
383
# can still be useful. For DSS C-API 0.13.0, we manually checked.
373
384
# One issue is that the maintenance of ExportCIMXML.pas is not
@@ -391,7 +402,12 @@ def compare_all(self):
391
402
392
403
print (type (d ))
393
404
394
- elif ENABLE_CSV and fn .endswith ('.csv' ):
405
+ elif fn .endswith ('.csv' ):
406
+ if not ENABLE_CSV :
407
+ continue
408
+
409
+ print (fn )
410
+
395
411
# The CSVs from OpenDSS can havbe some weird header, and we need to compare
396
412
# the lowercase data to simplify things.
397
413
textA = fA .read ().decode ().lower ()
@@ -400,6 +416,9 @@ def compare_all(self):
400
416
df_a = pd .read_csv (sfA )
401
417
df_b = pd .read_csv (sfB )
402
418
419
+ df_a .columns = [x .strip () for x in df_a .columns ]
420
+ df_b .columns = [x .strip () for x in df_b .columns ]
421
+
403
422
try :
404
423
pd .testing .assert_frame_equal (df_a , df_b , atol = tol , rtol = tol )
405
424
except :
0 commit comments