Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
PR: Add new "Plotting library" option, defaulting to Matplotlib (Variable Explorer) #20075
base: master
Are you sure you want to change the base?
PR: Add new "Plotting library" option, defaulting to Matplotlib (Variable Explorer) #20075
Changes from 3 commits
59790c0
2815e53
9a4fb33
77cd909
cc04605
931f698
c2f51ce
7adeece
2b75726
a293df4
dc8001d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these names should be capitalized to look good in our Preferences. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both library logos display their names in all lowercase, so I would suggest not bothering with capitalizing them, hence simplifying code (key == value, as for the combo box management).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function returns
None
if no library is available, which I think wouldn't look good in our Preferences. So, perhaps it should returnMatplotlib
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that's not a problem because if there is no library available, the combo box won't be displayed in Preferences: combo box is added to Preferences page only if
plotlib.AVAILABLE_PLOTLIBS
is not empty. But I realize that it's not a good idea because even ifplotlib.AVAILABLE_PLOTLIBS
is empty, that does not mean that the IPython kernel won't have the library installed. So I'm rolling back on this.And there is another problem: I've just did some tests and apparently Spyder Preferences do not handle well dynamic choices in combo boxes: if the choices are not the same as the previous run, the displayed choice in Preferences page will be changed but won't be considered as a new value when validating the dialog box. In other words, in that last case and if the list of choices is reduced to a single choice, it won't be possible to select the one and only choice available by validating the Preferences page...
So, I'm rolling back and proposing a static list for plotting libraries in the Preferences page. This should have some impact on other modules. I'll see about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 7adeece
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improve formatting and message a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding code formatting, you really should consider using Black and force everyone contributing to do so. At work, all my teams are using Black together with isort with proper configuration (I gradually imposed this on all projects since 2018). CodraFT is an example of project following standard guidelines in terms of code quality.
Using (and forcing all contributors to use) Black saves time, increases code quality and helps focusing on real code changes (instead of being annoyed with code appearance).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I push this further? (by integrating Black into Spyder for example?)