Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDoyle2 committed Feb 14, 2024
1 parent c3135fd commit 6c8b471
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pyNastran/dev/bdf_vectorized3/cards/elements/mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,16 @@ def centroid(self) -> np.ndarray:
nid = self.model.grid.node_id
xyz = self.model.grid.xyz_cid0()
inode = np.searchsorted(nid, self.node_id)
assert np.array_equal(nid[inode], self.node_id)
try:
assert np.array_equal(nid[inode], self.node_id)
except IndexError: # pragma: no cover
msg = (
'Invalid index in nid[inode]:\n'
f'nid={nid} '
f'self.node_id={self.node_id} '
f'inode={inode}'
)
raise IndexError(msg)
centroid = xyz[inode, :] + self.xyz_offset

# handle cid=-1
Expand Down

0 comments on commit 6c8b471

Please sign in to comment.