spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.33k stars 1.61k forks source link

Panes size on the right can't be reduced due to date label in Profiler and Code Analysis #12310

Open kaleb-keny opened 4 years ago

kaleb-keny commented 4 years ago

Issue Report Checklist

Problem Description

Some issue has been bugging me with Spyder 4, is that a certain point I cannot decrease the size of the variable explorer window tab, with the tab where the code being too small to read the code.

What steps reproduce the problem?

  1. Happens usually when I have a lot of variables in the variable explorer tab
  2. I increase its size, cannot decrease it back

What is the expected output? What do you see instead?

Ability to shift the variable tab more to the right of the screen (i.e. decrease it's width). As you see in the picture below, basically the width of the variable explorer tab is almost as big as that of the code tab and this cannot be decreased (by pulling the separator to the right).

image

Paste Traceback/Error Below (if applicable)


NA

Versions

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.2 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.3 (OK)
sphinx >=0.6.6                 :  2.4.4 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  0.29.15 (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.3 (OK)
scipy >=0.17.0                 :  1.3.1 (OK)
sympy >=0.7.3                  :  1.5.1 (OK)
ccordoba12 commented 4 years ago

@steff456, please take a look at this one to see if you can reproduce it.

kaleb-keny commented 4 years ago

@steff456 maybe to help in replicating this, if you open a fresh .py file, you can drag the separator to the the far right of the screen, but if you're on a old .py file with a lot of code already written in it there is a constrained limit as to how far you can pull the separator to the right. But today I find out a way to reset this limit, is doing a reset to the default layout.

steff456 commented 4 years ago

I'm not able to reproduce this issue, even if I create more than 1000 long name variables with a very long string.

variable-eplorer

kaleb-keny commented 4 years ago

As I noticed, it's less related to the length of variable names, and more related to having a spyder project that automatically saves a layout and reloads whenever you load the project. Like one instance I was able to see this is that if I open a new .py file I can slide left right normally. Switching the focus on one of the py files of a old project, the slider jumps to the last project related position and cannot be dragged all the way to the right. But in any case, I managed to have this dealt with using the reset to default layout option... So because it is hard to replicate, we can close this issue, unless others raise it?

kaleb-keny commented 4 years ago

Managed to get the issue again Sample

kaleb-keny commented 4 years ago

And this after resetting the layout SampleAfterReset_2

steff456 commented 4 years ago

As I noticed, it's less related to the length of variable names, and more related to having a spyder project that automatically saves a layout and reloads whenever you load the project. Like one instance I was able to see this is that if I open a new .py file I can slide left right normally. Switching the focus on one of the py files of a old project, the slider jumps to the last project related position and cannot be dragged all the way to the right. But in any case, I managed to have this dealt with using the reset to default layout option... So because it is hard to replicate, we can close this issue, unless others raise it?

Can you please give me more detail of how to replicate this issue, are you working in a project? Which changes did you do to the layout? If you can give me a step by step of how do you get the error will be amazing :)!

kaleb-keny commented 4 years ago

Well honestly I did not touch the default spyder layout... Yes I'm working on project linked to my github desktop somehow, I did not touch the layout at all. Honestly I don't know how to replicate it everytime, because I notice that it became this way all of a sudden. So probably I'm running a lot of code and some of the code involves printing pandas and lists in the console, maybe an overloaded console does this? I'll keep my eye on this, but I'm thinking that next time this happens (which is probably soon), I can try to save the layout maybe share it across

kaleb-keny commented 4 years ago

Ok I believe I know the cause now, basically, mid-way writing some code I press accidentally F10, and it opened this and caused the seperator to be stuck image

File "C:\Users\Lenovo_student\Anaconda3\lib\site-packages\spyder\plugins\profiler\widgets\profilergui.py", line 267, in self.finished(ec, es)) File "C:\Users\Lenovo_student\Anaconda3\lib\site-packages\spyder\plugins\profiler\widgets\profilergui.py", line 335, in finished self.show_errorlog() # If errors occurred, show them. File "C:\Users\Lenovo_student\Anaconda3\lib\site-packages\spyder\plugins\profiler\widgets\profilergui.py", line 240, in showerrorlog readonly=True, size=(700, 500), parent=self).exec() TypeError: init() got an unexpected keyword argument 'size'

ccordoba12 commented 4 years ago

Ok I believe I know the cause now, basically, mid-way writing some code I press accidentally F10, and it opened this and caused the seperator to be stuck

This error is already fixed and it'll be part of our next version (4.1.3) to be released at the end of the month.

kaleb-keny commented 4 years ago

Hi @ccordoba12 , I just updated to 4.1.3 and the issue is still there, where the seperator is getting stuck and the right most pane of spyder is taking up a lot of the space and can't be shifted anymore... But on the positive side, when pressing F10 I am not getting an error anymore. So do you prefer I open a new issue or would you want to reopen this one?

goanpeca commented 4 years ago

Hi @kaleb-keny, sorry to hear the issue is still there. Will reopen.

Question: is this happening when using projects only, or without projects you have seen the issue?

Cheers!

kaleb-keny commented 4 years ago

Hi thanks for reopening the issue, it occurs in both projects and without projects... It is quite annoying for me because I tend to use the F9 a lot and I often press F10 by mistake

goanpeca commented 4 years ago

Will try to check to see if we can reproduce it. Will need to launch the windows VM :-)

kaleb-keny commented 4 years ago

Let me know if I can help, thanks for having a look

goanpeca commented 4 years ago

@kaleb-keny tried for a while opening and closing projects and trying F9 and F10, but I cannot see the behavior. Are you using full screen mode? multiple monitors? anything "peculiar" in your setup?

bcolsen commented 4 years ago

@kaleb-keny I can reproduce this. The work around is to close the profiler pane. Go to view->panes->uncheck "profiler". Of course if you accidentally hit F10 it will open the profiler pane again. You could also change the profiler hotkey. Also consider code cells instead of running lines: https://docs.spyder-ide.org/editor.html#defining-code-cells

I guess the fix for this would be to decrease the minimum width of the profiler pane if possible.

kaleb-keny commented 4 years ago

@bcolsen you are right, indeed as you mentioned closing the profiler pane does the trick... Thanks for pointing it out. Definitely your solution would work. Yeah I use code cells all the time...

@goanpeca I guess then the issue is that the width of the profiler pane has a fixed minimum that is much larger than that of the other panes on the right, and therefore taking up a lot of the space on the screen. So to reproduce just pressing F10 should bring up the profiler pane that takes more of the space of the screen... For your questions, I wasn't using full screen mode, although using it the behavior still takes place, single monitor laptop with out of the box anaconda installation with the default specs.

kaleb-keny commented 4 years ago

@bcolsen I just changed the hotkey, the most obvious solution lol thanks a lot for pointing it out... Yeah I understand now what you meant by using the code cells, yeah I use them all the time, but in certain instances and I just want to know what this line exactly does... hence the use of F9... But thanks for the help, I believe your suggestion of just changing the shortcut is what I was looking for really...

goanpeca commented 4 years ago

Thanks @bcolsen for nailing this.

Glad you found a workaround @kaleb-keny 😅

We should probably provide the same minimum (reasonable) width for all plugins to avoid running into this issue in the future and with other layout configurations.