NOAA-GFDL / fre-workflows

Code to generate, describe, validate, and configure scientific workflows within the FRE software framework
2 stars 4 forks source link

Analysis script validator checks for path to script in /file folder instead of the name of the script #16

Closed uwagura closed 3 months ago

uwagura commented 3 months ago

In the following lines of /meta/lib/python/macros/analysis_validator.py

https://github.com/NOAA-GFDL/fre-workflows/blob/c18dedd918a09fef11a24ffcab692ab8d86a3e7b/meta/lib/python/macros/analysis_validator.py#L91-L112

We check if the analysis script is readable, and if not we then check if it the script is in FRE_ANALYSIS_HOME or if it's in app/analysis/file. However, if the user enters the full path to the analysis script (i.e /home/oar.gfdl.mdtf/mdtf/MDTF-diagnostics/sites/NOAA_GFDL/mdtf_gfdl.csh ) instead of just the scripts name, the ascript variable in this section will contain the full path and the first else statement will set ascript equal to /app/analysis/file//home/oar.gfdl.mdtf/mdtf/MDTF-diagnostics/sites/NOAA_GFDL/mdtf_gfdl.csh instead of app/analysis/file/mdtf_gfld.csh.

We can probably get around this by setting ascript = analysis_file_suffix+ascript.split('/')[-1], or something along those lines.

As a minor side note, /home/oar.gfdl.mdtf/mdtf/MDTF-diagnostics/sites/NOAA_GFDL/mdtf_gfdl.csh no longer exists, so we should probably replace this with just mdtf_gfdl.csh in app/analysis/rose-app.conf.