Skip to content

Commit

Permalink
removed path requirement to program.py, periodic_table.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
tilaskabengele committed Jun 2, 2023
1 parent e81122b commit 7283232
Show file tree
Hide file tree
Showing 5 changed files with 643 additions and 596 deletions.
Binary file added bicrystal/.bicrystal.swp
Binary file not shown.
Binary file added bicrystal/.program.py.swp
Binary file not shown.
8 changes: 3 additions & 5 deletions bicrystal/bicrystal
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

rm -f number_of_atoms unitcell body outfile heading heading_nat atoms sorted_atoms k_points

t1=$(whereis program.py | awk '{print $2}')
t2=$(whereis program.py | awk '{print $2}' | sed -r 's/.{10}$//')
echo $t2 > workspace
python $t1 2>&1 | tee outfile
rm -f workspace
# execute python script for bicrystal
python program.py 2>&1 | tee outfile

# postprocess the results and prepare output file
echo "Would you like to write Espresso file?[Y/n]"

read reply
Expand Down
12 changes: 2 additions & 10 deletions bicrystal/program.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/python3

# PROGRAM: BiCRYSTAL

# VERSION: 1.0.8
Expand All @@ -8,11 +6,6 @@

# AUTHOR: T. Kabengele, Johnson Chemistry Group, Dalhousie University

# REQUIREMENTS:
# Python "crystals" package must be installed on your system
# Install via: pip install crystals
# Alternative install: conda install -c conda-forge crystals

#********************************************************************************************************

# INITIALIZATION
Expand Down Expand Up @@ -336,12 +329,11 @@ def bulk(my_crystal):

# reading csv with elements from workspace
# i.e. directory where you installed bicrystal
with open('workspace') as f:
with open('program.py') as f:
line = f.readline()
program_directory = str(line).rstrip("\n")
dir1 = os.path.join("" +program_directory+"", 'periodic_table.csv')
colnames = ['number', 'symbol']
periodic_table = pandas.read_csv(dir1, usecols=colnames)
periodic_table = pandas.read_csv('periodic_table.csv', usecols=colnames)
number = periodic_table.number.tolist()
symbol = periodic_table.symbol.tolist()

Expand Down
Loading

0 comments on commit 7283232

Please sign in to comment.