Discussion:
[Pyzo] Function debugging
Dietrich Pescoller
2016-09-21 09:14:43 UTC
Permalink
Debugging in IEP is quite confortable, with respect to others scientific
IDE's like Spyder for instance.

What is still missing (or maybe I do not know how to do) is the ability to
go into debug mode when you call a function from the shell, not with an F5.

How to do this?

many thanks for your suggestions.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Almar Klein
2016-09-22 08:29:42 UTC
Permalink
I am not sure what you mean. If you run code from the command line that calls into code that has breakpoints set in Pyzo, it will enter debug mode. Or do you mean to create a multi-line-command and wanting to step through it?

Regards,
Almar



From: Dietrich Pescoller
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dietrich Pescoller
2016-09-22 09:49:41 UTC
Permalink
Hi Almar,

I was quite (positively) surprised reading your email, and to hear that
breakpoints work also when you call from shell. So I did some basic tests
and
in fact you are right it works. So I went back to my use case and it didn't
work.
After some investigation I was able to systematically reproduce the
problem. I
try to explain here maybe you can reproduce it as well.

For instance if I do:

In [23]: import matplotlib.pyplot as plt
# look where the plt module is located
In [24]: plt.__file__
Out[24]:
'/home/diti/anaconda3/lib/python3.5/sitpackages/matplotlib/pyplot.py'

Then I open this file via the File -> open in the editor
then I search for the plot function and I put a breakpoint right after the
definition and I call it from shell:
In [25]: plt.plot()
Out[25]: []

The breakpoint is not working.

Knowing that it should work I did the following:
closed the file and opened like this
In [26]: %edit plt
(the file open is the same)
searching for the plot function, putting a breakpoint and again calling
from
shell
In [27]: plt.plot()

(plot)>>> DB STOP
Program execution stopped from debugger.

And Yeah it works!!!

So I don't know if this is expected behavior or a bug, in any case it is
fine
to know that it works, (since in scientific python IDE's debugging is not
as
comfortable as in Matlab and this is a little bit a stopper) but with IEP
we
are very close to and even better thanks to the postmortem debugger.

ps: What is still missing for IEP (from my point of view) to be the perfect
scientific IDE?

- PEP8 highlighting/suggesitons like spyder
- Column selection mode in the editor
Minor:
- it would be nice to have the shell detachable from the ide (i.e. Dock
widget)

Bye,
Dietrich
Post by Almar Klein
I am not sure what you mean. If you run code from the command line that
calls into code that has breakpoints set in Pyzo, it will enter debug mode.
Or do you mean to create a multi-line-command and wanting to step through
it?
Regards,
Almar
*From: *Dietrich Pescoller <javascript:>
*Sent: *21 September 2016 11:14
*To: *Pyzo <javascript:>
*Subject: *[Pyzo] Function debugging
Debugging in IEP is quite confortable, with respect to others scientific
IDE's like Spyder for instance.
What is still missing (or maybe I do not know how to do) is the ability to
go into debug mode when you call a function from the shell, not with an F5.
How to do this?
many thanks for your suggestions.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Almar Klein
2016-09-22 10:32:17 UTC
Permalink
Hi Dietrich,

Great that it works. Still strange that it did not work on the first try; It should not matter how you opened the file. If you find more info on when it works and when it does not, please let me know so that we can hopefully fix it.
Post by Dietrich Pescoller
PEP8 highlighting/suggesitons like spyder
There is an issue for that. Would love to have it. But have little time myself.
Post by Dietrich Pescoller
Column selection mode in the editor
Dito. Though this one is probably relatively easy for a contributor to implement once you’ve figured out how to do it in Qt.

- Almar

From: Dietrich Pescoller
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dietrich Pescoller
2016-09-22 11:22:37 UTC
Permalink
If try,
the example I described do you see the same behavior?

