Skip to content

Commit

Permalink
🔥 Remove original_id in xarray_extensiosn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arafune committed Feb 1, 2024
1 parent a946977 commit 19a08d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 3 additions & 11 deletions arpes/xarray_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 []

Expand Down Expand Up @@ -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].
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 19a08d9

Please sign in to comment.