Skip to content

Commit

Permalink
Added 'is not None' to if conditions (#626)
Browse files Browse the repository at this point in the history
In the original issue, when a `self.variable =0`, then the `if
self.variable:` was not met in the`as_dict()` function found in the
script:
https://github.com/ReactionMechanismGenerator/ARC/blob/ba4f5b9aa8cb1b3ab8d6135e0d1e25ee10f5cc76/arc/job/adapter.py#L824
  • Loading branch information
alongd committed Apr 2, 2023
2 parents be28706 + df49754 commit 6c7513e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arc/job/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def as_dict(self) -> dict:
if self.dihedrals is not None:
job_dict['dihedrals'] = self.dihedrals
job_dict['ess_settings'] = self.ess_settings
if self.ess_trsh_methods:
if isinstance(self.ess_trsh_methods, list) and self.ess_trsh_methods:
job_dict['ess_trsh_methods'] = self.ess_trsh_methods
job_dict['execution_type'] = self.execution_type
if self.fine:
Expand All @@ -815,15 +815,15 @@ def as_dict(self) -> dict:
job_dict['rotor_index'] = self.rotor_index
if self.server is not None:
job_dict['server'] = self.server
if self.server_nodes:
if isinstance(self.server_nodes, dict) and self.server_nodes:
job_dict['server_nodes'] = self.server_nodes
if self.species is not None:
job_dict['species_labels'] = [species.label for species in self.species]
if self.torsions:
if self.torsions is not None:
job_dict['torsions'] = self.torsions
if self.tsg:
if self.tsg is not None:
job_dict['tsg'] = self.tsg
if self.xyz:
if self.xyz is not None:
job_dict['xyz'] = xyz_to_str(self.xyz)
return job_dict

Expand Down

0 comments on commit 6c7513e

Please sign in to comment.