Skip to content

Commit

Permalink
Ignore type for strange mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-tfn committed Jan 9, 2024
1 parent febd9bb commit 267f60b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ max-statements = 100
packages = ["caf.distribute"]
ignore_missing_imports = true
allow_redefinition = true
allow_untyped_globals = true

[tool.pydocstyle]
convention = "numpy"
Expand Down
14 changes: 7 additions & 7 deletions src/caf/distribute/gravity_model/single_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def _gravity_function(
end_time = timing.current_milli_time()
self._log_iteration(
log_path=running_log_path,
attempt_id=self._attempt_id,
attempt_id=self._attempt_id, # type: ignore
loop_num=self._loop_num,
loop_time=(end_time - self._loop_start_time) / 1000,
loop_time=(end_time - self._loop_start_time) / 1000, # type: ignore
cost_kwargs=cost_kwargs,
furness_iters=iters,
furness_rmse=rmse,
Expand All @@ -121,9 +121,9 @@ def _gravity_function(
self.achieved_distribution = matrix

# Store the initial values to log later
if self.initial_cost_params is None:
if self.initial_cost_params is None: # type: ignore
self.initial_cost_params = cost_kwargs
if self.initial_convergence is None:
if self.initial_convergence is None: # type: ignore
self.initial_convergence = convergence

return achieved_residuals
Expand Down Expand Up @@ -350,7 +350,7 @@ def _calibrate(
self.achieved_convergence,
failure_tol,
)
self._attempt_id += 1
self._attempt_id += 1 # type: ignore
ordered_init_params = self._order_cost_params(self.cost_function.default_params)
result = optimise_cost_params(x0=ordered_init_params)

Expand All @@ -368,9 +368,9 @@ def _calibrate(
self.achieved_convergence,
failure_tol,
)
self._attempt_id += 100
self._attempt_id += 100 # type: ignore
for i in range(n_random_tries):
self._attempt_id += i
self._attempt_id += i # type: ignore
random_params = self.cost_function.random_valid_params()
ordered_init_params = self._order_cost_params(random_params)
result = optimise_cost_params(x0=ordered_init_params)
Expand Down

0 comments on commit 267f60b

Please sign in to comment.