Skip to content

Commit

Permalink
Update oqmd.py
Browse files Browse the repository at this point in the history
* Add the allow_pickle option to np.load
  • Loading branch information
Tony-Y authored Dec 7, 2022
1 parent db3306a commit 0c9c065
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OQMD/oqmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def magnetization_per_atom(x):

def load_materials(filepath):
try:
data = np.load(filepath)['materials']
data = np.load(filepath, allow_pickle=True)['materials']
except UnicodeError:
data = np.load(filepath, encoding='latin1')['materials']
data = np.load(filepath, allow_pickle=True, encoding='latin1')['materials']
return data

def get_prop(path):
Expand Down Expand Up @@ -85,7 +85,7 @@ def get_prop(path):
graph_nodes = []
graph_edges = []
for path in graph_files:
data = np.load(path)
data = np.load(path, allow_pickle=True)
graph_names += list(data['graph_names'])
graph_nodes += list(data['graph_nodes'])
graph_edges += list(data['graph_edges'])
Expand Down

0 comments on commit 0c9c065

Please sign in to comment.