From 14a80501ebefe0daa19aa6c2cfee2cfe79979bac Mon Sep 17 00:00:00 2001 From: Ryuichi Arafune Date: Thu, 14 Mar 2024 19:12:57 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=20pyarpes=20should=20work=20on?= =?UTF-8?q?=20IPython?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/arpes/constants.py | 6 +++--- src/arpes/plotting/false_color.py | 2 +- src/arpes/utilities/jupyter.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/arpes/constants.py b/src/arpes/constants.py index a043c06e..e37097fd 100644 --- a/src/arpes/constants.py +++ b/src/arpes/constants.py @@ -7,7 +7,7 @@ """ from __future__ import annotations - +import numpy as np from typing import TYPE_CHECKING from numpy import pi @@ -54,7 +54,7 @@ SPECTROMETER_MC: Spectrometer = { "name": "MC", - "rad_per_pixel": (1 / 10) * (pi / 180), + "rad_per_pixel": np.deg2rad(1 / 10), "type": "hemisphere", "is_slit_vertical": False, } @@ -62,7 +62,7 @@ SPECTROMETER_MC_OLD: Spectrometer = { "name": "MC_OLD", "type": "hemisphere", - "rad_per_pixel": 0.125 * (pi / 180), + "rad_per_pixel": np.deg2rad(0.125), "is_slit_vertical": False, } diff --git a/src/arpes/plotting/false_color.py b/src/arpes/plotting/false_color.py index 5b600b99..2f9d171c 100644 --- a/src/arpes/plotting/false_color.py +++ b/src/arpes/plotting/false_color.py @@ -23,7 +23,7 @@ @save_plot_provenance -def false_color_plot( +def false_color_plot( # noqa: PLR0913 data_rgb: tuple[xr.Dataset, xr.Dataset, xr.Dataset], ax: Axes | None = None, out: str | Path = "", diff --git a/src/arpes/utilities/jupyter.py b/src/arpes/utilities/jupyter.py index 6a9fb59a..fee9bca5 100644 --- a/src/arpes/utilities/jupyter.py +++ b/src/arpes/utilities/jupyter.py @@ -13,6 +13,7 @@ from typing import TYPE_CHECKING, TypedDict from tqdm.notebook import tqdm +from traitlets.config import MultipleInstanceError if TYPE_CHECKING: from collections.abc import Iterable @@ -98,7 +99,7 @@ def get_full_notebook_information() -> NoteBookInfomation | None: return None try: connection_file = Path(ipykernel.get_connection_file()).stem - except RuntimeError: + except MultipleInstanceError: return None logger.debug(f"connection_file: {connection_file}")