-
Notifications
You must be signed in to change notification settings - Fork 17
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
Change on Python Basic Console not transferred to tools #2446
Comments
This is not a bug but a feature. The Python interpreter (and Julia Executable) settings in File->Settings->Tools are just the default settings for new Tool specifications. This is mentioned in the User Guide and in the File->Settings->Tools tooltips. However, we could add a button into the Tool Specification Editor that automatically updates the execution settings into the default settings defined in File->Settings->Tools. |
If this is a feature, it makes sharing workflows unpleasant, since each user needs to update a workflow (possible large workflow comprising dozens of tools) manually. I suggest a button on the workflow level allowing to "update basic console" in all comprising tools. To be more precise what my issue is: Currently, users need to follow these instructions to accomplish this... which is rather annoying. Thus, the "update console" process should be as easy as possible. |
This is a good idea. There is however a little bit simpler option available. You could try running the Tool Specs with the Jupyter Console option. There is a section in the user guide on how to do this. https://spine-toolbox.readthedocs.io/en/master/setting_up.html#conda When you have created the AMIRIS Conda environment, you could simply instruct users to:
But this is not ideal and it would be a lot simpler with your suggestion. |
…gs for Julia and Python Tools in the current project Re #2446
…l Specifications (#179) In addition, add 'restore defaults' button to Tool Spec Editor for Python and Julia Tool specs Re spine-tools/Spine-Toolbox#2446
I added two buttons to Settings->Tools widget. The upper one sets all Julia Tools in the current project to use the execution settings that are defined on the same page (Basic/jupyter Console, Julia executable path, Julia env, and kernel. The lower button does the same for all Python tools in the current project. There's also a new button in the Tool Spec Editor, which does the same for individual Tool Specs. The button is disabled (grayed out) if the current selections match the default settings defined in Settings->Tools. This is in |
Very cool! Thank you, that is super useful for our case. |
After being hit with the same issue, I think the behavior and the "broadcast" buttons are confusing. The fact that the Python interpreter in Settings only affects new Tool specifications is not really what I would expect and the "broadcast" button is difficult to discover. I suggest the following behavior:
This way we can drop the "broadcast" buttons in Settings and the Restore defaults button in Tool specification editor as clearing the Interpreter field will do the same. |
It's not that simple. Consider, what happens in the following case.
There are two options:
TLDR: |
B would use the Julia in Settings, i.e. same Julia a A <somejulia/bin/julia.exe>
But that is what global settings are supposed to do. If you want to lock B's interpreter, then you set in the specification. You use 'no interpreter set' to say "I am happy with whatever is in Settings." |
I guess that makes sense. It's possible that I was overthinking the issue. |
There could be a way to set the interpreter/executable/shell for multiple specifications at once but I think it should be separate from the Settings window. |
I would argue differently. Especially for Python, a each project is likely to have its own interpreter path. Therefore, I think if you really use spine-toolbox in mutliple projects, these python and julia defaults should be stored and controllable on a "per project" basis. I, for myelf only have one toolbox project,so I don't mind personally, but other users might benefit from such a "hierarchy": general default <-> project default <-> tool-specific settings |
Agreed. We should have Project-specific settings, too. |
In a perfect world, each tool would know what they need (requirements file). We could then check if the environment satisfies the requirements - if not, we could offer to setup a new clean environment and install requirements. Or optionally upgrade current environment, but there one needs to be careful, because that environment might be used for other things too. We also want all of this hard installation part to be on the shoulders of workflow developers - not workflow users. So, this relates: #2554 As you can see, I'm bit vary of global and project defaults - I don't want to say they are all bad, but I'm afraid they may lead to trouble down the road (e.g. you change your global environment and things break). |
resolve_python_interpreter() has now been refactored into two functions: resolve_current_python_interpreter() returns the current Python executable while resolve_python_interpreter() returns returns the interpreter set in application settings. Re spine-tools/Spine-Toolbox#2446
resolve_julia_executable() has now been refactored into two functions: resolve_default_julia_executable() returns the Julia executable from PATH and resolve_julia_executable() returns returns the executable set in application settings. Re spine-tools/Spine-Toolbox#2446
Tool specifications now always use the global Python interpreter from settings so we do not need to explicitly broadcast it to specifications. Re #2446
Tool specifications now always use the global Julia executable from settings so we do not need to explicitly broadcast it to specifications. Re #2446
We now always use the global interpreter/executable from application settings if none is excplicitly set in Tool Specification. Re spine-tools/Spine-Toolbox#2446
I am happy with how the interpreter/executable global settings work. |
Description
If I change the Basic Console under File -> Settings -> Tools -> Python, these changes do not take effect in tools of the project workflow. Instead, I would have to open each Python-based tool in the *Tool specification editor", change the Tool type to, e.g., Julia, then change back to Python - only now will the Interpreter be updated to the one specified in the settings.
To reproduce
Setup
Python: 3.9
spinetoolbox-dev: 1.0a1
spinetoolbox: 0.8.0.dev9+g24d07cef.d20231201
The text was updated successfully, but these errors were encountered: