Skip to content

Commit

Permalink
patch: MomentumArray works for single entries #83
Browse files Browse the repository at this point in the history
  • Loading branch information
jacanchaplais committed Feb 6, 2023
1 parent 70d9f33 commit 97458da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graphicle/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1054,14 +1054,14 @@ def copy(self) -> "MomentumArray":

@property
def _xy_pol(self) -> base.ComplexVector:
return self._data[:, :2].view(dtype="<c16").reshape(-1)
return self._data[..., :2].view(dtype="<c16").squeeze(-1)

@fn.cached_property
def _zt_pol(self) -> base.ComplexVector:
return (
np.stack((self.data["z"], np.abs(self._xy_pol)), axis=-1)
.view(dtype="<c16")
.reshape(-1)
.squeeze(-1)
)

@fn.cached_property
Expand Down

0 comments on commit 97458da

Please sign in to comment.