Skip to content

Commit

Permalink
Update quick_check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Posysaev authored Feb 11, 2019
1 parent 7696949 commit 2ff2bfc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions quick_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
# specify your path where to save your data
path = 'E:\\work\\Results_aflow\\GitHub\\'
# and desierd anion and cations
cation = 'Fe'
cation = 'Mn'
anion = 'F'
#if you already downloaded data after first launch, make it True
data_saved = False

if not data_saved:
db = get_links(cation, anion)
#better to save links
db.to_csv(path+cation+anion+'_links'+'.csv')
db.to_csv(path+cation+anion+'_links'+'.csv', index=False)
#uncomment if saved and comment upper one
# db = pd.read_csv(path+cation+anion+'_links'+'.csv')
db = pd.read_csv(path+cation+anion+'_links'+'.csv')
#assign oxidation states based on the number of anions
db['oxidation_state'] = db.apply(lambda row: oxidation_state(row, cation, anion), axis=1)
#finds all digits in 'aurl' and takes only last one
Expand All @@ -28,7 +28,7 @@
#drop records without Bader charge
db = db.dropna(subset=['cation_charges'])
#save data
db.to_csv(path+cation+anion+'.csv')
db.to_csv(path+cation+anion+'.csv', index=False)

else:
db = pd.read_csv(path+cation+anion+'.csv')
Expand All @@ -38,7 +38,6 @@
#converting database of compounds to database of atoms and drop columns
db_for_each = to_db_with_bader_for_each_atom(db, atom_type='cation')

#plot
#plot
plot_os_vs_bader(db_for_each, cation, anion)


0 comments on commit 2ff2bfc

Please sign in to comment.