Skip to content

Commit

Permalink
typos, last cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
tjlane committed Oct 28, 2024
1 parent 04c2e76 commit a141ccb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions meteor/iterative.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def _complex_derivative_from_iterative_tv( # noqa: PLR0913
f" iter {num_iterations:03d}", # noqa: G004
phase_change=round(phase_change, 4),
negentropy=round(tv_metadata.optimal_negentropy, 4),
tv_weight=tv_metadata.optimal_tv_weight,
)

if num_iterations > max_iterations:
Expand Down
4 changes: 2 additions & 2 deletions meteor/scripts/compute_difference_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def denoise_diffmap_according_to_mode(
"Optimal TV weight found",
weight=metadata.optimal_tv_weight,
initial_negentropy=f"{metadata.initial_negentropy:.2e}",
final_negetropy=f"{metadata.optimal_negentropy:.2e}",
final_negentropy=f"{metadata.optimal_negentropy:.2e}",
)

elif tv_denoise_mode == WeightMode.fixed:
Expand All @@ -108,7 +108,7 @@ def denoise_diffmap_according_to_mode(
"Map TV-denoised with fixed weight",
weight=tv_weight,
initial_negentropy=f"{metadata.initial_negentropy:.2e}",
final_negetropy=f"{metadata.optimal_negentropy:.2e}",
final_negentropy=f"{metadata.optimal_negentropy:.2e}",
)

elif tv_denoise_mode == WeightMode.none:
Expand Down
3 changes: 2 additions & 1 deletion meteor/scripts/compute_iterative_tv_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def main(command_line_arguments: list[str] | None = None) -> None:
verbose=True,
)
mapset.derivative = new_derivative_map
log.info("Convergence.")

diffmap, kparameter_used = kweight_diffmap_according_to_mode(
kweight_mode=args.kweight_mode, kweight_parameter=args.kweight_parameter, mapset=mapset
Expand All @@ -67,7 +68,7 @@ def main(command_line_arguments: list[str] | None = None) -> None:
log.info(
"Optimal TV weight found",
weight=final_tv_metadata.optimal_tv_weight,
final_negetropy=f"{final_tv_metadata.optimal_negentropy:.2e}",
final_negentropy=f"{final_tv_metadata.optimal_negentropy:.2e}",
)

log.info("Writing output.", file=str(args.mtzout))
Expand Down
6 changes: 3 additions & 3 deletions meteor/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ def negentropy_objective(tv_weight: float) -> float:
if full_output:
initial_negentropy = negentropy(realspace_map_array)
tv_result = TvDenoiseResult(
initial_negentropy=initial_negentropy,
optimal_tv_weight=maximizer.argument_optimum,
optimal_negentropy=maximizer.objective_maximum,
initial_negentropy=float(initial_negentropy),
optimal_tv_weight=float(maximizer.argument_optimum),
optimal_negentropy=float(maximizer.objective_maximum),
map_sampling_used_for_tv=MAP_SAMPLING,
tv_weights_scanned=maximizer.values_evaluated,
negentropy_at_weights=maximizer.objective_at_values,
Expand Down
2 changes: 1 addition & 1 deletion meteor/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, *, objective: Callable[[float], float]) -> None:
self.objective_at_values: list[float] = []

def _update_optima(self, argument_test_value: float) -> float:
objective_value = self.objective(argument_test_value)
objective_value = float(self.objective(argument_test_value))
if objective_value > self.objective_maximum:
self.argument_optimum = argument_test_value
self.objective_maximum = objective_value
Expand Down

0 comments on commit a141ccb

Please sign in to comment.