From 4accd99ac3e257feac2e4c00fa11d5d25234c86c Mon Sep 17 00:00:00 2001 From: Simon Thomas Date: Mon, 23 Sep 2024 14:38:09 +0100 Subject: [PATCH] update to fix two unit test regressions --- sithom/curve.py | 3 ++- sithom/plot.py | 4 +++- sithom/time.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sithom/curve.py b/sithom/curve.py index 5c66f2b..5a78feb 100644 --- a/sithom/curve.py +++ b/sithom/curve.py @@ -1,4 +1,5 @@ """Polynomial curve fitting.""" + from typing import Callable, Tuple, Sequence, Union, Optional, Literal import numpy as np from uncertainties import unumpy as unp, ufloat @@ -108,7 +109,7 @@ def _label(param: Sequence[ufloat]) -> str: param (Sequence[ufloat]): Polynomial fit to print out. Returns: - str: Output of polynomial (e.g 'y = ($2\pm1$) x + 1\pm 2' ) + str: Output of polynomial (e.g 'y = ($2\\\\pm1$) x + 1\\\\pm 2' ) Examples: >>> from sithom.curve import _label diff --git a/sithom/plot.py b/sithom/plot.py index f637728..2818db6 100644 --- a/sithom/plot.py +++ b/sithom/plot.py @@ -463,7 +463,7 @@ def lim( if balance: vmin, vmax = _balance(vmin, vmax) - return (vmin, vmax) + return (float(vmin), float(vmax)) def pairplot(df: pd.DataFrame) -> None: @@ -472,6 +472,8 @@ def pairplot(df: pd.DataFrame) -> None: https://stackoverflow.com/a/50835066 + TODO: Add option for subplot labels (a), (b), (c) etc. + Args: df (pd.DataFrame): A data frame. """ diff --git a/sithom/time.py b/sithom/time.py index ae1bfe4..1634a13 100644 --- a/sithom/time.py +++ b/sithom/time.py @@ -1,4 +1,5 @@ """Time Utilities Module.""" + from typing import Callable import time from functools import wraps