djgroen / FabSim3

Python 3 version of FabSim
BSD 3-Clause "New" or "Revised" License
25 stars 13 forks source link

Avoiding misunderstandings in plugin installation #296

Open jomichaelis opened 2 days ago

jomichaelis commented 2 days ago

When installing a FabSim3 plugin, the command to do so is:

fabsim localhost install_plugin:FabDummy

This indicates FabSim3 to install the plugin FabDummy on the local machine - so far so good.

However, the command does exactly the same when specifying a different machine:

fabsim lumi install_plugin:FabDummy

This also installs the plugin FabDummy on the local machine, as the machine keyword is not taken into account at all. For a new user, this is confusing, as he/she is not notified with a warning - instead the installation just executes successfully on the local machine.

Suggestion

I see two approaches to avoid misunderstandings here. Eiter, a call to the task install_plugin is only allowed with the machine being localhost, i.e. printing an error to stdout when doing differently. Or the install_plugin-command does not require any machine to be defined, as it is the case for fabsim -l/--list tasks/machines already.

The effort for the latter is for sure higher, although it would be the best solution in my eyes. Please feel free to correct me if I'm wrong here, this is nothing but a suggestion for improved usability of FabSim3.

I'm happy to implement the change as soon as we agree on the issue and its way to fix it :)

djgroen commented 2 days ago

Hi @jomichaelis

Thank you for raising this, and I agree this is a good point!

I have a slight preference for the former solution (throwing a clear error if the machine given is not localhost), as I am aware that @arabnejad is doing a pip-related refactoring job, and the former change would be less intrusive in the code.

Would you perhaps be willing to insert the error reporting?

jomichaelis commented 2 days ago

Absolutely, I am happy to do so! Thank you for your fast response!