Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make setup python scripts 2/3 compatible #1261

Merged
merged 1 commit into from
Dec 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/performance/adjust_qmcpack_input.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from __future__ import print_function

# Rewrite parts of a QMCPACK input file
# walkers
Expand Down Expand Up @@ -34,23 +35,23 @@ def change_number_of_walkers(tree, new_number_of_walkers):
def use_NLPP_algorithm(tree):
nodes = tree.findall(".//hamiltonian/pairpot[@type='pseudo']")
if len(nodes) == 0:
print 'NLPP not found'
print('NLPP not found')
return
for node in nodes:
add_or_change_attribute(node, 'algorithm', 'batched')

def use_delayed_update(tree, delay):
nodes = tree.findall(".//wavefunction/determinantset/slaterdeterminant")
if len(nodes) == 0:
print 'slaterdeterminant not found'
print('slaterdeterminant not found')
return
for node in nodes:
add_or_change_attribute(node, 'delay_rank', str(delay))

def change_jastrow(tree, j3_tree):
wf_nodes = tree.findall('.//wavefunction')
if len(wf_nodes) != 1:
print 'No wavefunction nodes found, or more than one'
print('No wavefunction nodes found, or more than one')
return
wf_node = wf_nodes[0]
jastrow_nodes = wf_node.findall("./jastrow")
Expand Down Expand Up @@ -104,5 +105,5 @@ def change_jastrow(tree, j3_tree):
if args.inplace:
tree.write(fname_in)
else:
print "Nothing has been changed. Use -i or -o options for in-place change or output to a file."
print("Nothing has been changed. Use -i or -o options for in-place change or output to a file.")

4 changes: 2 additions & 2 deletions tests/scripts/test_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,12 @@ def check_positive_label_sets(positive_label_sets):
# get labels from known sets
try:
labels = []
for label,label_set in positive_label_sets.iteritems():
for label,label_set in positive_label_sets.items():
if test in label_set or full_test in label_set:
labels.append(label)
#end if
#end for
for label,label_set in negative_label_sets.iteritems():
for label,label_set in negative_label_sets.items():
if test not in label_set and full_test not in label_set:
labels.append(label)
#end if
Expand Down