Commit Graph

29 Commits

Author SHA1 Message Date
Martin Chase a6bb2c6edd
Allow ThreadTrace to save to a file (#1998)
* allow ThreadTrace to save to a file

* make sure we close our output file

* fix the egregious errors in the file
 - no mutable default args
 - import things before using them
 - variable named obj did not exist, but try/except ignored it

* if it's dumb, and it works, it's not dumb

* linux requires a flush; remove commented code

* always close the file handle, even if its stdout

* it may work for us, but just in case, protect with finally

* turns out: lots of things like to use stdout!

Co-authored-by: Luke Campagnola <lukec@alleninstitute.org>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-10-07 12:25:38 -07:00
Ogi Moore d396d33799
Remove the use of pyqtgraph.ptime (#1914)
* Remove the use of pyqtgraph.ptime

With us supporting python3.7+, we have no more need for the ptime module
and can instead safely use perf_counter for everything.

* Address small issues PR turned up

* Reword comment in ImageView
2021-07-22 20:57:50 -07:00
Ogi Moore f01f3d473f Have debug.printExc emits RuntimeWarning
Several bugs have snuck through due to being wrapped with printExc,
which would prevent the exception from raising, but printing the trace
to the console.  In pytest, this output is not captured at all, and is
invisible unless the -s parameter is added.

This PR changes the print statement to a runtime warning, which pytest
will capture.
2021-05-31 21:06:16 -07:00
Ogi Moore 3ea92736b8 Do not use list comprehensions with any or all
python any and all are able to break early the moment they come across a
member of the iterable that meets the condition; but having a list
comprehension nested within breaks that ability to exit early, as the
list comprehension has to finish being constructed first before it can
be evaluated
2021-04-23 22:43:57 -07:00
Ogi Moore 52de9554bb Emit warning about pyside2 bug preventing loading 2021-04-15 22:50:16 -07:00
Gianfranco Costamagna 32a79f18a4 sip: switch to new PyQt5 api import, with fallback to the old implementation if not found.
Also calls to setapi are not needed anymore, so use them only with the old implementation.

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966045
for reference
2020-07-27 14:52:07 +02:00
Luke Campagnola 893c85053f debug.ThreadTrace add support for thread names 2020-07-13 12:50:24 -07:00
2xB 8d2c16901b Merge master into develop (#981)
* Information is spelled with an r, even in comments
2019-08-16 20:16:01 -07:00
Luke Campagnola a86ab30578 fix iteritems 2018-05-15 16:37:20 -07:00
Luke Campagnola 7593d4ea83 fix Profiler when called from top of stack 2018-04-25 15:07:21 -07:00
Luke Campagnola e06fc101f5 Add function to enable faulthandler on all threads 2017-09-13 22:13:50 -07:00
Luke Campagnola c7923d3f95 Fix parameters sending 'children' key to setOpts on restoreState (fixes error seen in relativity demo)
Add debug replacement for sys.excepthook that prints full stack trace
2016-10-14 18:38:35 -07:00
Luke Campagnola 0976991efd Import from python2_3 for all uses of basestring, cmp, and xrange 2015-05-19 09:29:55 -04:00
Luke Campagnola be1ed10d9a Better thread tracing in debug.py 2015-05-12 11:14:02 -04:00
Luke Campagnola 753ac9b4c4 Squashed commit of the following:
commit ca3fbe2ff9
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Thu Aug 7 08:41:30 2014 -0400

    Merged numerous updates from acq4:
    * Added HDF5 exporter
    * CSV exporter gets (x,y,y,y) export mode
    * Updates to SVG, Matplotlib exporter
    * Console can filter exceptions by string
    * Added tick context menu to GradientEditorItem
    * Added export feature to imageview
    * Parameter trees:
        - Option to save only user-editable values
        - Option to set visible title of parameters separately from name
        - Added experimental ParameterSystem for handling large systems of
            interdependent parameters
        - Auto-select editable portion of spinbox when editing
    * Added Vector.__abs__
    * Added replacement garbage collector for avoiding crashes on multithreaded Qt
    * Fixed "illegal instruction" caused by closing file handle 7 on OSX
    * configfile now reloads QtCore objects, Point, ColorMap, numpy arrays
    * Avoid triggering recursion issues in exception handler
    * Various bugfies and performance enhancements
2014-08-07 09:03:26 -04:00
Luke Campagnola 6b66edfd46 Added Travis CI support
Fixed bugs / style issues to please Lord Travis

Squashed commit of the following:

commit f25048a1e1
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:40:47 2014 -0400

    syntax

commit cc8b69695a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:36:49 2014 -0400

    add size check, diff style check

commit 5d5ea065a4
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:16:05 2014 -0400

    travis fix

commit b154c6d997
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Sun Mar 30 02:09:41 2014 -0400

    travis, flake colored output

commit 46921dcd87
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 12:37:54 2014 -0400

    fix pyside+py3 bugs to satisfy CI

commit 1d30f3c5c7
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 11:13:18 2014 -0400

    fix py3 tests

commit 426578fa4c
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 07:39:19 2014 -0400

    fix pytest install

commit 88a13c1a71
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 00:29:29 2014 -0400

    qt5 updates

commit 51995488cc
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Wed Mar 26 00:16:04 2014 -0400

    correct py.test command for py3

commit e2b02fbcbd
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:50:38 2014 -0400

    fix 2nd install test

commit 4b3e3ee04a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:31:31 2014 -0400

    syntax error

commit 250eabdb34
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 23:13:42 2014 -0400

    look for py.test3

commit 9f9bca47c1
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:54:19 2014 -0400

    fix syntax

commit 0a871c6f36
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:47:58 2014 -0400

    output pip build log

commit dbce58d8cd
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 22:38:55 2014 -0400

    no comments allowed between shall lines

commit b79c06121d
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 20:56:35 2014 -0400

    another pip try

commit 09f4f5d82a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 13:36:09 2014 -0400

    pip correction

commit 0eedb5c18e
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 13:29:00 2014 -0400

    correct py version output

commit d9fd039be2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 11:55:43 2014 -0400

    apt checks

commit cf95ccef86
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Tue Mar 25 10:23:10 2014 -0400

    alternate pip install method

commit bee0bcddfe
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:51:45 2014 -0400

    correct deps install

commit 963a4211fc
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:47:30 2014 -0400

    fixes

commit 0c86cd1dc2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:31:06 2014 -0400

    permission fix

commit 5d04ef53b8
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:30:19 2014 -0400

    Fix py.test version selection

commit b0e6c7cb94
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:25:34 2014 -0400

    try another pyqt5 install method

commit 422a792866
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:12:36 2014 -0400

    syntax error

commit 533133905a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 23:04:37 2014 -0400

    fixes

commit 8d65211ba4
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:40:18 2014 -0400

    Add Qt5 test
    minor fixes

commit 4484efaefe
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:31:56 2014 -0400

    use correct py.test for python version

commit 5d2441a29b
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 22:24:27 2014 -0400

    add setup tests

commit 9291db64f2
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:48:43 2014 -0400

    fix py3-pyqt install

commit a7aa675c5a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:31:33 2014 -0400

    travis tests

commit e71cd2b23a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 21:17:15 2014 -0400

    more corrections

commit 527df3bca8
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 20:56:01 2014 -0400

    travis corrections

commit 87d65cac4a
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 20:48:02 2014 -0400

    Add flake tests
    Correct style in a few files to please Lord Travis

commit 537028f88f
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:36:24 2014 -0400

    minimize pyside package install
    correct line endings to satisfy Lord Travis

commit 1e3cc95e37
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:23:03 2014 -0400

    enable pyside, line ending check
    fix test

commit d7df4517f9
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:12:06 2014 -0400

    syntax fix

commit 1ad77a2155
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 17:00:30 2014 -0400

    alt. pytest install

commit 5edcc02072
Author: Luke Campagnola <luke.campagnola@gmail.com>
Date:   Mon Mar 24 16:52:33 2014 -0400

    Added initial travis.yml
2014-03-30 02:51:32 -04:00
Luke Campagnola bc57d5a6af Minor corrections to debug.Profiler 2014-03-24 11:18:56 -04:00
Luke Campagnola 79cfd3601e Rename Mutex module 2014-03-14 18:00:29 -04:00
Luke Campagnola 89c04c8a81 Corrected bug in multiprocess causing deadlock at exit
Multiprocess debugging messages now use one color per process
Corrected RemoteGraphicsView not setting correct pg options on remote
process

New debugging tools:
* util.cprint for printing color on terminal (based on colorama)
* debug.ThreadColor causes each thread to print in a different color
* debug.PeriodicTrace used for debugging deadlocks
* Mutex for detecting deadlocks
2014-03-14 14:18:46 -04:00
Luke Campagnola ff697ce492 Expanded capabilities of interpolateArray function to support broadcasting 2014-03-11 13:13:33 -04:00
Luke Campagnola c72638ab1b Merge branch 'tommy3001-doc-updates' into develop
Conflicts:
	pyqtgraph/graphicsItems/AxisItem.py
	pyqtgraph/graphicsItems/PlotDataItem.py
	pyqtgraph/graphicsItems/ROI.py
2014-02-28 21:07:43 -05:00
tommy3001 92d7bbe18e In list tables "**Arguments**", "Arguments:" changed to **Arguments:** 2014-02-03 21:13:10 +01:00
Luke Campagnola 5b7f4124d9 * Made new profilers compatible with old API
* Adjusted output formatting for clearer representation of nested profilers
* Message string formatting deferred until finish to reduce overhead
2013-12-15 09:07:09 -05:00
Antony Lee f136b33033 Profilers controllable via PYQTGRAPHPROFILE.
A new function profiling system is implemented.  Most importantly, this
allows one to profile various internal functions directly by setting the
`PYQTGRAPHPROFILE` environment variable to a comma separated list of
function and method names, e.g.

    PYQTGRAPHPROFILE=functions.makeARGB,ImageItem.render \
        python -mexamples

Specifically, items in `PYQTGRAPHPROFILE` must be of the form
`classname.methodname` or `dotted_module_name.functionname`, with the
initial "pyqtgraph." stripped from the dotted module name.

Moreover, the overhead of inactive profilers has been kept minimal: an
introspective check of the caller's name (only if `PYQTGRAPHPROFILE` is
set) and a trivial function (not method) call per profiler call.

The new profilers rely on `sys._getframe` to find the caller's name,
although the previous system (passing the caller's name explicitely)
could certainly have been kept instead.

Finally the API of profilers has been changed: register a
profiling point simply by calling the profiler, and profilers are
automatically flushed on garbage collection.  See the docstring of
`pyqtgraph.debug.Profiler` for more details.
2013-11-27 09:57:46 -08:00
Luke Campagnola 8c13a3e7e3 copy from acq4 2013-07-03 11:20:49 -04:00
Luke Campagnola 4c887c8f50 Merge new fixes and features from acq4 2013-02-10 14:10:30 -05:00
Luke Campagnola c5dd0f4f63 Fixed print statements for python 3 2013-01-12 14:35:32 -05:00
Luke Campagnola 01b8968a0a Performance improvements:
- AxisItem shows 2 tick levels instead of 3
  - Lots of boundingRect and dataBounds caching
    (improves ViewBox auto-range performance, especially with multiple plots)
  - GraphicsScene avoids testing for hover intersections with non-hoverable items
    (much less slowdown when moving mouse over plots)
These are deep changes; need good testing before we release them.
2013-01-09 22:21:32 -05:00
Luke Campagnola af59296231 Reorganized directory structure to be more standard
Started new SVG exporter
Merged updates from ACQ4
2012-12-25 00:43:31 -05:00