-
Notifications
You must be signed in to change notification settings - Fork 1
Improving the Subplots Tool #4
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
Improving the Subplots Tool #4
Conversation
…, before filling it with tools. Added a nice utility API function, Navigation.addTools.
@@ -464,6 +469,7 @@ def destroy(self, *args): | |||
def show(self): | |||
# show the figure window | |||
self.window.show() | |||
self.window.present() |
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.
The only real change in functionality that I can see I have made, but logically this feels right to me, that show
should always bring the window to the front, whether or not it had already been opened or not. Though feel free to disagree.
I like the idea, but I think it would be better to do it after the Plt/GFC refactor. I'm sorry but I will have to pass on this one, it is tempting to do it now, but the more changes we do, the less probable for the PR to be accepted. |
I understand and agree with your comments, I had those concerns also, but the large number of deletions (and very few insertions) to the backend (gtk3) swayed me, together with the comment by @tacaswell matplotlib#2624 (comment) Do you have any idea how long until the Ptt/Gcf refactor will come out? I.e. do you think it will make it out before more backends get converted? And yes, I really want to see your navigation thing go through (though I do have a few more suggestions to make). One last thing, if in the future this does go though, I have one more modification to this PR to commit. |
I have no idea when the Plt/Gfc refactor will come out. |
If you want, just make the change to his PR, so the idea is not lost. |
1ce296c
to
aa76457
Compare
@OceanWolf do you mind rebasing this PR? I want to take another look |
I don't get this rebase, it says I have merge errors in files I haven't touched, i.e. |
Are you rebasing against my branch? or against master? Actually what I was trying to do to resolve the problem was to remove my modifications to that file from the repository, but messing with history is dark magic. So, what I recommend is just open the file, and resolve the conflict removing my part that is in conflict |
Yes, against your branch.
It gives me warnings about 5 lines containing whitespace errors and fails to merge Should I try and delete my branch locally and rebranch from And remove the Tk work? Updating the Tk work comes as the next task on my hit list of PRs, i.e. after my internal meddlings. |
I wanted to remove the Tk work and leave it for when the main PR is accepted, but honestly I didn't know how to do it. |
Regarding the rebase, I find that sometimes it is easier to just create a new branch, instead of trying to keep up with conflicts like this. |
Yes, I think I will make a new branch, while the commits/files changed looks a mess on github, naturally as I haven't rebased, it looks fine locally. I wonder if I should do the following (even wondering if it will work):
i.e. the aim of pushing back to this PR, but with a new fresh history. And yes, I completely agree with you on not working on Tk while developing internal mechanics, it makes no sense with it all in flux, though as I say, I see that stage as almost over, then I see no reason why not to get Tk patched up. Both because of external mechanics, i.e. with specific tools, I want to see if they will work on both backends; and because it feels nice to have a fully polished PR to show to the owners, the (i.e. not a, |
@OceanWolf Do you mind to give it a try to rebase or recreate this PR? I am interested in your work on the window stuff, I am pretty sure I will need this for my multifiguremanager |
Sure, I really want to give this a rebase ASAP, but first I want to get the window stuff redone, as this subtool basically added some nasty hacks because of the lack of a I haven't done anything weird with the code, all fully backwards compatible, just like MEP22. But unlike MEP22, a pure refactor, no change in behaviour, no extra features, so I think/hope it will get accepted quite easily. Interested in your comments, but please put them into that PR, I would like to keep comments as concentrated as possible. Also note that the closer the code lies to the backends, the more likely it will change as I refactor more backends. Hoping to get Tk finished today, very nearly done :). |
Naturally once I have completed this refactor, if it looks like it will take a while to get the thumbs up, then I shall move on to this regardless, but I would like to get refactored window code sitting there first. |
a88dc2d
to
5eae4e1
Compare
MNT: use IPython's signature if needed + available
This fixes some possible heap buffer overflows, such as the following triggered by our cmmi10.ttf: ``` ERROR: AddressSanitizer: heap-buffer-overflow on address 0x617000235709 at pc 0x7f95efd3c48a bp 0x7ffe41b6ecc0 sp 0x7ffe41b6ecb0 READ of size 1 at 0x617000235709 thread T0 #0 0x7f95efd3c489 in utf16be_to_ascii extern/ttconv/pprdrv_tt.cpp:178 #1 0x7f95efd3c489 in Read_name(TTFONT*) extern/ttconv/pprdrv_tt.cpp:339 #2 0x7f95efd499ef in read_font(...) extern/ttconv/pprdrv_tt.cpp:1325 #3 0x7f95efd4c602 in get_pdf_charprocs(...) extern/ttconv/pprdrv_tt.cpp:1420 #4 0x7f95efd35c22 in py_get_pdf_charprocs src/_ttconv.cpp:217 0x617000235709 is located 1 bytes to the right of 648-byte region [0x617000235480,0x617000235708) allocated by thread T0 here: #0 0x7f9612262a38 in __interceptor_calloc (/usr/lib64/libasan.so.4+0xdea38) #1 0x7f95efd3b261 in GetTable(TTFONT*, char const*) extern/ttconv/pprdrv_tt.cpp:140 ```
Okay, I have now basically achieved what I wanted to, but I have dirtied the
lib/matplotlib/backends/backend_gtk3.py
a bit, but I guess the not so nice bits will get tidied up by the Backend Plt/Gcf refactor.Anyway, what do you think? I see a lot of the code in
ToolConfigureSubplots
getting refactored out into a separate dialog class; also I see the separation of the two tasks ofFigureManager
, the window logic, and the figure logic into two separate class (and thus undirty it), but I guess that will happen as part of the Gcf refactor...