@@ -69,10 +69,11 @@ def initialize(self):
69
69
os .path .join (self .path or self .packages_path , "data" , data_path ),
70
70
)
71
71
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 ]
72
75
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 )
76
77
except clipy .clik_emul_error as excpt :
77
78
# Is it that the file was not found?
78
79
if not os .path .exists (self .clik_file ):
@@ -87,14 +88,23 @@ def initialize(self):
87
88
# Else: unknown clipy error
88
89
raise LoggedError (
89
90
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 } " ,
97
92
) 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
98
108
lmaxs = self .clik_likelihood .lmax
99
109
cls_sorted = ["tt" , "ee" , "bb" , "te" , "tb" , "eb" ]
100
110
if len (lmaxs ) > 6 : # lensing likelihood!
0 commit comments