Skip to content
Snippets Groups Projects
Commit cedc0740 authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Merge branch 'pymat_module_error_fix' into 'master'

Pymat module error fix

See merge request nomad-lab/analytics-query-nomad-archive!4
parents 84927ac3 a8b52a29
No related branches found
No related tags found
1 merge request!4Pymat module error fix
File added
...@@ -8,6 +8,7 @@ from metainfo.metainfo import atomic_properties_pymat,metadata ...@@ -8,6 +8,7 @@ from metainfo.metainfo import atomic_properties_pymat,metadata
import pandas as pd import pandas as pd
import numpy as np import numpy as np
import urllib, json, re, typing import urllib, json, re, typing
from pandas.io.json import json_normalize
# #
...@@ -40,7 +41,7 @@ df1 = pd.read_json('./data/json/periodic_table.json') ...@@ -40,7 +41,7 @@ df1 = pd.read_json('./data/json/periodic_table.json')
for elem in df1.columns: for elem in df1.columns:
if type(df1.loc['Shannon radii'][elem]) == dict: if type(df1.loc['Shannon radii'][elem]) == dict:
df1.loc['Shannon radii'][elem] = (pd.json_normalize(df1.loc['Shannon radii'][elem]).to_dict(orient='records')[0]) df1.loc['Shannon radii'][elem] = (json_normalize(df1.loc['Shannon radii'][elem]).to_dict(orient='records')[0])
# ### replace the missing spin data for Shannon radii keys into a dictionary # ### replace the missing spin data for Shannon radii keys into a dictionary
......
...@@ -23,7 +23,7 @@ import pandas as pd ...@@ -23,7 +23,7 @@ import pandas as pd
# Use periods as y axis and groups as x axis for our plot # Use periods as y axis and groups as x axis for our plot
periods = ["I", "II", "III", "IV", "V", "VI", "VII"," ","LC","AC"] periods = ["I", "II", "III", "IV", "V", "VI", "VII"," ","LC","AC"]
groups = [str(x) for x in range(1, 19)] groups = [str(x) for x in range(1, 19)]
pd.options.mode.chained_assignment = None
# In[3]: # In[3]:
...@@ -821,7 +821,7 @@ def ptableplotgenf(Feature): ...@@ -821,7 +821,7 @@ def ptableplotgenf(Feature):
if Feature == 'atomic_r_d_neg_1' : if Feature == 'atomic_r_d_neg_1' :
color_mapper = linear_cmap(field_name = 'atomic_r_d_neg_1', palette = Colorblind[8], color_mapper = linear_cmap(field_name = 'atomic_r_d_neg_1', palette = Colorblind[8],
low = dffa['atomic_r_d_neg_1'].min(), low = dffa['atomic_r_d_neg_1'].min(),
high = dffa['atomic_r_dn_val_1'].max()) high = dffa['atomic_r_d_neg_1'].max())
p2.hover.tooltips = [ p2.hover.tooltips = [
("Name", "@name"), ("Name", "@name"),
("Type", "@metal"), ("Type", "@metal"),
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment