Skip to content

Commit

Permalink
Conform to new initialization of Species.final_xyz
Browse files Browse the repository at this point in the history
it is now None instead of ''
  • Loading branch information
alongd committed Apr 9, 2019
1 parent 8152037 commit 4bed0e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arc/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def check_xyz_species_for_drawing(xyz, species):
xyz = xyz if xyz is not None else species.final_xyz
if species is not None and not isinstance(species, ARCSpecies):
raise InputError('Species must be an ARCSpecies instance. Got {0}.'.format(type(species)))
if species is not None and not species.final_xyz:
if species is not None and species.final_xyz is None:
raise InputError('Species {0} has an empty final_xyz attribute.'.format(species.label))
return xyz

Expand Down
7 changes: 4 additions & 3 deletions arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def __init__(self, project, ess_settings, species_list, composite_method, confor
self.run_composite_job(species.label)
else:
self.run_sp_job(label=species.label)
elif self.species_dict[species.label].initial_xyz or self.species_dict[species.label].final_xyz:
elif self.species_dict[species.label].initial_xyz is not None\
or self.species_dict[species.label].final_xyz is not None:
# For restarting purposes: check before running jobs whether they were already terminated
# (check self.output) or whether they are "currently running" (check self.job_dict)
# This section takes care of restarting a Species (including a TS), but does not
Expand Down Expand Up @@ -331,7 +332,7 @@ def schedule_jobs(self):
The main job scheduling block
"""
for species in self.species_dict.values():
if not species.initial_xyz and not species.final_xyz and species.conformers\
if species.initial_xyz is None and species.final_xyz is None and species.conformers\
and any([e is not None for e in species.conformer_energies]):
# the species has no xyz, but has conformers and at least one of the conformers has energy
self.determine_most_stable_conformer(species.label)
Expand Down Expand Up @@ -636,7 +637,7 @@ def run_composite_job(self, label):
if 'composite' not in self.job_dict[label]: # Check whether or not composite jobs have been spawned yet
# we're spawning the first composite job for this species
self.job_dict[label]['composite'] = dict()
if self.species_dict[label].final_xyz != '':
if self.species_dict[label].final_xyz is not None:
xyz = self.species_dict[label].final_xyz
else:
xyz = self.species_dict[label].initial_xyz
Expand Down

0 comments on commit 4bed0e4

Please sign in to comment.