Skip to content

Commit 816dd67

Browse files
committed
fold normalize into GMR branch to drop redundant state check
1 parent 58d14e3 commit 816dd67

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

fme/core/step/single_module.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,19 +556,19 @@ def step_with_adjustments(
556556
network_input, gmr_state = global_mean_removal.forward_transform(
557557
input, data_mask
558558
)
559-
else:
560-
network_input = dict(input)
561-
input_norm = normalizer.normalize(network_input)
562-
if global_mean_removal is not None and gmr_state is not None:
559+
input_norm = normalizer.normalize(network_input)
563560
# Synthetic GMR channels are produced in normalized space; merge
564561
# them in after normalization so the network sees a single uniform
565562
# input dict.
566563
input_norm = {**input_norm, **global_mean_removal.extras_normalized(gmr_state)}
564+
else:
565+
input_norm = normalizer.normalize(input)
567566
output_norm = network_calls(input_norm)
568567
if residual_prediction:
569568
output_norm = add_names(input_norm, output_norm, prognostic_names)
570569
output = normalizer.denormalize(output_norm)
571-
if global_mean_removal is not None and gmr_state is not None:
570+
if global_mean_removal is not None:
571+
assert gmr_state is not None
572572
output = global_mean_removal.inverse_transform(output, gmr_state)
573573
if corrector is not None:
574574
corrector_state: CorrectorState | None = (

0 commit comments

Comments
 (0)