diff --git a/chgnet/model/dynamics.py b/chgnet/model/dynamics.py index c1a8601f..92b7d605 100644 --- a/chgnet/model/dynamics.py +++ b/chgnet/model/dynamics.py @@ -499,7 +499,7 @@ def __init__( """ self.ensemble = ensemble self.thermostat = thermostat - if isinstance(atoms, (Structure, Molecule)): + if isinstance(atoms, Structure | Molecule): atoms = AseAtomsAdaptor().get_atoms(atoms) # atoms = atoms.to_ase_atoms() diff --git a/chgnet/model/model.py b/chgnet/model/model.py index d98a2144..d42c61c9 100644 --- a/chgnet/model/model.py +++ b/chgnet/model/model.py @@ -622,7 +622,7 @@ def predict_graph( m (Tensor) : magnetic moments of sites [num_atoms, 3] in Bohr magneton mu_B """ - if not isinstance(graph, (CrystalGraph, Sequence)): + if not isinstance(graph, CrystalGraph | Sequence): raise TypeError( f"{type(graph)=} must be CrystalGraph or list of CrystalGraphs" ) diff --git a/pyproject.toml b/pyproject.toml index 83ad6d5d..a8b66136 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ build-backend = "setuptools.build_meta" [tool.ruff] target-version = "py310" +output-format = "concise" [tool.ruff.lint] select = ["ALL"]