-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: Fix saving variables as .spydata if no file extension is given #17790
Conversation
d4b1669
to
63b315c
Compare
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.
Thank you @maurerle for helping with this! I left a comment requesting some changes (adding a comment to reference the issue and the variable to validate the extension), otherwise this LGTM 👍
As a side note, seems like the original issue post will be addressed with this PR but the root cause discussed there will not (i.e the lack of extensions when using the QFileDialog
on Linux: #7196 (comment))
So, should we create a new issue to check that in the future, even maybe that could be something to do on QtPy? What do you think @ccordoba12 ?
63b315c
to
c91c218
Compare
Hi @maurerle if is okay for you if we add here a commit with the changes to address the minor comments left in the review to proceed with this and merge it? Let us know! |
Ouch. I did not see your review somehow. |
Hi @dalthviz, I also renamed the other ext variable in this file for consistency. |
Thank you @maurerle ! Edit: |
- removed failing filename option
- rename ext variable to more explicit extension - rename ext in iimport_data to extension too for consistency - add comment for related issue spyder-ide#7196
31136ab
to
a9a3fb4
Compare
I rebased (which hopefully fixes the tests) and fixed the linting by looking at how other occurances of too long lines are handled. |
Thank you so much @maurerle ! |
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.
Thanks @maurerle ! LGTM 👍🏼
Description of Changes
While this does not fix the major file save dialog problems mentioned in #7196 it allows to save the workspace in a pickle file without finding out which extension is needed.
Currently,
.mat
and.spydata
is supported to write data, and it makes sense to prefer.spydata
here.I also removed the filename option from the save method, as it is never used.
If the method would be called with
filename='text.spydata'
it would anyway save asself.filename
which would be wrong.So I hope it is fine to remove the optional parameter.
Thank you!
Issue(s) Resolved
Fixes #7196
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: Florian Maurer