Skip to content

Commit

Permalink
Added 'is not None' to if conditions
Browse files Browse the repository at this point in the history
Adjusted some if conditions to check for isinstance(variable, type)
  • Loading branch information
calvinp0 committed Mar 31, 2023
1 parent be28706 commit df49754
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 df49754

Please sign in to comment.