@@ -216,9 +216,9 @@ def __init__(self, launcher_args: argparse.Namespace | dict = None, **kwargs):
216
216
if not set (kwargs .keys ()).isdisjoint (launcher_args .keys ()):
217
217
overlapping_args = set (kwargs .keys ()).intersection (launcher_args .keys ())
218
218
raise ValueError (
219
- f"Input `launcher_args` and `kwargs` both provided common attributes: { overlapping_args } . "
220
- "Please ensure that each argument is supplied to only one of them, as the AppLauncher cannot "
221
- "discern priority between them."
219
+ f"Input `launcher_args` and `kwargs` both provided common attributes: { overlapping_args } ."
220
+ " Please ensure that each argument is supplied to only one of them, as the AppLauncher cannot"
221
+ " discern priority between them."
222
222
)
223
223
launcher_args .update (kwargs )
224
224
@@ -300,10 +300,10 @@ def add_app_launcher_args(parser: argparse.ArgumentParser) -> None:
300
300
config = vars (known )
301
301
if len (config ) == 0 :
302
302
print (
303
- "[Warn][AppLauncher]: There are no arguments attached to the ArgumentParser object. "
304
- "If you have your own arguments, please load your own arguments before calling the "
305
- "`AppLauncher.add_app_launcher_args` method. This allows the method to check the validity "
306
- "of the arguments and perform checks for argument names."
303
+ "[Warn][AppLauncher]: There are no arguments attached to the ArgumentParser object."
304
+ " If you have your own arguments, please load your own arguments before calling the"
305
+ " `AppLauncher.add_app_launcher_args` method. This allows the method to check the validity"
306
+ " of the arguments and perform checks for argument names."
307
307
)
308
308
else :
309
309
AppLauncher ._check_argparser_config_params (config )
@@ -406,9 +406,9 @@ def _check_argparser_config_params(config: dict) -> None:
406
406
for key , value in config .items ():
407
407
if key in applauncher_keys :
408
408
raise ValueError (
409
- f"The passed ArgParser object already has the field '{ key } '. This field will be added by "
410
- "AppLauncher.add_app_launcher_args(), and should not be added directly. Please remove the "
411
- "argument or rename it to a non-conflicting name."
409
+ f"The passed ArgParser object already has the field '{ key } '. This field will be added by"
410
+ " ` AppLauncher.add_app_launcher_args()` , and should not be added directly. Please remove the"
411
+ " argument or rename it to a non-conflicting name."
412
412
)
413
413
# check that type of the passed keys are valid
414
414
simulationapp_keys = set (AppLauncher ._SIMULATIONAPP_CONFIG_TYPES .keys ())
@@ -418,9 +418,9 @@ def _check_argparser_config_params(config: dict) -> None:
418
418
expected_types = AppLauncher ._SIMULATIONAPP_CONFIG_TYPES [key ]
419
419
if type (value ) not in set (expected_types ):
420
420
raise ValueError (
421
- f"Invalid value type for the argument '{ key } ': { given_type } . Expected one of { expected_types } , "
422
- f" if intended to be ingested by the SimulationApp object. Please change the type if this "
423
- "intended for the SimulationApp or change the name of the argument to avoid name conflicts."
421
+ f"Invalid value type for the argument '{ key } ': { given_type } . Expected one of { expected_types } ,"
422
+ " if intended to be ingested by the SimulationApp object. Please change the type if this"
423
+ " intended for the SimulationApp or change the name of the argument to avoid name conflicts."
424
424
)
425
425
# Print out values which will be used
426
426
print (f"[INFO][AppLauncher]: The argument '{ key } ' will be used to configure the SimulationApp." )
@@ -441,22 +441,22 @@ def _config_resolution(self, launcher_args: dict):
441
441
# Value checking on LIVESTREAM
442
442
if livestream_env not in livestream_valid_vals :
443
443
raise ValueError (
444
- f"Invalid value for environment variable `LIVESTREAM`: { livestream_env } . "
445
- f"Expected: { livestream_valid_vals } ."
444
+ f"Invalid value for environment variable `LIVESTREAM`: { livestream_env } ."
445
+ f" Expected: { livestream_valid_vals } ."
446
446
)
447
447
# We allow livestream kwarg to supersede LIVESTREAM envvar
448
448
if livestream_arg >= 0 :
449
449
if livestream_arg in livestream_valid_vals :
450
450
self ._livestream = livestream_arg
451
451
# print info that we overrode the env-var
452
452
print (
453
- f"[INFO][AppLauncher]: Input keyword argument `livestream={ livestream_arg } ` has overridden "
454
- f"the environment variable `LIVESTREAM={ livestream_env } `."
453
+ f"[INFO][AppLauncher]: Input keyword argument `livestream={ livestream_arg } ` has overridden"
454
+ f" the environment variable `LIVESTREAM={ livestream_env } `."
455
455
)
456
456
else :
457
457
raise ValueError (
458
- f"Invalid value for input keyword argument `livestream`: { livestream_arg } . "
459
- f"Expected: { livestream_valid_vals } ."
458
+ f"Invalid value for input keyword argument `livestream`: { livestream_arg } ."
459
+ f" Expected: { livestream_valid_vals } ."
460
460
)
461
461
else :
462
462
self ._livestream = livestream_env
@@ -472,8 +472,7 @@ def _config_resolution(self, launcher_args: dict):
472
472
# Value checking on HEADLESS
473
473
if headless_env not in headless_valid_vals :
474
474
raise ValueError (
475
- f"Invalid value for environment variable `HEADLESS`: { headless_env } . "
476
- f"Expected: { headless_valid_vals } ."
475
+ f"Invalid value for environment variable `HEADLESS`: { headless_env } . Expected: { headless_valid_vals } ."
477
476
)
478
477
# We allow headless kwarg to supersede HEADLESS envvar if headless_arg does not have the default value
479
478
# Note: Headless is always true when livestreaming
@@ -485,13 +484,13 @@ def _config_resolution(self, launcher_args: dict):
485
484
# inform who has toggled the headless flag
486
485
if self ._livestream == livestream_arg :
487
486
print (
488
- f"[INFO][AppLauncher]: Input keyword argument `livestream={ self ._livestream } ` has implicitly "
489
- f"overridden the environment variable `HEADLESS={ headless_env } ` to True."
487
+ f"[INFO][AppLauncher]: Input keyword argument `livestream={ self ._livestream } ` has implicitly"
488
+ f" overridden the environment variable `HEADLESS={ headless_env } ` to True."
490
489
)
491
490
elif self ._livestream == livestream_env :
492
491
print (
493
- f"[INFO][AppLauncher]: Environment variable `LIVESTREAM={ self ._livestream } ` has implicitly "
494
- f"overridden the environment variable `HEADLESS={ headless_env } ` to True."
492
+ f"[INFO][AppLauncher]: Environment variable `LIVESTREAM={ self ._livestream } ` has implicitly"
493
+ f" overridden the environment variable `HEADLESS={ headless_env } ` to True."
495
494
)
496
495
else :
497
496
# Headless needs to be a bool to be ingested by SimulationApp
@@ -515,8 +514,8 @@ def _config_resolution(self, launcher_args: dict):
515
514
self ._ros = ros_arg
516
515
# print info that we overrode the env-var
517
516
print (
518
- f"[INFO][AppLauncher]: Input keyword argument `ros={ ros_arg } ` has overridden "
519
- f"the environment variable `ROS_ENABLED={ ros_env } `."
517
+ f"[INFO][AppLauncher]: Input keyword argument `ros={ ros_arg } ` has overridden"
518
+ f" the environment variable `ROS_ENABLED={ ros_env } `."
520
519
)
521
520
else :
522
521
raise ValueError (
0 commit comments