Commit 8f638776 authored by Luke Campagnola's avatar Luke Campagnola
Browse files

PyQtGraph release 0.9.9

parents 5309483a 930c3a1c
......@@ -2,3 +2,8 @@ __pycache__
build
*.pyc
*.swp
MANIFEST
deb_build
dist
.idea
rtr.cvs
language: python
# Credit: Original .travis.yml lifted from VisPy
# Here we use anaconda for 2.6 and 3.3, since it provides the simplest
# interface for running different versions of Python. We could also use
# it for 2.7, but the Ubuntu system has installable 2.7 Qt4-GL, which
# allows for more complete testing.
notifications:
email: false
virtualenv:
system_site_packages: true
env:
# Enable python 2 and python 3 builds
# Note that the 2.6 build doesn't get flake8, and runs old versions of
# Pyglet and GLFW to make sure we deal with those correctly
#- PYTHON=2.6 QT=pyqt TEST=standard
- PYTHON=2.7 QT=pyqt TEST=extra
- PYTHON=2.7 QT=pyside TEST=standard
- PYTHON=3.2 QT=pyqt TEST=standard
- PYTHON=3.2 QT=pyside TEST=standard
#- PYTHON=3.2 QT=pyqt5 TEST=standard
before_install:
- TRAVIS_DIR=`pwd`
- travis_retry sudo apt-get update;
# - if [ "${PYTHON}" != "2.7" ]; then
# wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh &&
# chmod +x miniconda.sh &&
# ./miniconda.sh -b &&
# export PATH=/home/$USER/anaconda/bin:$PATH &&
# conda update --yes conda &&
# travis_retry sudo apt-get -qq -y install libgl1-mesa-dri;
# fi;
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
GIT_SOURCE_EXTRA="+refs/pull/${TRAVIS_PULL_REQUEST}/merge";
else
GIT_TARGET_EXTRA="";
GIT_SOURCE_EXTRA="";
fi;
# to aid in debugging
- echo ${TRAVIS_BRANCH}
- echo ${TRAVIS_REPO_SLUG}
- echo ${GIT_TARGET_EXTRA}
- echo ${GIT_SOURCE_EXTRA}
install:
# Dependencies
- if [ "${PYTHON}" == "2.7" ]; then
travis_retry sudo apt-get -qq -y install python-numpy &&
export PIP=pip &&
sudo ${PIP} install pytest &&
sudo ${PIP} install flake8 &&
export PYTEST=py.test;
else
travis_retry sudo apt-get -qq -y install python3-numpy &&
curl http://python-distribute.org/distribute_setup.py | sudo python3 &&
curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python3 &&
export PIP=pip3.2 &&
sudo ${PIP} install pytest &&
sudo ${PIP} install flake8 &&
export PYTEST=py.test-3.2;
fi;
# Qt
- if [ "${PYTHON}" == "2.7" ]; then
if [ ${QT} == 'pyqt' ]; then
travis_retry sudo apt-get -qq -y install python-qt4 python-qt4-gl;
else
travis_retry sudo apt-get -qq -y install python-pyside.qtcore python-pyside.qtgui python-pyside.qtsvg python-pyside.qtopengl;
fi;
elif [ "${PYTHON}" == "3.2" ]; then
if [ ${QT} == 'pyqt' ]; then
travis_retry sudo apt-get -qq -y install python3-pyqt4;
elif [ ${QT} == 'pyside' ]; then
travis_retry sudo apt-get -qq -y install python3-pyside;
else
${PIP} search PyQt5;
${PIP} install PyQt5;
cat /home/travis/.pip/pip.log;
fi;
else
conda create -n testenv --yes --quiet pip python=$PYTHON &&
source activate testenv &&
if [ ${QT} == 'pyqt' ]; then
conda install --yes --quiet pyside;
else
conda install --yes --quiet pyside;
fi;
fi;
# Install PyOpenGL
- if [ "${PYTHON}" == "2.7" ]; then
echo "Using OpenGL stable version (apt)";
travis_retry sudo apt-get -qq -y install python-opengl;
else
echo "Using OpenGL stable version (pip)";
${PIP} install -q PyOpenGL;
cat /home/travis/.pip/pip.log;
fi;
# Debugging helpers
- uname -a
- cat /etc/issue
- if [ "${PYTHON}" == "2.7" ]; then
python --version;
else
python3 --version;
fi;
- apt-cache search python3-pyqt
- apt-cache search python3-pyside
- apt-cache search pytest
- apt-cache search python pip
- apt-cache search python qt5
before_script:
# We need to create a (fake) display on Travis, let's use a funny resolution
- export DISPLAY=:99.0
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render
# Make sure everyone uses the correct python
- mkdir ~/bin && ln -s `which python${PYTHON}` ~/bin/python
- export PATH=/home/travis/bin:$PATH
- which python
- python --version
# Help color output from each test
- RESET='\033[0m';
RED='\033[00;31m';
GREEN='\033[00;32m';
YELLOW='\033[00;33m';
BLUE='\033[00;34m';
PURPLE='\033[00;35m';
CYAN='\033[00;36m';
WHITE='\033[00;37m';
start_test() {
echo -e "${BLUE}======== Starting $1 ========${RESET}";
};
check_output() {
ret=$?;
if [ $ret == 0 ]; then
echo -e "${GREEN}>>>>>> $1 passed <<<<<<${RESET}";
else
echo -e "${RED}>>>>>> $1 FAILED <<<<<<${RESET}";
fi;
return $ret;
};
- if [ "${TEST}" == "extra" ]; then
start_test "repo size check";
mkdir ~/repo-clone && cd ~/repo-clone &&
git init && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &&
git fetch origin ${GIT_TARGET_EXTRA} &&
git checkout -qf FETCH_HEAD &&
git tag travis-merge-target &&
git gc --aggressive &&
TARGET_SIZE=`du -s . | sed -e "s/\t.*//"` &&
git pull origin ${GIT_SOURCE_EXTRA} &&
git gc --aggressive &&
MERGE_SIZE=`du -s . | sed -e "s/\t.*//"` &&
if [ "${MERGE_SIZE}" != "${TARGET_SIZE}" ]; then
SIZE_DIFF=`expr \( ${MERGE_SIZE} - ${TARGET_SIZE} \)`;
else
SIZE_DIFF=0;
fi;
fi;
- cd $TRAVIS_DIR
script:
# Run unit tests
- start_test "unit tests";
PYTHONPATH=. ${PYTEST} pyqtgraph/;
check_output "unit tests";
# check line endings
- if [ "${TEST}" == "extra" ]; then
start_test "line ending check";
! find ./ -name "*.py" | xargs file | grep CRLF &&
! find ./ -name "*.rst" | xargs file | grep CRLF;
check_output "line ending check";
fi;
# Check repo size does not expand too much
- if [ "${TEST}" == "extra" ]; then
start_test "repo size check";
echo -e "Estimated content size difference = ${SIZE_DIFF} kB" &&
test ${SIZE_DIFF} -lt 100;
check_output "repo size check";
fi;
# Check for style issues
- if [ "${TEST}" == "extra" ]; then
start_test "style check";
cd ~/repo-clone &&
git reset -q travis-merge-target &&
python setup.py style &&
check_output "style check";
fi;
- cd $TRAVIS_DIR
# Check install works
- start_test "install test";
sudo python${PYTHON} setup.py --quiet install;
check_output "install test";
# Check double-install fails
# Note the bash -c is because travis strips off the ! otherwise.
- start_test "double install test";
bash -c "! sudo python${PYTHON} setup.py --quiet install";
check_output "double install test";
# Check we can import pg
- start_test "import test";
echo "import sys; print(sys.path)" | python &&
cd /; echo "import pyqtgraph.examples" | python;
check_output "import test";
pyqtgraph-0.9.9
API / behavior changes:
- Dynamic import system abandoned; pg now uses static imports throughout.
- Flowcharts and exporters have new pluggin systems
- Version strings:
- __init__.py in git repo now contains latest release version string
(previously, only packaged releases had version strings).
- installing from git checkout that does not correspond to a release
commit will result in a more descriptive version string.
- Speed improvements in functions.makeARGB
- ImageItem is faster by avoiding makeQImage(transpose=True)
- ComboBox will raise error when adding multiple items of the same name
- ArrowItem.setStyle now updates style options rather than replacing them
- Renamed GraphicsView signals to avoid collision with ViewBox signals that
are wrapped in PlotWidget: sigRangeChanged => sigDeviceRangeChanged and
sigTransformChanged => sigDeviceTransformChanged.
- GLViewWidget.itemsAt() now measures y from top of widget to match mouse
event position.
- Made setPen() methods consistent throughout the package
- Fix in GLScatterPlotItem requires that points will appear slightly more opaque
(so you may need to adjust to lower alpha to achieve the same results)
New Features:
- Added ViewBox.setLimits() method
- Adde ImageItem downsampling
- New HDF5 example for working with very large datasets
- Removed all dependency on scipy
- Added Qt.loadUiType function for PySide
- Simplified Profilers; can be activated with environmental variables
- Added Dock.raiseDock() method
- ComboBox updates:
- Essentially a graphical interface to dict; all items have text and value
- Assigns previously-selected text after list is cleared and repopulated
- Get, set current value
- Flowchart updates
- Added Flowchart.sigChartChanged
- Custom nodes may now be registered in sub-menu trees
- ImageItem.getHistogram is more clever about constructing histograms
- Added FillBetweenItem.setCurves()
- MultiPlotWidget now has setMinimumPlotHeight method and displays scroll bar
when plots do not fit inside the widget.
- Added BarGraphItem.shape() to allow better mouse interaction
- Added MeshData.cylinder
- Added ViewBox.setBackgroundColor() and GLViewWidget.setBackgroundColor()
- Utilities / debugging tools
- Mutex used for tracing deadlocks
- Color output on terminal
- Multiprocess debugging colors messages by process
- Stdout filter that colors text by thread
- PeriodicTrace used to report deadlocks
- Added AxisItem.setStyle()
- Added configurable formatting for TableWidget
- Added 'stepMode' argument to PlotDataItem()
- Added ViewBox.invertX()
- Docks now have optional close button
- Added InfiniteLine.setHoverPen
- Added GLVolumeItem.setData
- Added PolyLineROI.setPoints, clearPoints, saveState, setState
- Added ErrorBarItem.setData
Bugfixes:
- PlotCurveItem now has correct clicking behavior--clicks within a few px
of the line will trigger a signal.
- Fixes related to CSV exporter:
- CSV headers include data names, if available
- Exporter correctly handles items with no data
- pg.plot() avoids creating empty data item
- removed call to reduce() from exporter; not available in python 3
- Gave .name() methods to PlotDataItem, PlotCurveItem, and ScatterPlotItem
- fixed ImageItem handling of rgb images
- fixed makeARGB re-ordering of color channels
- fixed unicode usage in AxisItem tick strings
- fixed PlotCurveItem generating exceptions when data has length=0
- fixed ImageView.setImage only working once
- PolyLineROI.setPen() now changes the pen of its segments as well
- Prevent divide-by-zero in AxisItem
- Major speedup when using ScatterPlotItem in pxMode
- PlotCurveItem ignores clip-to-view when auto range is enabled
- FillBetweenItem now forces PlotCurveItem to generate path
- Fixed import errors and py3 issues in MultiPlotWidget
- Isosurface works for arrays with shapes > 255
- Fixed ImageItem exception building histogram when image has only one value
- Fixed MeshData exception caused when vertexes have no matching faces
- Fixed GLViewWidget exception handler
- Fixed unicode support in Dock
- Fixed PySide crash caused by emitting signal from GraphicsObject.itemChange
- Fixed possible infinite loop from FiniteCache
- Allow images with NaN in ImageView
- MeshData can generate edges from face-indexed vertexes
- Fixed multiprocess deadlocks on windows
- Fixed GLGridItem.setSize
- Fixed parametertree.Parameter.sigValueChanging
- Fixed AxisItem.__init__(showValues=False)
- Fixed TableWidget append / sort issues
- Fixed AxisItem not resizing text area when setTicks() is used
- Removed a few cyclic references
- Fixed Parameter 'readonly' option for bool, color, and text parameter types
- Fixed alpha on GLScatterPlotItem spots (formerly maxed out at alpha=200)
- Fixed a few bugs causing exit crashes
pyqtgraph-0.9.8 2013-11-24
API / behavior changes:
......
Contributions to pyqtgraph are welcome!
Please use the following guidelines when preparing changes:
* The preferred method for submitting changes is by github pull request
against the "develop" branch. If this is inconvenient, don't hesitate to
submit by other means.
* Pull requests should include only a focused and related set of changes.
Mixed features and unrelated changes (such as .gitignore) will usually be
rejected.
* For major changes, it is recommended to discuss your plans on the mailing
list or in a github issue before putting in too much effort.
* Along these lines, please note that pyqtgraph.opengl will be deprecated
soon and replaced with VisPy.
* Writing proper documentation and unit tests is highly encouraged. PyQtGraph
uses nose / py.test style testing, so tests should usually be included in a
tests/ directory adjacent to the relevant code.
* Documentation is generated with sphinx; please check that docstring changes
compile correctly.
* Style guidelines:
* PyQtGraph prefers PEP8 for most style issues, but this is not enforced
rigorously as long as the code is clean and readable.
* Use `python setup.py style` to see whether your code follows
the mandatory style guidelines checked by flake8.
* Exception 1: All variable names should use camelCase rather than
underscore_separation. This is done for consistency with Qt
* Exception 2: Function docstrings use ReStructuredText tables for
describing arguments:
```
============== ========================================================
**Arguments:**
argName1 (type) Description of argument
argName2 (type) Description of argument. Longer descriptions must
be wrapped within the column guidelines defined by the
"====" header and footer.
============== ========================================================
```
QObject subclasses that implement new signals should also describe
these in a similar table.
recursive-include pyqtgraph *.py *.ui *.m README *.txt
recursive-include tests *.py *.ui
recursive-include examples *.py *.ui
recursive-include examples *.py *.ui *.gz *.cfg
recursive-include doc *.rst *.py *.svg *.png *.jpg
recursive-include doc/build/html *
recursive-include tools *
include doc/Makefile doc/make.bat README.txt LICENSE.txt
include doc/Makefile doc/make.bat README.md LICENSE.txt CHANGELOG
global-exclude *.pyc
......@@ -10,7 +10,7 @@ Copyright 2012 Luke Campagnola, University of North Carolina at Chapel Hill
Maintainer
----------
* Luke Campagnola ('luke.campagnola@%s.com' % 'gmail')
* Luke Campagnola <luke.campagnola@gmail.com>
Contributors
------------
......@@ -23,14 +23,24 @@ Contributors
* Ulrich Leutner
* Felix Schill
* Guillaume Poulin
* Antony Lee
* Mattias Põldaru
* Thomas S.
* Fabio Zadrozny
* Mikhail Terekhov
* Pietro Zambelli
* Stefan Holzmann
* Nicholas TJ
* John David Reaver
* David Kaplan
Requirements
------------
* PyQt 4.7+ or PySide
* python 2.6, 2.7, or 3.x
* numpy, scipy
* For 3D graphics: pyopengl
* NumPy
* For 3D graphics: pyopengl and qt-opengl
* Known to run on Windows, Linux, and Mac.
Support
......@@ -42,10 +52,14 @@ Installation Methods
--------------------
* To use with a specific project, simply copy the pyqtgraph subdirectory
anywhere that is importable from your project
anywhere that is importable from your project. PyQtGraph may also be
used as a git subtree by cloning the git-core repository from github.
* To install system-wide from source distribution:
`$ python setup.py install`
* For instalation packages, see the website (pyqtgraph.org)
* For installation packages, see the website (pyqtgraph.org)
* On debian-like systems, pyqtgraph requires the following packages:
python-numpy, python-qt4 | python-pyside
For 3D support: python-opengl, python-qt4-gl | python-pyside.qtopengl
Documentation
-------------
......@@ -61,4 +75,4 @@ Some (incomplete) documentation exists at this time.
`$ make html`
Please feel free to pester Luke or post to the forum if you need a specific
section of documentation.
section of documentation to be expanded.
3D Graphics
===========
Pyqtgraph uses OpenGL to provide a 3D scenegraph system. This system is functional but still early in development.
PyQtGraph uses OpenGL to provide a 3D scenegraph system. This system is functional but still early in development.
Current capabilities include:
* 3D view widget with zoom/rotate controls (mouse drag and wheel)
......
Pyqtgraph's 3D Graphics System
PyQtGraph's 3D Graphics System
==============================
The 3D graphics system in pyqtgraph is composed of a :class:`view widget <pyqtgraph.opengl.GLViewWidget>` and
several graphics items (all subclasses of :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>`) which
can be added to a view widget.
**Note:** use of this system requires python-opengl bindings. Linux users should install the python-opengl
**Note 1:** pyqtgraph.opengl is based on the deprecated OpenGL fixed-function pipeline. Although it is
currently a functioning system, it is likely to be superceded in the future by `VisPy <http://vispy.org>`_.
**Note 2:** use of this system requires python-opengl bindings. Linux users should install the python-opengl
packages from their distribution. Windows/OSX users can download from `<http://pyopengl.sourceforge.net>`_.
Contents:
......
......@@ -50,9 +50,9 @@ copyright = '2011, Luke Campagnola'
# built documents.
#
# The short X.Y version.
version = ''
version = '0.9.9'
# The full version, including alpha/beta/rc tags.
release = ''
release = '0.9.9'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -39,13 +39,14 @@ Exporting from the API
To export a file programatically, follow this example::
import pyqtgraph as pg
import pyqtgraph.exporters
# generate something to export
plt = pg.plot([1,5,2,4,3])
# create an exporter instance, as an argument give it
# the item you wish to export
exporter = pg.exporters.ImageExporter.ImageExporter(plt.plotItem)
exporter = pg.exporters.ImageExporter(plt.plotItem)
# set export parameters if needed
exporter.parameters()['width'] = 100 # (note this also affects height parameter)
......
Pyqtgraph's Helper Functions
PyQtGraph's Helper Functions
============================
Simple Data Display Functions
......@@ -13,7 +13,7 @@ Simple Data Display Functions
Color, Pen, and Brush Functions
-------------------------------
Qt uses the classes QColor, QPen, and QBrush to determine how to draw lines and fill shapes. These classes are highly capable but somewhat awkward to use. Pyqtgraph offers the functions :func:`~pyqtgraph.mkColor`, :func:`~pyqtgraph.mkPen`, and :func:`~pyqtgraph.mkBrush` to simplify the process of creating these classes. In most cases, however, it will be unnecessary to call these functions directly--any function or method that accepts *pen* or *brush* arguments will make use of these functions for you. For example, the following three lines all have the same effect::
Qt uses the classes QColor, QPen, and QBrush to determine how to draw lines and fill shapes. These classes are highly capable but somewhat awkward to use. PyQtGraph offers the functions :func:`~pyqtgraph.mkColor`, :func:`~pyqtgraph.mkPen`, and :func:`~pyqtgraph.mkBrush` to simplify the process of creating these classes. In most cases, however, it will be unnecessary to call these functions directly--any function or method that accepts *pen* or *brush* arguments will make use of these functions for you. For example, the following three lines all have the same effect::
pg.plot(xdata, ydata, pen='r')
pg.plot(xdata, ydata, pen=pg.mkPen('r'))
......
ErrorBarItem
============
.. autoclass:: pyqtgraph.ErrorBarItem
:members:
.. automethod:: pyqtgraph.ErrorBarItem.__init__
Pyqtgraph's Graphics Items
PyQtGraph's Graphics Items
==========================
Since pyqtgraph relies on Qt's GraphicsView framework, most of its graphics functionality is implemented as QGraphicsItem subclasses. This has two important consequences: 1) virtually anything you want to draw can be easily accomplished using the functionality provided by Qt. 2) Many of pyqtgraph's GraphicsItem classes can be used in any normal QGraphicsScene.
......@@ -23,6 +23,7 @@ Contents:
isocurveitem
axisitem
textitem
errorbaritem
arrowitem
fillbetweenitem
curvepoint
......
......@@ -4,5 +4,25 @@ ROI
.. autoclass:: pyqtgraph.ROI
:members:
.. automethod:: pyqtgraph.ROI.__init__
.. autoclass:: pyqtgraph.RectROI
:members:
.. autoclass:: pyqtgraph.EllipseROI
:members:
.. autoclass:: pyqtgraph.CircleROI
:members:
.. autoclass:: pyqtgraph.LineSegmentROI
:members:
.. autoclass:: pyqtgraph.PolyLineROI
:members:
.. autoclass:: pyqtgraph.LineROI
:members:
.. autoclass:: pyqtgraph.MultiRectROI
:members:
......@@ -12,7 +12,7 @@ There are a few suggested ways to use pyqtgraph:
Command-line use
----------------
Pyqtgraph makes it very easy to visualize data from the command line. Observe::
PyQtGraph makes it very easy to visualize data from the command line. Observe::
import pyqtgraph as pg
pg.plot(data) # data can be a list of values or a numpy array
......@@ -43,7 +43,7 @@ While I consider this approach somewhat lazy, it is often the case that 'lazy' i
Embedding widgets inside PyQt applications
------------------------------------------
For the serious application developer, all of the functionality in pyqtgraph is available via :ref:`widgets <api_widgets>` that can be embedded just like any other Qt widgets. Most importantly, see: :class:`PlotWidget <pyqtgraph.PlotWidget>`, :class:`ImageView <pyqtgraph.ImageView>`, :class:`GraphicsLayoutWidget <pyqtgraph.GraphicsLayoutWidget>`, and :class:`GraphicsView <pyqtgraph.GraphicsView>`. Pyqtgraph's widgets can be included in Designer's ui files via the "Promote To..." functionality:
For the serious application developer, all of the functionality in pyqtgraph is available via :ref:`widgets <api_widgets>` that can be embedded just like any other Qt widgets. Most importantly, see: :class:`PlotWidget <pyqtgraph.PlotWidget>`, :class:`ImageView <pyqtgraph.ImageView>`, :class:`GraphicsLayoutWidget <pyqtgraph.GraphicsLayoutWidget>`, and :class:`GraphicsView <pyqtgraph.GraphicsView>`. PyQtGraph's widgets can be included in Designer's ui files via the "Promote To..." functionality:
#. In Designer, create a QGraphicsView widget ("Graphics View" under the "Display Widgets" category).
#. Right-click on the QGraphicsView and select "Promote To...".
......@@ -51,13 +51,13 @@ For the serious application developer, all of the functionality in pyqtgraph is
#. Under "Header file", enter "pyqtgraph".
#. Click "Add", then click "Promote".
See the designer documentation for more information on promoting widgets.
See the designer documentation for more information on promoting widgets. The "VideoSpeedTest" and "ScatterPlotSpeedTest" examples both demonstrate the use of .ui files that are compiled to .py modules using pyuic4 or pyside-uic. The "designerExample" example demonstrates dynamically generating python classes from .ui files (no pyuic4 / pyside-uic needed).
PyQt and PySide
---------------
Pyqtgraph supports two popular python wrappers for the Qt library: PyQt and PySide. Both packages provide nearly identical
PyQtGraph supports two popular python wrappers for the Qt library: PyQt and PySide. Both packages provide nearly identical
APIs and functionality, but for various reasons (discussed elsewhere) you may prefer to use one package or the other. When
pyqtgraph is first imported, it automatically determines which library to use by making the fillowing checks:
......@@ -71,3 +71,53 @@ make sure it is imported before pyqtgraph::