@@ -595,21 +595,22 @@ def read_model(self):
595595 # version of the discrete model)
596596 self .build_boolCoeff ()
597597
598- def set_coupl (self , Coupl = None ) -> None : # noqa: PLR0912
598+ def set_coupl (self , Coupl = None ) -> None :
599599 """Construct the coupling matrix (and adjacancy matrix) from predefined models or via sampling."""
600600 self .varNames = {str (i ): i for i in range (self .dim )}
601601 if self .model not in self .availModels and Coupl is None :
602602 self .read_model ()
603603 elif "var" in self .model .name :
604604 # vector auto regressive process
605605 self .Coupl = Coupl
606- self .boolRules = { s : "" for s in self .varNames }
606+ self .boolRules = dict . fromkeys ( self .varNames , "" )
607607 names = list (self .varNames .keys ())
608608 for gp in range (self .dim ):
609- pas = []
610- for g in range (self .dim ):
611- if np .abs (self .Coupl [gp , g ] > 1e-10 ):
612- pas .append (names [g ])
609+ pas = [
610+ names [g ]
611+ for g in range (self .dim )
612+ if np .abs (self .Coupl [gp , g ] > 1e-10 )
613+ ]
613614 self .boolRules [names [gp ]] = "" .join (
614615 pas [:1 ] + [" or " + pa for pa in pas [1 :]]
615616 )
@@ -761,7 +762,7 @@ def branch_init_model1(self, tmax=100):
761762 settings .m (
762763 0 ,
763764 "... either no fixed point in [0,1]^2! \n "
764- + " or fixed point is too close to bounds" ,
765+ " or fixed point is too close to bounds" ,
765766 )
766767 return None
767768 XbackUp = self .sim_model_backwards (
@@ -1246,7 +1247,7 @@ def sample_static_data(model, dir, verbosity=0):
12461247 default = "" ,
12471248 help = (
12481249 "specify directory to store data, "
1249- + ' must start with "sim/MODEL_...", see possible values for MODEL below '
1250+ ' must start with "sim/MODEL_...", see possible values for MODEL below '
12501251 ),
12511252 )
12521253 aa ("--show" , action = "store_true" , help = "show plots" )
0 commit comments