Skip to content

Commit

Permalink
Remove raw input.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Sep 14, 2019
1 parent a94cb85 commit 0f173a1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dev_scripts/chemenv/explicit_permutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Algo(object):
# Choose the geometry
allcg = AllCoordinationGeometries()
while True:
cg_symbol = raw_input('Enter symbol of the geometry for which you want to get the explicit permutations : ')
cg_symbol = input('Enter symbol of the geometry for which you want to get the explicit permutations : ')
try:
cg = allcg[cg_symbol]
break
Expand Down Expand Up @@ -87,7 +87,7 @@ class Algo(object):
else:
raise ValueError('WRONG ALGORITHM !')

test = raw_input('Save it ? ("y" to confirm)')
test = input('Save it ? ("y" to confirm)')
if test == 'y':
if len(cg.algorithms) != 1:
raise ValueError('Multiple algorithms !')
Expand Down
6 changes: 3 additions & 3 deletions dev_scripts/chemenv/explicit_permutations_plane_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Choose the geometry
allcg = AllCoordinationGeometries()
while True:
cg_symbol = raw_input('Enter symbol of the geometry for which you want to get the explicit permutations : ')
cg_symbol = input('Enter symbol of the geometry for which you want to get the explicit permutations : ')
try:
cg = allcg[cg_symbol]
break
Expand Down Expand Up @@ -105,7 +105,7 @@
print(cgsm)
if cgsm[0] is None:
print('IS NONE !')
raw_input()
input()
continue

csms, perms, algos, sep_perms = cgsm[0], cgsm[1], cgsm[2], cgsm[3]
Expand All @@ -132,7 +132,7 @@
newalgos.append(sepplanealgo)

# Write update geometry file ?
test = raw_input('Save it ? ("y" to confirm)')
test = input('Save it ? ("y" to confirm)')
if test == 'y':
cg._algorithms = newalgos
cg_dict = cg.as_dict()
Expand Down
4 changes: 2 additions & 2 deletions dev_scripts/chemenv/get_plane_permutations_optimized.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def random_permutations_iterator(initial_permutation, npermutations):
'{:d} explicit permutations'.format(eop,
len(algo.explicit_permutations)))
if algo.other_plane_points is None:
raw_input('Multiplicity and other plane points is not defined for this algorithm !')
input('Multiplicity and other plane points is not defined for this algorithm !')

# Setup of safe permutations
permutations = algo.safe_separation_permutations(ordered_plane=algo.ordered_plane,
Expand Down Expand Up @@ -341,7 +341,7 @@ def random_permutations_iterator(initial_permutation, npermutations):
mincsm = min(csms)
if not mincsm < 1.0:
print('Following is not close enough to 0.0 ...')
raw_input(csms)
input(csms)
mincsm_indices = []
for icsm, csm in enumerate(csms):
if np.isclose(mincsm, csm, rtol=0.0):
Expand Down
6 changes: 3 additions & 3 deletions dev_scripts/chemenv/test_algos.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
allcg = AllCoordinationGeometries()

while True:
cg_symbol = raw_input('Enter symbol of the geometry for which you want to get the explicit permutations : ')
cg_symbol = input('Enter symbol of the geometry for which you want to get the explicit permutations : ')
try:
cg = allcg[cg_symbol]
break
Expand All @@ -45,7 +45,7 @@

myindices = range(cg.coordination_number)

test = raw_input('Enter if you want to test all possible permutations ("all" or "a") or a given number of random permutations (i.e. "25")')
test = input('Enter if you want to test all possible permutations ("all" or "a") or a given number of random permutations (i.e. "25")')

if test == 'all' or test == 'a':
perms_iterator = itertools.permutations(myindices)
Expand Down Expand Up @@ -87,7 +87,7 @@

if not np.isclose(min(results[0]), 0.0):
print('Following is not 0.0 ...')
raw_input(results)
input(results)
print(' => ', algos_results)
iperm += 1
t2 = time.clock()
Expand Down
6 changes: 3 additions & 3 deletions dev_scripts/chemenv/test_algos_all_geoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

allcg = AllCoordinationGeometries()

test = raw_input('Standard ("s", all permutations for cn <= 6, 500 random permutations for cn > 6) or on demand')
test = input('Standard ("s", all permutations for cn <= 6, 500 random permutations for cn > 6) or on demand')
if test == 's':
perms_def = 'standard'
elif test == 'o':
Expand All @@ -53,7 +53,7 @@
elif perms_def == 'ndefined':
test = nperms
else:
test = raw_input('Enter if you want to test all possible permutations ("all" or "a") or a given number of random permutations (i.e. "25")')
test = input('Enter if you want to test all possible permutations ("all" or "a") or a given number of random permutations (i.e. "25")')
myindices = range(coordination)

if test == 'all' or test == 'a':
Expand Down Expand Up @@ -119,6 +119,6 @@

if not min(results[0]) < 1.5:
print('Following is not close to 0.0 ...')
raw_input(results)
input(results)
print(' => ', algos_results)
iperm += 1

0 comments on commit 0f173a1

Please sign in to comment.