Skip to content
Snippets Groups Projects
Commit e86922ca authored by Aakash Ashok Naik's avatar Aakash Ashok Naik :eyes:
Browse files

Replace atomic_properties_magpie.py

parent efee07a0
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
# coding: utf-8
# In[1]:
'''
Module : atomic_properties_magpie
This module with help of atomic_properties_magpie class from metainfo module instantiates objects with atomic element symbol as identifier to access atomic features available
'''
from atomicfeaturespackage.metainfo.metainfo import atomic_properties_magpie,metadata
import pandas as pd
......@@ -10,28 +13,20 @@ import numpy as np
from mendeleev import element
import os
# In[2]:
# This method_list object could be called after importing this module so one can easily see all the quantities accessible.
method_list = [method for method in dir(atomic_properties_magpie) if (method.startswith('m_') or method.startswith('_') or method.startswith('__') or method.startswith('val') or method.startswith('section_') or method.startswith('get')) is False]
# In[3]:
ls = list(range(0,112))
df = pd.DataFrame(index = ls,columns = method_list)
# In[ ]:
path = os.path.abspath(os.path.join(os.path.dirname(__file__),".."))
# In[4]:
def ionizationen():
ie = pd.read_table(os.path.join(path, "data","matminer", "IonizationEnergies.table"),header=None,sep = '\t')
ie['combined']= ie.values.tolist()
......@@ -54,15 +49,11 @@ def oxistates():
def atomicsymbol():
count = 0
for i in df['atomic_number']:
#for item in df.iloc[count,5]:
df.iloc[count,5] = element(i).symbol
count+=1
#Read the magpie data files and clean and arrange systematically in a pandas dataframe.
# In[5]:
df['atomic_ICSD_vol'] = pd.read_table(os.path.join(path, "data","matminer", "ICSDVolume.table"),header=None)
df['atomic_cpmass'] = pd.read_table(os.path.join(path, "data","matminer", "HeatCapacityMass.table"),header=None)
df['atomic_cpmolar'] = pd.read_table(os.path.join(path, "data","matminer", "HeatCapacityMolar.table"),header=None)
......@@ -129,22 +120,10 @@ df['thermal_cond_log'] = pd.read_table(os.path.join(path, "data","matminer", "Lo
df['atomic_ie'] = ionizationen()
# In[6]:
df.replace(to_replace = ['Missing','Missing["NotAvailable"]','Missing["Unknown"]','None','NA'], value = np.nan,inplace=True )
# In[ ]:
# ### Section instantiation and its objects attributes are filled. This will create 118 objects unique ( atomic element symbol) which can be used to access its properties
# In[7]:
#Section instantiation and its objects attributes are filled. This will create 118 objects unique ( atomic element symbol) which can be used to access its properties
objs = []
for i in df['atomic_element_symbol']:
......@@ -152,16 +131,6 @@ for i in df['atomic_element_symbol']:
prop = matminer.m_create(metadata)
objs.append(matminer)
# In[ ]:
# In[8]:
count = 0
for obj in objs:
obj.section_magpie_metadata.source = 'Magpie'
......@@ -238,16 +207,11 @@ for count, symbol in enumerate(atomic_element_symbol):
globals()[symbol] = objs[count]
# In[9]:
df.columns
# In[10]:
def definition(abc):
'''
This function can be used to access quantity definitions for each element features accessible
'''
if abc == 'atomic_ICSD_vol':
return atomic_properties_magpie.atomic_ICSD_vol.__doc__
if abc == 'atomic_cpmass':
......@@ -386,21 +350,7 @@ def definition(abc):
return metadata.atomic_basis_set.__doc__
# In[11]:
def symbol(abc):
return globals()[abc]
# In[ ]:
# In[ ]:
return globals()[abc]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment