Skip to content

Commit

Permalink
attr test
Browse files Browse the repository at this point in the history
  • Loading branch information
TL231 committed Dec 6, 2024
1 parent e8e61e8 commit 6097718
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qibochem/driver/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def __attrs_post_init__(self):
Args:
xyz_file: .xyz file for molecule. Comment line should follow "{charge} {multiplicity}"
"""
assert Path(f"{xyz_file}").exists(), f"{xyz_file} not found!"
if xyz_file is not None:
assert Path(f"{xyz_file}").exists(), f"{xyz_file} not found!"
with open(xyz_file, encoding="utf-8") as file_handler:
# First two lines: # atoms and comment line (charge, multiplicity)
_n_atoms = int(file_handler.readline()) # Not needed/used
Expand All @@ -92,7 +92,7 @@ def __attrs_post_init__(self):
_charge, _multiplicity = split_line
else:
# Otherwise, use the default (from __init__) values of 0 and 1
_charge, _multiplicity = charge, multiplicity
_charge, _multiplicity = self.charge, self.multiplicity

# Start reading xyz coordinates from the 3rd line onwards
_geometry = []
Expand Down

0 comments on commit 6097718

Please sign in to comment.