mirror of
https://github.com/Telecominfraproject/oopt-gnpy.git
synced 2025-11-02 02:57:52 +00:00
Be sure that both nf_min and nf_max are removed
If `nf_min` was not present, then `nf_max` would be left remaining because an attempt to nuke `nf_min` raised an exception. Thanks to codecov.io for making it easy to spot this on the coverage page.
This commit is contained in:
@@ -144,10 +144,11 @@ class Amp(common):
|
||||
except KeyError: #nf0 is expected for a fixed gain amp
|
||||
print(f'missing nf0 value input for amplifier: {type_variety} in eqpt_config.json')
|
||||
exit()
|
||||
try: #remove all remaining nf inputs
|
||||
del kwargs['nf_min']
|
||||
del kwargs['nf_max']
|
||||
except KeyError: pass #nf_min and nf_max are not needed for fixed gain amp
|
||||
for k in ('nf_min', 'nf_max'):
|
||||
try:
|
||||
del kwargs[k]
|
||||
except KeyError:
|
||||
pass
|
||||
nf_def = Model_fg(nf0)
|
||||
elif type_def == 'advanced_model':
|
||||
config = Path(filename).parent / kwargs.pop('advanced_config_from_json')
|
||||
|
||||
Reference in New Issue
Block a user