Skip to content

Commit e4f090e

Browse files
committed
Reduce indentation
1 parent f6e8edc commit e4f090e

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

simpeg/directives/_regularization.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,20 @@ def adjust_cooling_schedule(self):
229229
"""
230230
Adjust the cooling schedule based on the misfit.
231231
"""
232-
if self.metrics.start_irls_iter is not None:
233-
ratio = self.invProb.phi_d / self.misfit_from_chi_factor(
234-
self.chifact_target
235-
)
236-
if np.abs(1.0 - ratio) > self.misfit_tolerance:
232+
if self.metrics.start_irls_iter is None:
233+
return
237234

238-
if ratio > 1:
239-
update_ratio = 1 / np.mean([0.75, 1 / ratio])
240-
else:
241-
update_ratio = 1 / np.mean([2.0, 1 / ratio])
235+
ratio = self.invProb.phi_d / self.misfit_from_chi_factor(self.chifact_target)
236+
if np.abs(1.0 - ratio) > self.misfit_tolerance:
242237

243-
self.cooling_factor = update_ratio
238+
if ratio > 1:
239+
update_ratio = 1 / np.mean([0.75, 1 / ratio])
244240
else:
245-
self.cooling_factor = 1.0
241+
update_ratio = 1 / np.mean([2.0, 1 / ratio])
242+
243+
self.cooling_factor = update_ratio
244+
else:
245+
self.cooling_factor = 1.0
246246

247247
def initialize(self):
248248
"""

0 commit comments

Comments
 (0)