Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ctis/inverters/_iterative/_mart/_mart.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __call__(
if verbose: # pragma: nocover
print(f"merit: {merit}")

elif (merit_old - merit) < self.threshold_convergence:
if (merit_old - merit) < self.threshold_convergence:
message = f"Achieved merit less than {self.threshold_convergence}."
success = True
num_iteration = i + 1
Expand Down
16 changes: 16 additions & 0 deletions ctis/inverters/_iterative/_mart/_mart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,19 @@ def test__call__(
assert isinstance(fig, plt.Figure)
for ax in axs:
assert isinstance(ax, plt.Axes)


def test__call__verbose_convergence():
"""
Verbose output must not disable the convergence check.
"""
a = ctis.inverters.MartInverter(
instrument=instrument,
num_iteration=50,
threshold_convergence=1e-2,
)

result = a(images, verbose=True)

assert result.success
assert result.num_iteration < a.num_iteration
Loading