From 19a08d924910431060dbe64a3c44117221b6bf1d Mon Sep 17 00:00:00 2001 From: Ryuichi Arafune Date: Thu, 1 Feb 2024 17:44:34 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20=20Remove=20original=5Fid=20in?= =?UTF-8?q?=20xarray=5Fextensiosn.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Changes.md | 1 + arpes/xarray_extensions.py | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Changes.md b/Changes.md index 2603300f..a84c45f8 100644 --- a/Changes.md +++ b/Changes.md @@ -43,6 +43,7 @@ Major Changes from 3.0.1 - use stack_dispersion_plot with appropriate args - Remove G.extent in xarray_extensions, which is not so usuful - Remove scan_row property + - Remove original_id method, as I cannot figure out the purpose. Fix from 3.0.1 diff --git a/arpes/xarray_extensions.py b/arpes/xarray_extensions.py index 0f356501..adefe90c 100644 --- a/arpes/xarray_extensions.py +++ b/arpes/xarray_extensions.py @@ -745,7 +745,7 @@ def unlayer( if prov is None: return [], None # tuple[list[Incomplete] | None] if isinstance(prov, str): - return [prov], None # tuple[list[dict[str, Incomplete]], None] + return [prov], None first_layer: PROVENANCE = copy.copy(prov) rest = first_layer.pop("parents_provenance", None) @@ -759,7 +759,7 @@ def unlayer( return [first_layer], rest - def _unwrap_provenance(prov: PROVENANCE | None | str) -> list[PROVENANCE | None]: + def _unwrap_provenance(prov: PROVENANCE | None) -> list[PROVENANCE | None]: if prov is None: return [] @@ -799,14 +799,6 @@ def dshape(self) -> dict[str, int]: dim_names = (str(dim) for dim in arr.dims) return dict(zip(dim_names, arr.shape, strict=True)) - @property - def original_id(self) -> str: - history = self.history - if len(history) >= 3: # noqa: PLR2004 - first_modification = history[-3] - return first_modification["parent_id"] - return self._obj.attrs["id"] - @property def scan_name(self) -> str: """[TODO:summary]. @@ -2276,7 +2268,7 @@ def correct_angle_by( @xr.register_dataset_accessor("G") @xr.register_dataarray_accessor("G") class GenericAccessorTools: - _obj: DataType + _obj: xr.DataArray | xr.Dataset def round_coordinates( self,