From ef5a9d751caddd0a5318721ea8960be5dfdc8925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jan=C3=9Fen?= Date: Sun, 25 Jan 2026 00:13:55 +0100 Subject: [PATCH 1/2] Fix rotation matrix is None --- src/pyiron_lammps/compatibility/calculate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyiron_lammps/compatibility/calculate.py b/src/pyiron_lammps/compatibility/calculate.py index d9853c0..a38876e 100644 --- a/src/pyiron_lammps/compatibility/calculate.py +++ b/src/pyiron_lammps/compatibility/calculate.py @@ -403,7 +403,7 @@ def _pressure_to_lammps(pressure, rotation_matrix, units="metal"): # If necessary, rotate the pressure tensor to the Lammps coordinate frame. # Isotropic, hydrostatic pressures are rotation invariant. - if not np.isclose( + if rotation_matrix is not None and not np.isclose( np.matrix.trace(rotation_matrix), 3 ) and not _is_isotropic_hydrostatic(pressure): if any(p is None for p in pressure): From 43263f7b42bfc2ef7f7181136d2b1569a349dcbf Mon Sep 17 00:00:00 2001 From: pyiron-runner Date: Sat, 24 Jan 2026 23:15:13 +0000 Subject: [PATCH 2/2] Format black --- src/pyiron_lammps/compatibility/calculate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pyiron_lammps/compatibility/calculate.py b/src/pyiron_lammps/compatibility/calculate.py index a38876e..c77d562 100644 --- a/src/pyiron_lammps/compatibility/calculate.py +++ b/src/pyiron_lammps/compatibility/calculate.py @@ -403,9 +403,11 @@ def _pressure_to_lammps(pressure, rotation_matrix, units="metal"): # If necessary, rotate the pressure tensor to the Lammps coordinate frame. # Isotropic, hydrostatic pressures are rotation invariant. - if rotation_matrix is not None and not np.isclose( - np.matrix.trace(rotation_matrix), 3 - ) and not _is_isotropic_hydrostatic(pressure): + if ( + rotation_matrix is not None + and not np.isclose(np.matrix.trace(rotation_matrix), 3) + and not _is_isotropic_hydrostatic(pressure) + ): if any(p is None for p in pressure): raise ValueError( "Cells which are not orthorhombic or an upper-triangular cell are incompatible with Lammps "