Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 12, 2024
1 parent 4224d6a commit 91c3dc6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions aiida_gaussian/calculations/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def prepare_for_submission(self, folder):
self.inputs.parameters.get_dict(), pmg_structure
)
# for NICS replace X0+ with Bq
if "nmr" in self.inputs.parameters.get_dict()['route_parameters']:
if "nmr" in self.inputs.parameters.get_dict()["route_parameters"]:
input_string = input_string.replace("X0+", "Bq")

with open(folder.get_abs_path(self.INPUT_FILE), "w") as out_file:
out_file.write(input_string)

Expand Down
13 changes: 7 additions & 6 deletions aiida_gaussian/parsers/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _parse_log(self, log_file_string, inputs):
return self.exit_codes.ERROR_OUTPUT_PARSING

property_dict.update(self._parse_electron_numbers(log_file_string))

# set output nodes
self.out("output_parameters", Dict(dict=property_dict))

Expand All @@ -78,7 +78,7 @@ def _parse_electron_numbers(self, log_file_string):
return {"num_electrons": [int(e) for e in find_el.groups()]}
else:
return {}

def _parse_log_cclib(self, log_file_string):

data = cclib.io.ccread(io.StringIO(log_file_string))
Expand Down Expand Up @@ -178,7 +178,7 @@ def _parse_log(self, log_file_string, inputs):
return self.exit_codes.ERROR_OUTPUT_PARSING
# parse nics
property_dict.update(self._parse_nics(log_file_string))

property_dict.update(self._parse_electron_numbers(log_file_string))

# Add spin expectations in property_dict
Expand All @@ -200,7 +200,8 @@ def _parse_log(self, log_file_string, inputs):
return exit_code

return None
def _parse_nics(self,log_file_string):

def _parse_nics(self, log_file_string):

sigma = []

Expand All @@ -222,8 +223,8 @@ def extract_values(line):
i_line += 1
if len(sigma) == 0:
return {}
return {'nics':np.array(sigma)}
return {"nics": np.array(sigma)}

def _parse_log_spin_exp(self, log_file_string):
"""Parse spin expectation values"""

Expand Down

0 comments on commit 91c3dc6

Please sign in to comment.