From 24eaed611f8f3a80d5bd721b6fa1ff7f94ff24dc Mon Sep 17 00:00:00 2001 From: rettigl Date: Thu, 22 Feb 2024 23:23:53 +0100 Subject: [PATCH] fix formatting --- pynxtools_mpes/reader.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pynxtools_mpes/reader.py b/pynxtools_mpes/reader.py index 1570b58..c98825a 100644 --- a/pynxtools_mpes/reader.py +++ b/pynxtools_mpes/reader.py @@ -49,6 +49,7 @@ "ky": "1/A", } + def recursive_parse_metadata( node: Union[h5py.Group, h5py.Dataset], ) -> dict: @@ -134,12 +135,16 @@ def h5_to_xarray(faddr: str, mode: str = "r") -> xr.DataArray: for axis in range(len(bin_axes)): try: - xarray[bin_names[axis]].attrs["unit"] = h5_file["axes"][f"ax{axis}"].attrs["unit"] + xarray[bin_names[axis]].attrs["unit"] = h5_file["axes"][ + f"ax{axis}" + ].attrs["unit"] except (KeyError, TypeError): - xarray[bin_names[axis]].attrs["unit"] = DEFAULT_UNITS[bin_names[axis]] + xarray[bin_names[axis]].attrs["unit"] = DEFAULT_UNITS[bin_names[axis]] try: xarray.attrs["units"] = h5_file["binned"]["BinnedData"].attrs["units"] - xarray.attrs["long_name"] = h5_file["binned"]["BinnedData"].attrs["long_name"] + xarray.attrs["long_name"] = h5_file["binned"]["BinnedData"].attrs[ + "long_name" + ] except (KeyError, TypeError): xarray.attrs["units"] = "counts" xarray.attrs["long_name"] = "photoelectron counts"