Skip to content

Commit

Permalink
Update utilities.py
Browse files Browse the repository at this point in the history
Modified the Json file access tool.
  • Loading branch information
Kempe committed Sep 20, 2024
1 parent 3d9c451 commit c3cdfe5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pvdeg/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,15 @@ def _read_material(name, fname="O2permeation.json"):
fpath = os.path.join(DATA_DIR, fname)
with open(fpath) as f:
data = json.load(f)

f.close()
print('work')
if name is None:
material_list = data.keys()
material_list = ''
print('working')
for key in data:
if 'name' in data[key].keys():
material_list = material_list + key + "=" + data[key]['name'] + '\n'
material_list = material_list[0:len(material_list)-1]
return [*material_list]

mat_dict = data[name]
Expand Down

0 comments on commit c3cdfe5

Please sign in to comment.