3333
3434
3535def normalize_config_path (config_path : str ) -> str :
36- """Normalize the config file path.
36+ """
37+ Normalize the config file path.
3738
3839 :param config_path: Path to config file (relative or absolute)
3940 :type config_path: str
@@ -55,7 +56,8 @@ def normalize_config_path(config_path: str) -> str:
5556
5657
5758def setup_config_from_cli (args : Any ) -> dict [str , Any ]:
58- """Set up configuration from command line input.
59+ """
60+ Set up configuration from command line input.
5961
6062 :param args: Parsed command line arguments
6163 :type args: Any
@@ -163,8 +165,8 @@ def _validate_config_structure(config: ConfigParser) -> None:
163165 if not config .has_section (REQUIRED_SECTION ):
164166 create_directory (CONFIG_DIR_PATH )
165167 raise ConfigParseError (
166- f"Missing '{ REQUIRED_SECTION } ' section in config file. "
167- "Ensure config.ini exists in ini/run_ini/ ."
168+ f"Missing required '{ REQUIRED_SECTION } ' section in config file. "
169+ "Ensure your config file exists and contains all required options ."
168170 )
169171
170172
@@ -192,7 +194,8 @@ def _resolve_config_path(config_path: str | None) -> str:
192194def load_config (
193195 config_path : str | None , args_dict : dict [str , Any ] | None = None
194196) -> dict [str , Any ]:
195- """Load an existing config from a config file.
197+ """
198+ Load an existing config from a config file.
196199
197200 This function handles the complete configuration loading process:
198201 1. Resolves and validates the config file path
@@ -313,7 +316,8 @@ def _find_category(
313316
314317
315318def load_and_validate_config (args : Any ) -> dict [str , Any ]:
316- """Load and validate configuration from CLI arguments.
319+ """
320+ Load and validate configuration from CLI arguments.
317321
318322 :param args: Parsed command line arguments
319323 :type args: Any
@@ -325,15 +329,17 @@ def load_and_validate_config(args: Any) -> dict[str, Any]:
325329
326330
327331class ConfigManager :
328- """Centralized configuration management for FUSION simulator.
332+ """
333+ Centralized configuration management for FUSION simulator.
329334
330335 Provides a unified interface for accessing configuration from both
331336 INI files and command-line arguments, with proper validation and
332337 error handling. Supports multi-threaded configuration sections.
333338 """
334339
335340 def __init__ (self , config_dict : dict [str , Any ], args : Any ) -> None :
336- """Initialize ConfigManager with configuration dictionary and arguments.
341+ """
342+ Initialize ConfigManager with configuration dictionary and arguments.
337343
338344 :param config_dict: Parsed configuration dictionary
339345 :type config_dict: Dict[str, Any]
@@ -352,7 +358,8 @@ def _validate_config(self) -> None:
352358
353359 @classmethod
354360 def from_args (cls , args : Any ) -> "ConfigManager" :
355- """Load arguments from command line input.
361+ """
362+ Load arguments from command line input.
356363
357364 :param args: Parsed command line arguments
358365 :type args: Any
@@ -373,7 +380,8 @@ def from_args(cls, args: Any) -> "ConfigManager":
373380 def from_file (
374381 cls , config_path : str , args_dict : dict [str , Any ] | None = None
375382 ) -> "ConfigManager" :
376- """Create ConfigManager from config file path.
383+ """
384+ Create ConfigManager from config file path.
377385
378386 :param config_path: Path to configuration file
379387 :type config_path: str
@@ -388,15 +396,17 @@ def from_file(
388396 return cls (config_dict , args )
389397
390398 def as_dict (self ) -> dict [str , Any ]:
391- """Get config as dict.
399+ """
400+ Get config as dict.
392401
393402 :return: Configuration dictionary
394403 :rtype: Dict[str, Any]
395404 """
396405 return self ._config
397406
398407 def get (self , thread : str = DEFAULT_THREAD_NAME ) -> dict [str , Any ]:
399- """Return a single config thread.
408+ """
409+ Return a single config thread.
400410
401411 :param thread: Thread identifier, defaults to 's1'
402412 :type thread: str
@@ -409,7 +419,8 @@ def get(self, thread: str = DEFAULT_THREAD_NAME) -> dict[str, Any]:
409419 def get_value (
410420 self , key : str , thread : str = DEFAULT_THREAD_NAME , default : Any = None
411421 ) -> Any :
412- """Get a specific configuration value.
422+ """
423+ Get a specific configuration value.
413424
414425 :param key: Configuration key
415426 :type key: str
@@ -424,7 +435,8 @@ def get_value(
424435 return thread_config .get (key , default )
425436
426437 def has_thread (self , thread : str ) -> bool :
427- """Check if a thread exists in configuration.
438+ """
439+ Check if a thread exists in configuration.
428440
429441 :param thread: Thread identifier
430442 :type thread: str
@@ -434,15 +446,17 @@ def has_thread(self, thread: str) -> bool:
434446 return thread in self ._config
435447
436448 def get_threads (self ) -> list [str ]:
437- """Get list of all configured threads.
449+ """
450+ Get list of all configured threads.
438451
439452 :return: List of thread identifiers
440453 :rtype: List[str]
441454 """
442455 return list (self ._config .keys ())
443456
444457 def get_args (self ) -> Any :
445- """Get args.
458+ """
459+ Get args.
446460
447461 :return: Command line arguments
448462 :rtype: Any
0 commit comments