Sodankyla example (and run.py) assumes working directory
Observation
When attempting to test PROFFAST, the default example assumes the user is running the script from the working directory. E.g.,
$ pwd
/home/USER/PROFFAST/proffastpylot/
$ python3 example/run.py
Example data where not found on disk.
Do you like to download them? This will download 104 MB of data to your disk.
Enter 'yes' to download the data or 'no' to abort:
yes
99%|████████████████████████████████████████████████████████████████████▋| 84969/85404.5244140625 [00:08<00:00, 9868.74KB/s]/home/whoneyc/PROFFAST/proffastpylot/prf_venv/lib64/python3.6/site-packages/tqdm/std.py:536: TqdmWarning: clamping frac to range [0, 1]
colour=colour)
100%|█████████████████████████████████████████████████████████████████████| 85405/85404.5244140625 [00:08<00:00, 9877.36KB/s]
Download Completed
2024-04-04 16:14:33,603, INFO: ++++ Welcome to PROFFASTpylot ++++
Traceback (most recent call last):
File "example/run.py", line 25, in <module>
MyPylot = Pylot(input_file, logginglevel="info")
File "/home/USER/PROFFAST/proffastpylot/prfpylot/pylot.py", line 47, in __init__
external_logger=external_logger, loggername=loggername)
File "/home/USER/PROFFAST/proffastpylot/prfpylot/filemover.py", line 38, in __init__
external_logger=external_logger, loggername=loggername)
File "/home/USER/PROFFAST/proffastpylot/prfpylot/prepare.py", line 120, in __init__
with open(input_file, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'input_sodankyla_example.yml'
$ cd example
$ python3 run.py
Example data are already available on disk
2024-04-04 16:25:29,570, INFO: ++++ Welcome to PROFFASTpylot ++++
2024-04-04 16:25:29,605, INFO: Run information:
Retrieval for Instrument SN039 at Sodankyla with time offset 0.0.
The following dates will be processed:
2017-06-08, 2017-06-09......
Expected Behavior
An input script should test for current working directory to test for relative paths. Ideally, this would occur upstream from the example input file. This is necessary for large systems with separate directory structures for programs and outputs such as /home
and /scratch
when sysadmins recommend running sbatch
from the output location.