From 7ac92b1e8237645d112c5bcc90a3bb0fcf29ff1e Mon Sep 17 00:00:00 2001 From: Ryuichi Arafune Date: Thu, 1 Feb 2024 14:00:20 +0900 Subject: [PATCH] =?UTF-8?q?=E2=8F=AA=20Revert=20lmfit.plot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 💬 Update type hints --- arpes/fits/lmfit_plot.py | 3 ++- arpes/fits/utilities.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arpes/fits/lmfit_plot.py b/arpes/fits/lmfit_plot.py index 99aec2f2..f94ad28b 100644 --- a/arpes/fits/lmfit_plot.py +++ b/arpes/fits/lmfit_plot.py @@ -12,7 +12,6 @@ import xarray as xr from lmfit import model -from arpes.plotting.utils import transform_labels if TYPE_CHECKING: import numpy as np @@ -76,6 +75,8 @@ def patched_plot( Returns: The axes we plotted onto. """ + from arpes.plotting.utils import transform_labels + try: if self.model.n_dims != 1: from arpes.plotting.utils import fancy_labels diff --git a/arpes/fits/utilities.py b/arpes/fits/utilities.py index 9d9e6044..30be9e92 100644 --- a/arpes/fits/utilities.py +++ b/arpes/fits/utilities.py @@ -15,7 +15,7 @@ import os from logging import DEBUG, INFO, Formatter, StreamHandler, getLogger -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Literal import dill import numpy as np @@ -53,8 +53,8 @@ def result_to_hints( model_result: lmfit.model.ModelResult | None, - defaults=None, -) -> dict[str, dict[str, Any]] | None: + defaults: dict[str, dict[Literal["value"], float]] | None = None, +) -> dict[str, dict[Literal["value"], float]] | None: """Turns an `lmfit.model.ModelResult` into a dictionary with initial guesses. Args: