Skip to content

Commit 3917724

Browse files
authored
Merge pull request #840 from HyunsuLee/batch_exam_error_fix
refactor: update JSON loading to use ODict for consistency
2 parents 1391ade + 4aa66f8 commit 3917724

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/batchCell/src/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def readBatchData(dataFolder, batchLabel, loadAll=False, saveAll=True, vars=None
1919
print('\nLoading single file with all data...')
2020
filename = '%s/%s/%s_allData.json' % (dataFolder, batchLabel, batchLabel)
2121
with open(filename, 'r') as fileObj:
22-
dataLoad = json.load(fileObj, object_pairs_hook=specs.OrderedDict)
22+
dataLoad = json.load(fileObj, object_pairs_hook=specs.ODict)
2323
params = dataLoad['params']
2424
data = dataLoad['data']
2525
return params, data
@@ -52,10 +52,10 @@ def readBatchData(dataFolder, batchLabel, loadAll=False, saveAll=True, vars=None
5252
# read output file
5353
iCombStr = ''.join([''.join('_'+str(i)) for i in iComb])
5454
simLabel = b['batchLabel']+iCombStr
55-
outFile = b['saveFolder']+'/'+simLabel+'.json'
55+
outFile = b['saveFolder']+'/'+simLabel+'_data.json'
5656
try:
5757
with open(outFile, 'r') as fileObj:
58-
output = json.load(fileObj, object_pairs_hook=specs.OrderedDict)
58+
output = json.load(fileObj, object_pairs_hook=specs.ODict)
5959

6060
# save output file in data dict
6161
data[iCombStr] = {}

0 commit comments

Comments
 (0)