Skip to content

Commit 09d6217

Browse files
committed
MAINT: Restore typing completeness
Fix typing issues isort, black and flake8 compat
1 parent 8b19978 commit 09d6217

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

arch/univariate/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import pandas as pd
1212
from pandas import DataFrame, Series
1313
from pandas.util._decorators import deprecate_kwarg
14-
from arch.vendor import cached_property
1514
from scipy.optimize import OptimizeResult
1615
import scipy.stats as stats
1716
from statsmodels.iolib.summary import Summary, fmt_2cols, fmt_params
@@ -34,6 +33,7 @@
3433
starting_value_warning,
3534
)
3635
from arch.utility.testing import WaldTestStatistic
36+
from arch.vendor import cached_property
3737

3838
try:
3939
from matplotlib.figure import Figure

arch/univariate/mean.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import numpy as np
99
from pandas import DataFrame
10-
from arch.vendor import cached_property
1110
from scipy.optimize import OptimizeResult
1211
from statsmodels.tsa.tsatools import lagmat
1312

@@ -40,6 +39,7 @@
4039
ensure1d,
4140
parse_dataframe,
4241
)
42+
from arch.vendor import cached_property
4343

4444
__all__ = ["HARX", "ConstantMean", "ZeroMean", "ARX", "arch_model", "LS"]
4545

arch/utility/array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
import numpy as np
1111
from pandas import DataFrame, DatetimeIndex, Index, NaT, Series, Timestamp, to_datetime
12-
from arch.vendor import cached_property
1312

1413
from arch.typing import AnyPandas, ArrayLike, DateLike, NDArray
14+
from arch.vendor import cached_property
1515

1616
__all__ = [
1717
"ensure1d",

arch/utility/testing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from typing import Dict, Optional
22

3-
from arch.vendor import cached_property
43
from scipy.stats import chi2
54

5+
from arch.vendor import cached_property
6+
67
__all__ = ["WaldTestStatistic"]
78

89

arch/vendor/property_cached.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
import asyncio
3434
import functools
35-
import sys
3635
import threading
3736
from time import time
37+
from typing import Any, Mapping
3838
import weakref
3939

4040
__author__ = "Martin Larralde"
@@ -52,21 +52,12 @@ class cached_property(property):
5252

5353
_sentinel = object()
5454

55-
if sys.version_info[0] < 3:
56-
57-
def _update_wrapper(self, func):
58-
self.__doc__ = getattr(func, "__doc__", None)
59-
self.__module__ = getattr(func, "__module__", None)
60-
self.__name__ = getattr(func, "__name__", None)
61-
62-
else:
63-
64-
_update_wrapper = functools.update_wrapper
55+
_update_wrapper = functools.update_wrapper
6556

6657
def __init__(self, func) -> None:
67-
self.cache = weakref.WeakKeyDictionary()
58+
self.cache: Mapping[str, Any] = weakref.WeakKeyDictionary()
6859
self.func = func
69-
self._update_wrapper(func)
60+
self._update_wrapper(func) # type: ignore
7061

7162
def __get__(self, obj, cls):
7263
if obj is None:

0 commit comments

Comments
 (0)