Add output directory validation and graceful exit in main.py#91
Add output directory validation and graceful exit in main.py#91ali-john wants to merge 1 commit into
Conversation
|
@SorooshMani-NOAA can you review this PR please? |
|
@ali-john I like the idea of having more checks, etc. but I'd like to see these checks being added as a part of the larger effort to rewrite
Ideally I'd like to see (version 4 of) It'd be a good self contained project actually, but we need to think about its priority as well; frankly as much as I like clean code and scripts, since this has been working and we're actively using it I don't want to change it drastically in short term. If the same checks above can be added to We can do this in main.py since we're updating our config there. Thinking about it again, maybe if you bundle your current checks and changes with that input.yaml thing I just said, that makes more sense. Just update the path in main.py, make a copy of the updated file instead of the _asis one, and then do the checks in workflow.sh.
|
|
@SorooshMani-NOAA , that makes sense. I’ll update the path in |
I would say no, but I'd like to see what @FariborzDaneshvar-NOAA thinks as well. We're actually adding some newer goals to ioos/gsoc#79 after revisiting our priorities. The main priority for GSoC 25 right now is:
|
|
@SorooshMani-NOAA Thanks for taking lead and your prompt response. |
This PR adds validation checks for the output directory (RUN_OUT) specified in the configuration file. The changes ensure that before running the workflow, the script:
If any of these checks fail, the script logs an appropriate error message and exits gracefully instead of attempting to write to an unwritable or non-existent directory.
This prevents runtime errors (such as trying to create directories in the root filesystem) and improves the robustness of the workflow. All changes have been tested locally with various configurations.