|
1 | 1 | import warnings
|
2 | | -from typing import Dict, List, Optional, Sequence, Union |
| 2 | +from typing import Dict, List, Optional, Sequence, Union, cast |
3 | 3 | from numbers import Number
|
4 | 4 |
|
5 | 5 | import numpy as np
|
@@ -153,14 +153,14 @@ def df(self) -> pd.DataFrame:
|
153 | 153 | @property
|
154 | 154 | def pip(self) -> float:
|
155 | 155 | if self.__pip is None:
|
156 | | - self.__pip = 10**-np.median([len(s.partition('.')[-1]) |
157 | | - for s in self.__arrays['Close'].astype(str)]) |
| 156 | + self.__pip = float(10**-np.median([len(s.partition('.')[-1]) |
| 157 | + for s in self.__arrays['Close'].astype(str)])) |
158 | 158 | return self.__pip
|
159 | 159 |
|
160 | 160 | def __get_array(self, key) -> _Array:
|
161 | 161 | arr = self.__cache.get(key)
|
162 | 162 | if arr is None:
|
163 | | - arr = self.__cache[key] = self.__arrays[key][:self.__i] |
| 163 | + arr = self.__cache[key] = cast(_Array, self.__arrays[key][:self.__i]) |
164 | 164 | return arr
|
165 | 165 |
|
166 | 166 | @property
|
|
0 commit comments