bvanosnabrugge / summaWorkflow_public

GNU General Public License v3.0
0 stars 4 forks source link

[Package] subprocess_lwd assumes a linux environment and fails on windows #41

Open wknoben opened 2 years ago

wknoben commented 2 years ago

https://github.com/bartvanosnabrugge/summaWorkflow_public/blob/28719ccafb83feeb794c9a54ec07244535564e64/cwarhm/wrappers/cwarhm_summa.py#L71 on windows, sends the following to terminal:

sh C:/Git_repos/cwarhm/summaWorkflow_public/dependencies/cwarhm-summa\3b_parameters\MERIT_Hydro_DEM\2_unpack\unpack_merit_hydro_dem.sh

which fails with this error:

running wrapper for C:/Git_repos/cwarhm/summaWorkflow_public/dependencies/cwarhm-summa\3b_parameters\MERIT_Hydro_DEM\2_unpack\unpack_merit_hydro_dem.sh
Traceback (most recent call last):
  File "test_bow_at_banff.py", line 56, in <module>
    fm.unpack_merit_hydro(cwarhm_summa_folder)
  File "C:\Git_repos\cwarhm\summaWorkflow_public\cwarhm\wrappers\cwarhm_summa.py", line 339, in unpack_merit_hydro
    subprocess_lwd(python_file_to_run)
  File "C:\Git_repos\cwarhm\summaWorkflow_public\cwarhm\wrappers\cwarhm_summa.py", line 71, in subprocess_lwd
    subprocess.run(["sh",script_path])
  File "C:\Users\wmk934\Anaconda3\envs\cwarhm-env\lib\subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\wmk934\Anaconda3\envs\cwarhm-env\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\wmk934\Anaconda3\envs\cwarhm-env\lib\subprocess.py", line 1311, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
wknoben commented 2 years ago

Essentially, make sure the workflow's .sh files can be executed under windows