From b354281bcb53e0dccf755ec5910971941b951799 Mon Sep 17 00:00:00 2001 From: Ryuichi Arafune Date: Mon, 6 Nov 2023 17:22:03 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=84=20=20attrs["grating"]=20=3D=20"HEG?= =?UTF-8?q?"=20is=20set=20in=20merlin.py=20not=20xarray=5Fextensions.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arpes/endstations/plugin/merlin.py | 1 + arpes/xarray_extensions.py | 7 ++----- pyproject.toml | 6 ++++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arpes/endstations/plugin/merlin.py b/arpes/endstations/plugin/merlin.py index fd01107a..2531f3bc 100644 --- a/arpes/endstations/plugin/merlin.py +++ b/arpes/endstations/plugin/merlin.py @@ -308,6 +308,7 @@ def postprocess_final( if angle_attr in dat.attrs: dat.attrs[angle_attr] = np.deg2rad(float(dat.attrs[angle_attr])) + data.attrs["grating"] = "HEG" data.attrs["alpha"] = np.pi / 2 data.attrs["psi"] = 0 for s in data.S.spectra: diff --git a/arpes/xarray_extensions.py b/arpes/xarray_extensions.py index d6cd2e92..6537dd2d 100644 --- a/arpes/xarray_extensions.py +++ b/arpes/xarray_extensions.py @@ -324,7 +324,7 @@ def logical_offsets(self) -> MappableDict: ) @property - def hv(self) -> float | None: + def hv(self) -> float: assert isinstance(self._obj, xr.DataArray | xr.Dataset) if "hv" in self._obj.coords: value = float(self._obj.coords["hv"]) @@ -336,7 +336,7 @@ def hv(self) -> float | None: return value if "location" in self._obj.attrs and self._obj.attrs["location"] == "ALG-MC": return 5.93 - return None + return np.nan def fetch_ref_attrs(self) -> dict[str, Any]: """Get reference attrs.""" @@ -1354,9 +1354,6 @@ def beamline_settings(self) -> dict[str, Any]: settings[key] = self._obj.attrs[option] break - if self.endstation == "BL403": - settings["grating"] = "HEG" # for now assume we always use the first order light - return settings @property diff --git a/pyproject.toml b/pyproject.toml index 38467220..7c0df9dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -122,3 +122,9 @@ line-length = 100 name = "cz_emoji" version = "0.0.1" tag_format = "$version" + + +[tool.coverage.report] +exclude_also = [ + "if TYPE_CHECKING:" +]