From 9fba92b6557efc1cb848ac9b0d46f8dfca29b25f Mon Sep 17 00:00:00 2001 From: Ryuichi Arafune Date: Sun, 21 Apr 2024 12:10:20 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/arpes/xarray_extensions.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/arpes/xarray_extensions.py b/src/arpes/xarray_extensions.py index 2afb81db..2f79f09f 100644 --- a/src/arpes/xarray_extensions.py +++ b/src/arpes/xarray_extensions.py @@ -2031,7 +2031,7 @@ def cut_nan_coords(self: Self) -> xr.DataArray: def reference_plot( self, - **kwargs: Unpack[LabeledFermiSurfaceParam] | Unpack[PColorMeshKwargs], + **kwargs: Incomplete, ) -> Axes | Path | tuple[Figure, NDArray[np.object_]]: """Generates a reference plot for this piece of data according to its spectrum type. @@ -2910,13 +2910,14 @@ def first_exceeding( # noqa: PLR0913 data = data / data.max(dim) cond = data > value + cond_values = cond.values reindex = data.coords[dim] if reverse: reindex = np.flip(reindex) - cond = np.flip(cond, data.dims.index(dim)).values + cond_values = np.flip(cond_values, axis=data.dims.index(dim)) - indices = cond.argmax(axis=data.dims.index(dim)) + indices = cond_values.argmax(axis=data.dims.index(dim)) if as_index: new_values = indices if reverse: @@ -2927,7 +2928,7 @@ def first_exceeding( # noqa: PLR0913 with contextlib.suppress(AttributeError): new_values = new_values.values - return data.isel({dim: 0}).S.rith_values(new_values) + return data.isel({dim: 0}).S.with_values(new_values) def last_exceeding(self, dim: str, value: float, *, relative: bool = False) -> xr.DataArray: return self.first_exceeding(dim, value, relative=relative, reverse=False)