Skip to content

Commit

Permalink
Add charge parsing for ORCA
Browse files Browse the repository at this point in the history
  • Loading branch information
smcolby committed Dec 27, 2024
1 parent 8fc23b3 commit c84a825
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion isicle/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,26 @@ def _parse_molden(self):
return None

def _parse_charge(self):
return None
text = self._find_output_by_header("MULLIKEN ATOMIC CHARGES")

# Mulliken charges not found
if len(text) == 0:
return None

# Get last relevant output
text = text[-1].split("\n")

# Parse table
body = [x.split() for x in text[:-1]]

# Construct data frame
df = pd.DataFrame(body, columns=["idx", "Atom", "_", "Charge"])

# Map correct types
for col, dtype in zip(df.columns, (int, str, str, float)):
df[col] = df[col].astype(dtype)

return df['Charge'].values

def _parse_connectivity(self):
return None
Expand Down

0 comments on commit c84a825

Please sign in to comment.