Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-tfn committed Jan 9, 2024
1 parent 267f60b commit 08de987
Showing 1 changed file with 7 additions and 7 deletions.
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, # type: ignore
attempt_id=self._attempt_id, # type: ignore
loop_num=self._loop_num,
loop_time=(end_time - self._loop_start_time) / 1000, # type: ignore
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: # type: ignore
if self.initial_cost_params is None: # type: ignore
self.initial_cost_params = cost_kwargs
if self.initial_convergence is None: # type: ignore
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 # type: ignore
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 # type: ignore
self._attempt_id += 100 # type: ignore
for i in range(n_random_tries):
self._attempt_id += i # type: ignore
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 08de987

Please sign in to comment.