Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make variable for Scwrl executable path. #10

Open
ChrisWellsWood opened this issue Jun 29, 2018 · 1 comment
Open

Make variable for Scwrl executable path. #10

ChrisWellsWood opened this issue Jun 29, 2018 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ChrisWellsWood
Copy link
Contributor

It'd be useful to have an executable_path argument for run_scwrl, scwrl_available and pack_side_chains_scwrl with a default value of Scwrl4 (i.e. on the path), so that people can use Scwrl even if it's not on their path.

@ChrisWellsWood ChrisWellsWood added enhancement New feature or request good first issue Good for newcomers labels Jun 29, 2018
@universvm
Copy link

Hi, I have a problem with this currently, although I have SCWRL installed:

❯ which Scwrl4
Scwrl4: aliased to /Users/leo/scwrl4/Scwrl4 -p /Users/leo/scwrl4/Scwrl4.ini

I get the following error:

  File "/usr/local/Caskroom/miniforge/base/envs/timed_predict/lib/python3.8/site-packages/isambard/modelling/scwrl.py", line 158, in pack_side_chains_scwrl
    raise ValueError('Scwrl4 is unavailable on your system path.')
ValueError: Scwrl4 is unavailable on your system path.

While checking the code I found that this is where I get the error:

>>> subprocess.check_output(['Scwrl4'], stderr=subprocess.DEVNULL)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Caskroom/miniforge/base/envs/timed_predict/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/Caskroom/miniforge/base/envs/timed_predict/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/Caskroom/miniforge/base/envs/timed_predict/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Caskroom/miniforge/base/envs/timed_predict/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'Scwrl4'

Which I can get around by modifying the above code to:

subprocess.check_output(['/Users/leo/scwrl4/Scwrl4'], stderr=subprocess.DEVNULL)

So I think that there should be a variable which specifies the executable, or at least an option to specify the path. Let me know your thoughts,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants