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)

class RamanParameters():
    def __init__(self, params=None):
        self.flag_raman = params['flag_raman']
        self.space_resolution = params['space_resolution']
        self.tolerance = params['tolerance']
        self.verbose = params['verbose']

class NLIParameters():
    def __init__(self, params=None):
        self.nli_method_name = params['nli_method_name']
        self.wdm_grid_size = params['wdm_grid_size']
        self.dispersion_tolerance = params['dispersion_tolerance']
        self.phase_shift_tollerance = params['phase_shift_tollerance']
        self.verbose = params['verbose']

class SimParams():
    def __init__(self, params=None):
        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'])
@@ -140,10 +140,15 @@
 ams(
-**
+params=
 sim_
@@ -168,28 +168,24 @@
 s RamanParam
-eter
 s():%0A    def
@@ -206,32 +206,55 @@
 , params=None):%0A
+        if params:%0A    
         self.fla
@@ -280,24 +280,28 @@
 lag_raman'%5D%0A
+    
         self
@@ -351,24 +351,28 @@
 n'%5D%0A        
+  
+  
 self.toleran
@@ -388,32 +388,36 @@
 ms%5B'tolerance'%5D%0A
+    
         self.ver
@@ -456,20 +456,16 @@
 NLIParam
-eter
 s():%0A   
@@ -490,32 +490,55 @@
 , params=None):%0A
+        if params:%0A    
         self.nli
@@ -582,24 +582,28 @@
 e'%5D%0A        
+    
 self.wdm_gri
@@ -631,24 +631,28 @@
 grid_size'%5D%0A
+    
         self
@@ -710,24 +710,28 @@
 e'%5D%0A        
+    
 self.phase_s
@@ -773,32 +773,36 @@
 ft_tollerance'%5D%0A
+    
         self.ver
@@ -875,32 +875,55 @@
 , params=None):%0A
+        if params:%0A    
         self.lis
@@ -991,24 +991,28 @@
 t'%5D%0A        
+  
+  
 self.raman_p
@@ -1025,28 +1025,24 @@
 = RamanParam
-eter
 s(params=par
@@ -1056,24 +1056,25 @@
 man_paramete
+r
 s'%5D)%0A       
@@ -1066,32 +1066,36 @@
 ters'%5D)%0A        
+ 
+   
 self.nli_params 
@@ -1104,20 +1104,16 @@
 NLIParam
-eter
 s(params
@@ -1133,12 +1133,13 @@
 paramete
+r
 s'%5D)

fix load_sim_params