Skip to content

Commit

Permalink
Merge pull request #84 from jacanchaplais/patch/scalar-83
Browse files Browse the repository at this point in the history
patch: MomentumArray works for single entries #83
  • Loading branch information
jacanchaplais authored Feb 6, 2023
2 parents 70d9f33 + 97458da commit dafb1c9
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 dafb1c9

Please sign in to comment.