Skip to content

Commit

Permalink
feat: add termination reason to inversion progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed May 7, 2024
1 parent 694b778 commit 0274d7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/invert4geom/inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def solver(
# )[0]

# elif solver_type == "steepest descent":
# """Jacobian transppose algorithm"""
# """Jacobian transpose algorithm"""
# residuals = residuals
# step = jac.T @ residuals

Expand Down Expand Up @@ -734,7 +734,7 @@ def update_gravity_and_misfit(
field="g_z",
)

# each iteration updates the topography of the layer to minizime the residual
# each iteration updates the topography of the layer to minimize the residual
# portion of the misfit. We then want to recalculate the forward gravity of the
# new layer, use the same original regional misfit, and re-calculate the residual
# Gmisfit = Gobs_corr - Gforward
Expand Down Expand Up @@ -882,9 +882,8 @@ def run_inversion(
# iteration times
iter_times = []

for iteration, _ in enumerate(
tqdm(range(max_iterations), desc="Iteration"), start=1
):
pbar = tqdm(range(max_iterations), desc="Iteration")
for iteration, _ in enumerate(pbar, start=1):
logging.info(
"\n #################################### \n iteration %s", iteration
)
Expand Down Expand Up @@ -1030,6 +1029,7 @@ def run_inversion(
)

if end is True:
pbar.set_description(f"Inversion ended due to {termination_reason}")
break
# end of inversion loop

Expand Down

0 comments on commit 0274d7b

Please sign in to comment.