Skip to content

Commit

Permalink
fixed shape classic errors
Browse files Browse the repository at this point in the history
updated version
  • Loading branch information
efrembernuz committed Oct 25, 2020
1 parent 734cba9 commit c6403e6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
14 changes: 7 additions & 7 deletions cosymlib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.8.7'
__version__ = '0.8.8'

from cosymlib.molecule import Molecule, Geometry
from cosymlib import file_io
Expand Down Expand Up @@ -582,12 +582,12 @@ def get_path_parameters(self, shape_label1, shape_label2, central_atom=0):

def print_minimum_distortion_path_shape(self, shape_label1, shape_label2, central_atom=0,
min_dev=0, max_dev=15, min_gco=0, max_gco=101,
num_points=20, output_name=None):
num_points=20, output=None):

if output_name is not None:
output = open(output_name + '_pth.csv', 'w')
output2 = open(output_name + '_pth.xyz', 'w')
output3 = open(output_name, 'w')
if output is not None:
output = open(output + '_pth.csv', 'w')
output2 = open(output + '_pth.xyz', 'w')
output3 = open(output, 'w')
else:
output = sys.stdout
output2 = sys.stdout
Expand Down Expand Up @@ -643,7 +643,7 @@ def print_minimum_distortion_path_shape(self, shape_label1, shape_label2, centra
positions=structure, name='map_structure{}'.format(ids)))
output2.write(file_io.get_file_xyz_txt(test_structures))

if output_name is None:
if output is None:
import matplotlib.pyplot as plt
plt.plot(path[0], path[1], 'k', linewidth=2.0)
plt.scatter(np.array(csm[label1_name])[filter_mask],
Expand Down
9 changes: 8 additions & 1 deletion scripts/shape_classic
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,25 @@ if args.input_file is not None:
reference_polyhedron.append(tools.get_shape_label(int(number), options['%n_atoms']))

if options['%fullout']:
output_name = open(output_name + '.tab', 'w')
symobj.print_shape_measure(reference_polyhedron,
central_atom=central_atom,
output=output_name)
symobj.print_shape_structure(reference_polyhedron,
central_atom=central_atom,
output=output_name)

elif options['%path']:
output_name = open(output_name + '.tab', 'w')
if len(reference_polyhedron) > 2:
print('Error. No more than two labels can be specified for a path calculation')
exit()
symobj.print_minimum_distortion_path_shape(reference_polyhedron[0],
reference_polyhedron[1],
central_atom=central_atom,
output_name=output_name)
output=output_name)
else:
output_name = open(output_name + '.tab', 'w')
symobj.print_shape_measure(reference_polyhedron,
central_atom=central_atom,
output=output_name)
Expand Down
2 changes: 1 addition & 1 deletion scripts/shape_map
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ if args.map:
min_gco=args.min_gco,
max_gco=args.max_gco,
num_points=args.n_points,
output_name=args.output_name)
output=args.output_name)

print_footer(common_output)

0 comments on commit c6403e6

Please sign in to comment.