Skip to content

Commit

Permalink
feat: add more warnings on amplifiers
Browse files Browse the repository at this point in the history
when user settings do not match library

Signed-off-by: EstherLerouzic <[email protected]>
Change-Id: Id387b7781d9637f1d18c453dae75330962229902
  • Loading branch information
EstherLerouzic committed Nov 26, 2024
1 parent 85127ce commit 6eb1c54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gnpy/core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,12 @@ def set_one_amplifier(node: elements.Edfa, prev_node, next_node, power_mode: boo
+ '\tmax flat gain: '
+ f'{equipment["Edfa"][node.params.type_variety].gain_flatmax}dB ; '
+ f'required gain: {round(gain_target, 2)}dB. Please check amplifier type.\n')

if gain_target - equipment['Edfa'][node.params.type_variety].gain_min < 0 and verbose:
logger.warning(f'\n\tWARNING: effective gain in Node {node.uid}\n'
+ f'\tis below user specified amplifier {node.params.type_variety}\n'
+ '\tmin gain: '
+ f'{equipment["Edfa"][node.params.type_variety].gain_min}dB ; '
+ f'required gain: {round(gain_target, 2)}dB. Please check amplifier type.\n')
node.delta_p = dp if power_mode else None
node.effective_gain = gain_target
node.tilt_target = _tilt_target
Expand Down
5 changes: 5 additions & 0 deletions tests/invocation/logs_power_sweep_example
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ WARNING gnpy.core.network:network.py
is above user specified amplifier std_low_gain
max flat gain: 16dB ; required gain: 21.22dB. Please check amplifier type.

WARNING gnpy.core.network:network.py
WARNING: effective gain in Node east edfa in Stbrieuc to Rennes_STA
is below user specified amplifier std_medium_gain
min gain: 15dB ; required gain: 12.0dB. Please check amplifier type.

WARNING gnpy.core.network:network.py
WARNING: target gain and power in node west edfa in Rennes_STA to Stbrieuc
is beyond all available amplifiers capabilities and/or extended_gain_range:
Expand Down
5 changes: 5 additions & 0 deletions tests/invocation/logs_transmission_saturated
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ WARNING gnpy.core.network:network.py
is above user specified amplifier std_low_gain
max flat gain: 16dB ; required gain: 21.18dB. Please check amplifier type.

WARNING gnpy.core.network:network.py
WARNING: effective gain in Node east edfa in Stbrieuc to Rennes_STA
is below user specified amplifier std_medium_gain
min gain: 15dB ; required gain: 12.0dB. Please check amplifier type.

WARNING gnpy.core.network:network.py
WARNING: target gain and power in node west edfa in Rennes_STA to Stbrieuc
is beyond all available amplifiers capabilities and/or extended_gain_range:
Expand Down

0 comments on commit 6eb1c54

Please sign in to comment.