LabSid-USP/RUBEM

Fix checking for files in the output directory when it doesn't exist

soaressgabriel opened this issue · 0 comments

Describe the bug

  • There is an issue that causes the application to check files in the output directory when it does not exist.

To Reproduce

Steps to reproduce the behavior:

  1. Configure a simulation to use an output directory (valid path) that does not exist;
  2. Run the simulation;
  3. See error:
$ python rubem -c "/home/user/workspaces/test.json"
Loading configuration and validating inputs...
02/22/2024 20:54:04 rubem.configuration.model_configuration ERROR:Failed to load configuration: The system cannot find the path specified: '/home/user/workspaces/output'
02/22/2024 20:54:04 rubem.cli CRITICAL:RUBEM unexpectedly quit (-_-;)
02/22/2024 20:54:04 rubem.cli ERROR: The system cannot find the path specified: '/home/user/workspace/output'
Traceback (most recent call last):
  File "/home/user/workspaces/RUBEM/rubem/cli.py", line 94, in main
    model_config = ModelConfiguration(args.configfile, args.skip_inputs_validation)
  File "/home/user/workspaces/RUBEM/rubem/configuration/model_configuration.py", line 103, in __init__
    self.output_directory = OutputDataDirectory(self.__get_setting("DIRECTORIES", "output"))
  File "/home/user/workspaces/RUBEM/rubem/configuration/output_data_directory.py", line 21, in __init__
    self.__validate_directories()
  File "/home/user/workspaces/RUBEM/rubem/configuration/output_data_directory.py", line 37, in __validate_directories
    if os.listdir(self.path):
FileNotFoundError: The system cannot find the path specified: '/home/user/workspace/output'

Expected behavior

  • The application should not check files in output directories when they do not exist.

Screenshots

  • N/A

System information

Additional context

  • N/A