@@ -69,10 +69,11 @@ def initialize(self):
6969 os .path .join (self .path or self .packages_path , "data" , data_path ),
7070 )
7171 self .clik_file = os .path .join (self .path_data , self .clik_file )
72+ # Prepare clipy commands
73+ if isinstance (self .commands , str ):
74+ self .commands = [self .commands ]
7275 try :
73- self .commands = None
74-
75- self .clik_likelihood = clipy .clik (self .clik_file , ** (self .commands or {}))
76+ self .clik_likelihood = clipy .clik (self .clik_file , crop = self .commands )
7677 except clipy .clik_emul_error as excpt :
7778 # Is it that the file was not found?
7879 if not os .path .exists (self .clik_file ):
@@ -87,14 +88,23 @@ def initialize(self):
8788 # Else: unknown clipy error
8889 raise LoggedError (
8990 self .log ,
90- f"An unexpected error occurred in clipy: { excpt } " ,
91- ) from excpt
92- except Exception as excpt : # unknown clippy error
93- raise LoggedError (
94- self .log ,
95- f"An unmanaged error occurred in clipy: { excpt } . Please report it as a "
96- "GitHub issue in the Cobaya repo." ,
91+ f"An unexpected managed error occurred in clipy: { excpt } " ,
9792 ) from excpt
93+ except Exception as excpt :
94+ if self .commands : # check if bad command
95+ raise LoggedError (
96+ self .log ,
97+ f"An unmanaged error occurred in clipy: { excpt } . This may have been "
98+ "caused by a worngly-formatted 'command'. Please check your command "
99+ "syntax, or disable and try again to check that clipy is working as "
100+ f"expected. The list of commands passed were: { self .commands } "
101+ ) from excpt
102+ else : # unknown clippy error
103+ raise LoggedError (
104+ self .log ,
105+ f"An unmanaged error occurred in clipy: { excpt } . Please report it as "
106+ "a GitHub issue in the Cobaya repo." ,
107+ ) from excpt
98108 lmaxs = self .clik_likelihood .lmax
99109 cls_sorted = ["tt" , "ee" , "bb" , "te" , "tb" , "eb" ]
100110 if len (lmaxs ) > 6 : # lensing likelihood!
0 commit comments