Skip to content

Commit 7e0f486

Browse files
committed
Check RApertures and EApertures for element compatibility
1 parent 29ab902 commit 7e0f486

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pyat/at/lattice/elements.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from collections.abc import Generator, Iterable
1515
from typing import Any, Optional
1616

17-
import numpy as np
18-
1917

2018
def _array(value, shape=(-1,), dtype=numpy.float64):
2119
# Ensure proper ordering(F) and alignment(A) for "C" access in integrators
@@ -459,12 +457,12 @@ def is_compatible(self, other) -> bool:
459457
def compatible_field(fieldname):
460458
f1 = getattr(self, fieldname, None)
461459
f2 = getattr(other, fieldname, None)
462-
if f1 is None and f2 is None: # no such field
460+
if f1 is None and f2 is None: # no such field
463461
return True
464462
elif f1 is None or f2 is None: # only one
465463
return False
466-
else: # both
467-
return np.all(f1 == f2)
464+
else: # both
465+
return numpy.all(f1 == f2)
468466

469467
if not (type(other) is type(self) and self.PassMethod == other.PassMethod):
470468
return False

0 commit comments

Comments
 (0)