Make ase,mdtraj and MDAnalysis optional extras#1254
Conversation
|
Could we change the behaviour so the corresponding jobs are still listed in the GUI, but are not enabled if their underlying Python package is not installed? This would prevent the situation where a new user never realises that they had the option of installing external packages. What do you think? |
|
This is exactly what Chi said, so it seems like a popular option. Do we want to change |
|
At the moment the On the GUI side, it should be possible to run |
| return | ||
|
|
||
| if not job_instance.enabled: | ||
| widget = QLabel(f"""<h1>Job {job_name} not available.</h1> |
There was a problem hiding this comment.
@oerc0122 @ChiCheng45 What phrasing do we prefer for this message?
I would consider emphasising in the text that the whole thing is optional, so the users don't wonder why we did not include the required dependency to start with. Something like:
widget = QLabel(f"""<h1>{job_name} requires an external package.</h1>
<h2>The following optional dependencies of MDANSE are needed here: {", ".join(job_instance.requires_extras)}.</h2>
<h2>If you want to use {job_name}, please install the additional dependencies, e.g. by running:</h2>
<h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2>
""")
Anyway, I'm also happy with the current version (especially since it tells the user what to do to enable the job).
| widget = QLabel(f"""<h1>Job {job_name} not available.</h1> | ||
|
|
||
| <h2>Please install MDANSE with the following extras enabled: {", ".join(job_instance.requires_extras)}.</h2> | ||
|
|
||
| <h2>To do this, install using, e.g.:</h2> | ||
|
|
||
| <h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2> |
There was a problem hiding this comment.
I would probably combine the two to make:
| widget = QLabel(f"""<h1>Job {job_name} not available.</h1> | |
| <h2>Please install MDANSE with the following extras enabled: {", ".join(job_instance.requires_extras)}.</h2> | |
| <h2>To do this, install using, e.g.:</h2> | |
| <h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2> | |
| widget = QLabel(f"""<h1>{job_name} requires an external package.</h1> | |
| <h2>Please install MDANSE with the following | |
| optional dependencies enabled: | |
| {", ".join(job_instance.requires_extras)}.</h2> | |
| <h2>To do this, install using, e.g.:</h2> | |
| <h2><b>pip install "mdanse[{",".join(job_instance.requires_extras)}]"</b></h2> |
Description of work
Remove explicit dependency on optional external projects.
Fixes
visiblelabel toConfigurables to enable visibility without working.requires_extrastuple to display a useful error message to users for disabled jobs.To test
Try GUI, ensure jobs are disabled. Ensure tests pass.