From 6612a46a9ea2eba9f8381f73cc8ffdb47fa0e5ad Mon Sep 17 00:00:00 2001 From: Florian FRANK Date: Thu, 13 Jul 2023 22:43:54 +0200 Subject: [PATCH] Fix to_json()-function of Multiband_amplifier when gain is missing Signed-off-by: Florian FRANK Change-Id: I2a0c249c7e3278e282c2c45ea8be52073f014de3 --- gnpy/core/elements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnpy/core/elements.py b/gnpy/core/elements.py index c8983c72..e4adc9b5 100644 --- a/gnpy/core/elements.py +++ b/gnpy/core/elements.py @@ -1776,7 +1776,7 @@ class Multiband_amplifier(_Node): 'amplifiers': [{ 'type_variety': amp.params.type_variety, 'operational': { - 'gain_target': round(amp.effective_gain, 6), + 'gain_target': round(amp.effective_gain, 6) if amp.effective_gain else None, 'delta_p': amp.delta_p, 'tilt_target': amp.tilt_target, 'out_voa': amp.out_voa