mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
[Fix] Fix ruff errors and a few type annotations
This commit is contained in:
parent
8d86295ac5
commit
2d34b355ed
5 changed files with 16 additions and 6 deletions
|
@ -7,7 +7,7 @@ import matplotlib.pyplot as plt
|
|||
import scipy.linalg
|
||||
from .obs import Obs, reweight, correlate, CObs
|
||||
from .misc import dump_object, _assert_equal_properties
|
||||
from .fits import least_squares
|
||||
from .fits import least_squares, Fit_result
|
||||
from .roots import find_root
|
||||
from . import linalg
|
||||
from numpy import float64, int64, ndarray, ufunc
|
||||
|
|
|
@ -6,11 +6,13 @@ import matplotlib
|
|||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
import pickle
|
||||
from .obs import Obs
|
||||
from .obs import Obs, CObs
|
||||
from .version import __version__
|
||||
from numpy import float64, int64, ndarray
|
||||
from typing import List, Type, Union
|
||||
from typing import List, Type, Union, TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .correlators import Corr
|
||||
|
||||
def print_config():
|
||||
"""Print information about version of python, pyerrors and dependencies."""
|
||||
|
|
|
@ -3,7 +3,6 @@ import numpy as np
|
|||
import scipy.linalg
|
||||
from .obs import Obs
|
||||
from .linalg import svd, eig
|
||||
from pyerrors.obs import Obs
|
||||
from typing import List
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import annotations
|
||||
import sys
|
||||
import warnings
|
||||
import hashlib
|
||||
import pickle
|
||||
|
@ -12,7 +13,15 @@ import numdifftools as nd
|
|||
from itertools import groupby
|
||||
from .covobs import Covobs
|
||||
from numpy import bool, float64, int64, ndarray
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Union, TYPE_CHECKING
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
from types import NotImplementedType
|
||||
else:
|
||||
NotImplementedType = type(NotImplemented)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .correlators import Corr
|
||||
|
||||
# Improve print output of numpy.ndarrays containing Obs objects.
|
||||
np.set_printoptions(formatter={'object': lambda x: str(x)})
|
||||
|
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
import numpy as np
|
||||
import scipy.optimize
|
||||
from autograd import jacobian
|
||||
from .obs import derived_observable
|
||||
from .obs import Obs, derived_observable
|
||||
from typing import Callable, List, Union
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue