From 6097718da0d609e06ef28d96a41bbd6d510e47c3 Mon Sep 17 00:00:00 2001 From: Tan Le Date: Fri, 6 Dec 2024 09:03:55 +0800 Subject: [PATCH] attr test --- src/qibochem/driver/molecule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qibochem/driver/molecule.py b/src/qibochem/driver/molecule.py index 8f5b76c..db2970d 100644 --- a/src/qibochem/driver/molecule.py +++ b/src/qibochem/driver/molecule.py @@ -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 @@ -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 = []