Bye,
Dietrich
Post by Almar Klein
Hi Dietrich,
Great that it works. Still strange that it did not work on the first try;
It should not matter how you opened the file. If you find more info on when
it works and when it does not, please let me know so that we can hopefully
fix it.
Post by Dietrich Pescoller
PEP8 highlighting/suggesitons like spyder
There is an issue for that. Would love to have it. But have little time myself.
Post by Dietrich Pescoller
Column selection mode in the editor
Dito. Though this one is probably relatively easy for a contributor to
implement once you’ve figured out how to do it in Qt.
- Almar
*From: *Dietrich Pescoller <javascript:>
*Sent: *22 September 2016 11:42
*To: *Almar Klein <javascript:>
*Cc: *Dietrich Pescoller <javascript:>; Pyzo <javascript:>
*Subject: *Re: [Pyzo] Function debugging
Hi Almar,
I was quite (positively) surprised reading your email, and to hear that
breakpoints work also when you call from shell. So I did some basic tests
and
in fact you are right it works. So I went back to my use case and it
didn't
work.
After some investigation I was able to systematically reproduce the
problem. I
try to explain here maybe you can reproduce it as well.
In [23]: import matplotlib.pyplot as plt
# look where the plt module is located
In [24]: plt.__file__
'/home/diti/anaconda3/lib/python3.5/sitpackages/matplotlib/pyplot.py'
Then I open this file via the File -> open in the editor
then I search for the plot function and I put a breakpoint right after the
In [25]: plt.plot()
Out[25]: []
The breakpoint is not working.
closed the file and opened like this
In [26]: %edit plt
(the file open is the same)
searching for the plot function, putting a breakpoint and again calling
from
shell
In [27]: plt.plot()
(plot)>>> DB STOP
Program execution stopped from debugger.
And Yeah it works!!!
So I don't know if this is expected behavior or a bug, in any case it is
fine
to know that it works, (since in scientific python IDE's debugging is not
as
comfortable as in Matlab and this is a little bit a stopper) but with IEP
we
are very close to and even better thanks to the postmortem debugger.
ps: What is still missing for IEP (from my point of view) to be the
perfect
scientific IDE?
- PEP8 highlighting/suggesitons like spyder
- Column selection mode in the editor
- it would be nice to have the shell detachable from the ide (i.e. Dock
widget)
Bye,
Dietrich
Post by Dietrich Pescoller
I am not sure what you mean. If you run code from the command line that
calls into code that has breakpoints set in Pyzo, it will enter debug
mode.
Post by Dietrich Pescoller
Or do you mean to create a multi-line-command and wanting to step through
it?
Regards,
Almar
From: Dietrich Pescoller
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Almar Klein
2016-09-24 12:13:08 UTC
Permalink
It works for me whatever way I open the file. Are you sure that you placed the breakpoint in the correct function?

BTW: you can also type “open plt.plot” to open the file at the correct location. Very convenient for situations like these.

Regards,
Almar



From: Dietrich Pescoller
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dietrich Pescoller
2016-09-26 17:28:57 UTC
Permalink
I retried again, and again it works now also on my machine.
But I'm pretty sure it was not working.
in any case I will keep an eye on this and if there is some news I will
report

For now all is good,
thanks
Post by Almar Klein
It works for me whatever way I open the file. Are you sure that you placed
the breakpoint in the correct function?
BTW: you can also type “open plt.plot” to open the file at the correct
location. Very convenient for situations like these.
Regards,
Almar
*From: *Dietrich Pescoller <javascript:>
*Sent: *22 September 2016 13:22
*To: *Pyzo <javascript:>
*Subject: *Re: [Pyzo] Function debugging
If try,
the example I described do you see the same behavior?
Bye,
Dietrich
Hi Dietrich,
Great that it works. Still strange that it did not work on the first try;
It should not matter how you opened the file. If you find more info on when
it works and when it does not, please let me know so that we can hopefully
fix it.
Post by Dietrich Pescoller
PEP8 highlighting/suggesitons like spyder
There is an issue for that. Would love to have it. But have little time myself.
Post by Dietrich Pescoller
Column selection mode in the editor
Dito. Though this one is probably relatively easy for a contributor to
implement once you’ve figured out how to do it in Qt.
- Almar
*From: *Dietrich Pescoller
*Sent: *22 September 2016 11:42
*To: *Almar Klein
*Cc: *Dietrich Pescoller; Pyzo
*Subject: *Re: [Pyzo] Function debugging
Hi Almar,
I was quite (positively) surprised reading your email, and to hear that
breakpoints work also when you call from shell. So I did some basic tests
and
in fact you are right it works. So I went back to my use case and it
didn't
work.
After some investigation I was able to systematically reproduce the
problem. I
try to explain here maybe you can reproduce it as well.
In [23]: import matplotlib.pyplot as plt
# look where the plt module is located
In [24]: plt.__file__
'/home/diti/anaconda3/lib/python3.5/sitpackages/matplotlib/pyplot.py'
Then I open this file via the File -> open in the editor
then I search for the plot function and I put a breakpoint right after the
In [25]: plt.plot()
Out[25]: []
The breakpoint is not working.
closed the file and opened like this
In [26]: %edit plt
(the file open is the same)
searching for the plot function, putting a breakpoint and again calling
from
shell
In [27]: plt.plot()
(plot)>>> DB STOP
Program execution stopped from debugger.
And Yeah it works!!!
So I don't know if this is expected behavior or a bug, in any case it is
fine
to know that it works, (since in scientific python IDE's debugging is not
as
comfortable as in Matlab and this is a little bit a stopper) but with IEP
we
are very close to and even better thanks to the postmortem debugger.
ps: What is still missing for IEP (from my point of view) to be the
perfect
scientific IDE?
- PEP8 highlighting/suggesitons like spyder
- Column selection mode in the editor
- it would be nice to have the shell detachable from the ide (i.e. Dock
widget)
Bye,
Dietrich
Post by Dietrich Pescoller
I am not sure what you mean. If you run code from the command line that
calls into code that has breakpoints set in Pyzo, it will enter debug
mode.
Post by Dietrich Pescoller
Or do you mean to create a multi-line-command and wanting to step through
it?
Regards,
Almar
From: Dietrich Pescoller
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Pyzo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyzo+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...