Skip to content

Commit

Permalink
Updated mypy configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinbad-The-Sailor committed Feb 4, 2024
1 parent 39a8be0 commit 87c85e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[mypy]
warn_unused_configs = True
files = src/models
files = src
ignore_missing_imports = True
check_untyped_defs = True
explicit_package_bases = True
warn_unreachable = True
warn_redundant_casts = True
warn_unused_ignores = True
follow_imports_for_stubs = False
disable_error_code=assignment, has-type, union-attr, arg-type, attr-defined
disable_error_code=assignment, has-type, union-attr, arg-type, attr-defined, return
plugins = numpy.typing.mypy_plugin
8 changes: 4 additions & 4 deletions src/abacus/models/garch.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, data: torch.Tensor):
super().__init__(data)

@property
def parameters(self) -> tuple[float, 3]:
def parameters(self) -> tuple[float, ...]:
self._check_calibration()

optimal_parameters = self._optimal_parameters
Expand All @@ -31,11 +31,11 @@ def _number_of_parameters(self) -> int:
return len(self.parameters)

@property
def _optimal_parameters(self) -> np.array:
def _optimal_parameters(self) -> np.ndarray:
return self._uncondition_parameters(parameters=torch.tensor(self._solution.x)).numpy()

@property
def _inital_solution(self) -> np.array:
def _inital_solution(self) -> np.ndarray:
return np.array(self._precondition_parameters(parameters=torch.tensor(INITIAL_GARCH_PARAMETERS)))

@property
Expand Down Expand Up @@ -83,7 +83,7 @@ def transform_to_uniform(self):

return Normal(0, 1).cdf(residuals)

def _cost_function(self, parameters: np.array) -> tuple[float, 2]:
def _cost_function(self, parameters: np.array) -> tuple[float, ...]:
"""
Defines the conditional log loss for the GARCH model. Calculates the loss recursively.
Expand Down

0 comments on commit 87c85e4

Please sign in to comment.