@@ -90,14 +90,16 @@ def generate(self, main_config: dict) -> dict[str, Actor]:
9090 Generate an actor class and actor start message from config dict
9191 """
9292 if self .component_group_name not in main_config :
93- raise PowerAPIException ('Configuration error : no ' + self .component_group_name + ' specified ' )
93+ raise PowerAPIException (f 'Configuration error : Component { self .component_group_name } group is unknown ' )
9494
9595 actors = {}
9696 for component_name , component_config in main_config [self .component_group_name ].items ():
9797 try :
9898 actors [component_name ] = self ._gen_actor (component_config , main_config , component_name )
9999 except KeyError as exn :
100- raise PowerAPIException ('Configuration error: Missing "%s" argument for %s component' , exn .args [0 ], component_name ) from exn
100+ raise PowerAPIException (f'Configuration error: Missing "{ exn .args [0 ]} " argument for { component_name } component' ) from exn
101+ except ValueError as exn :
102+ raise PowerAPIException (f'Configuration error: Invalid parameter for { component_name } component: { exn .args [0 ]} ' ) from exn
101103
102104 return actors
103105
@@ -227,7 +229,7 @@ def _json_input_database_factory(conf: dict) -> ReadableDatabase:
227229 JSON Input database factory method.
228230 """
229231 from powerapi .database .json import JsonInput
230- return JsonInput (conf ['model' ], conf ['filepath' ])
232+ return JsonInput (conf ['model' ], conf ['filepath' ], conf [ 'compression' ] )
231233
232234 @staticmethod
233235 def _socket_database_factory (conf : dict ) -> ReadableDatabase :
@@ -291,7 +293,7 @@ def _json_output_database_factory(conf: dict) -> WritableDatabase:
291293 JSON Output database factory method.
292294 """
293295 from powerapi .database .json import JsonOutput
294- return JsonOutput (conf ['model' ], conf ['filepath' ])
296+ return JsonOutput (conf ['model' ], conf ['filepath' ], conf [ 'compression' ] )
295297
296298 @staticmethod
297299 def _mongodb_database_factory (conf : dict ) -> WritableDatabase :
0 commit comments