fix load_sim_params
@@ -3,17 +3,19 @@ from gnpy.core.utils import load_json
def load_sim_params(path_sim_params):
sim_params = load_json(path_sim_params)
- return SimParams(**sim_params)
+ return SimParams(params=sim_params)
-class RamanParameters():
+class RamanParams():
def __init__(self, params=None):
+ if params:
self.flag_raman = params['flag_raman']
self.space_resolution = params['space_resolution']
self.tolerance = params['tolerance']
self.verbose = params['verbose']
-class NLIParameters():
+class NLIParams():
def __init__(self, params=None):
+ if params:
self.nli_method_name = params['nli_method_name']
self.wdm_grid_size = params['wdm_grid_size']
self.dispersion_tolerance = params['dispersion_tolerance']
@@ -22,6 +24,7 @@ class NLIParameters():
class SimParams():
def __init__(self, params=None):
+ if params:
self.list_of_channels_under_test = params['list_of_channels_under_test']
- self.raman_params = RamanParameters(params=params['raman_parametes'])
- self.nli_params = NLIParameters(params=params['nli_parametes'])
\ No newline at end of file
+ self.raman_params = RamanParams(params=params['raman_parameters'])
+ self.nli_params = NLIParams(params=params['nli_parameters'])
\ No newline at end of file
