push bullet lists over 2 spaces to get them to show up as such in the… (#1912)

* push bullet lists over 2 spaces to get them to show up as such in the docs

* separate the literal block from the bullet list
This commit is contained in:
Martin Chase 2021-07-21 07:12:35 -07:00 committed by GitHub
parent 66ec0996f4
commit 1d40d50b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 269 additions and 254 deletions

View File

@ -30,15 +30,15 @@ class GraphicsScene(QtGui.QGraphicsScene):
events, but this turned out to be impossible because the constructor for QGraphicsMouseEvent
is private)
* Generates MouseClicked events in addition to the usual press/move/release events.
(This works around a problem where it is impossible to have one item respond to a
drag if another is watching for a click.)
* Adjustable radius around click that will catch objects so you don't have to click *exactly* over small/thin objects
* Global context menu--if an item implements a context menu, then its parent(s) may also add items to the menu.
* Allows items to decide _before_ a mouse click which item will be the recipient of mouse events.
This lets us indicate unambiguously to the user which item they are about to click/drag on
* Eats mouseMove events that occur too soon after a mouse press.
* Reimplements items() and itemAt() to circumvent PyQt bug
* Generates MouseClicked events in addition to the usual press/move/release events.
(This works around a problem where it is impossible to have one item respond to a
drag if another is watching for a click.)
* Adjustable radius around click that will catch objects so you don't have to click *exactly* over small/thin objects
* Global context menu--if an item implements a context menu, then its parent(s) may also add items to the menu.
* Allows items to decide _before_ a mouse click which item will be the recipient of mouse events.
This lets us indicate unambiguously to the user which item they are about to click/drag on
* Eats mouseMove events that occur too soon after a mouse press.
* Reimplements items() and itemAt() to circumvent PyQt bug
====================== ====================================================================
**Signals**

View File

@ -360,9 +360,9 @@ def exit():
This function does the following in an attempt to 'safely' terminate
the process:
* Invoke atexit callbacks
* Close all open file handles
* os._exit()
* Invoke atexit callbacks
* Close all open file handles
* os._exit()
Note: there is some potential for causing damage with this function if you
are using objects that _require_ their destructors to be called (for example,

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import numpy as np
from .Qt import QtGui, QtCore
from .functions import mkColor, eq, colorDistance
@ -18,10 +19,10 @@ def listMaps(source=None):
Parameters
----------
source: str, optional
Color map source. If omitted, locally stored maps are listed. Otherwise
Color map source. If omitted, locally stored maps are listed. Otherwise:
- 'matplotlib' lists maps that can be imported from Matplotlib
- 'colorcet' lists maps that can be imported from ColorCET
- 'matplotlib' lists maps that can be imported from Matplotlib
- 'colorcet' lists maps that can be imported from ColorCET
Returns
-------
@ -68,10 +69,10 @@ def get(name, source=None, skipCache=False):
be a path to a file in the local folder. See the files in the
``pyqtgraph/colors/maps/`` folder for examples of the format.
source: str, optional
If omitted, a locally stored map is returned. Otherwise
If omitted, a locally stored map is returned. Otherwise:
- 'matplotlib' imports a map defined by Matplotlib.
- 'colorcet' imports a map defined by ColorCET.
- 'matplotlib' imports a map defined by Matplotlib.
- 'colorcet' imports a map defined by ColorCET.
skipCache: bool, optional
If `skipCache=True`, the internal cache is skipped and a new
@ -443,9 +444,9 @@ class ColorMap(object):
mode: str or int, optional
Determines return format:
- `ColorMap.BYTE` or 'byte': Colors are returned as 0-255 unsigned bytes. (default)
- `ColorMap.FLOAT` or 'float': Colors are returned as 0.0-1.0 floats.
- `ColorMap.QCOLOR` or 'qcolor': Colors are returned as QColor objects.
- `ColorMap.BYTE` or 'byte': Colors are returned as 0-255 unsigned bytes. (default)
- `ColorMap.FLOAT` or 'float': Colors are returned as 0.0-1.0 floats.
- `ColorMap.QCOLOR` or 'qcolor': Colors are returned as QColor objects.
Returns
-------
@ -556,14 +557,14 @@ class ColorMap(object):
span : tuple (min, max), default (0.0, 1.0)
Span of data values covered by the gradient:
- Color map value 0.0 will appear at `min`,
- Color map value 1.0 will appear at `max`.
- Color map value 0.0 will appear at `min`,
- Color map value 1.0 will appear at `max`.
orientation : str, default 'vertical'
Orientiation of the gradient:
- 'vertical': `span` corresponds to the `y` coordinate.
- 'horizontal': `span` corresponds to the `x` coordinate.
- 'vertical': `span` corresponds to the `y` coordinate.
- 'horizontal': `span` corresponds to the `x` coordinate.
"""
if orientation == 'vertical':
grad = self.getGradient( p1=QtCore.QPointF(0.,span[0]), p2=QtCore.QPointF(0.,span[1]) )
@ -582,14 +583,14 @@ class ColorMap(object):
span : tuple (min, max), default (0.0, 1.0)
Span of the data values covered by the gradient:
- Color map value 0.0 will appear at `min`.
- Color map value 1.0 will appear at `max`.
- Color map value 0.0 will appear at `min`.
- Color map value 1.0 will appear at `max`.
orientation : str, default 'vertical'
Orientiation of the gradient:
- 'vertical' creates a vertical gradient, where `span` corresponds to the `y` coordinate.
- 'horizontal' creates a horizontal gradient, where `span` correspnds to the `x` coordinate.
- 'vertical' creates a vertical gradient, where `span` corresponds to the `y` coordinate.
- 'horizontal' creates a horizontal gradient, where `span` correspnds to the `x` coordinate.
width : int or float
Width of the pen in pixels on screen.

View File

@ -17,18 +17,18 @@ class ConsoleWidget(QtGui.QWidget):
Widget displaying console output and accepting command input.
Implements:
- eval python expressions / exec python statements
- storable history of commands
- exception handling allowing commands to be interpreted in the context of any level in the exception stack frame
- eval python expressions / exec python statements
- storable history of commands
- exception handling allowing commands to be interpreted in the context of any level in the exception stack frame
Why not just use python in an interactive shell (or ipython) ? There are a few reasons:
- pyside does not yet allow Qt event processing and interactive shell at the same time
- on some systems, typing in the console _blocks_ the qt event loop until the user presses enter. This can
be baffling and frustrating to users since it would appear the program has frozen.
- some terminals (eg windows cmd.exe) have notoriously unfriendly interfaces
- ability to add extra features like exception stack introspection
- ability to have multiple interactive prompts, including for spawned sub-processes
- pyside does not yet allow Qt event processing and interactive shell at the same time
- on some systems, typing in the console _blocks_ the qt event loop until the user presses enter. This can
be baffling and frustrating to users since it would appear the program has frozen.
- some terminals (eg windows cmd.exe) have notoriously unfriendly interfaces
- ability to add extra features like exception stack introspection
- ability to have multiple interactive prompts, including for spawned sub-processes
"""
_threadException = QtCore.Signal(object)

View File

@ -3089,9 +3089,9 @@ def disconnect(signal, slot):
This method augments Qt's Signal.disconnect():
* Return bool indicating whether disconnection was successful, rather than
raising an exception
* Attempt to disconnect prior versions of the slot when using pg.reload
* Return bool indicating whether disconnection was successful, rather than
raising an exception
* Attempt to disconnect prior versions of the slot when using pg.reload
"""
while True:
try:

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from ..Qt import QtGui, QtCore
from .GraphicsObject import GraphicsObject
from .. import getConfigOption
@ -34,15 +35,15 @@ class ErrorBarItem(GraphicsObject):
Valid keyword options are:
x, y, height, width, top, bottom, left, right, beam, pen
* x and y must be numpy arrays specifying the coordinates of data points.
* height, width, top, bottom, left, right, and beam may be numpy arrays,
single values, or None to disable. All values should be positive.
* top, bottom, left, and right specify the lengths of bars extending
in each direction.
* If height is specified, it overrides top and bottom.
* If width is specified, it overrides left and right.
* beam specifies the width of the beam at the end of each bar.
* pen may be any single argument accepted by pg.mkPen().
* x and y must be numpy arrays specifying the coordinates of data points.
* height, width, top, bottom, left, right, and beam may be numpy arrays,
single values, or None to disable. All values should be positive.
* top, bottom, left, and right specify the lengths of bars extending
in each direction.
* If height is specified, it overrides top and bottom.
* If width is specified, it overrides left and right.
* beam specifies the width of the beam at the end of each bar.
* pen may be any single argument accepted by pg.mkPen().
This method was added in version 0.9.9. For prior versions, use setOpts.
"""

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from .. import functions as fn
from .GraphicsObject import GraphicsObject
from .ScatterPlotItem import ScatterPlotItem
@ -36,14 +37,14 @@ class GraphItem(GraphicsObject):
pen The pen to use when drawing lines between connected
nodes. May be one of:
* QPen
* a single argument to pass to pg.mkPen
* a record array of length M
with fields (red, green, blue, alpha, width). Note
that using this option may have a significant performance
cost.
* None (to disable connection drawing)
* 'default' to use the default foreground color.
* QPen
* a single argument to pass to pg.mkPen
* a record array of length M
with fields (red, green, blue, alpha, width). Note
that using this option may have a significant performance
cost.
* None (to disable connection drawing)
* 'default' to use the default foreground color.
symbolPen The pen(s) used for drawing nodes.
symbolBrush The brush(es) used for drawing nodes.
@ -84,11 +85,11 @@ class GraphItem(GraphicsObject):
Set the pen used to draw graph lines.
May be:
* None to disable line drawing
* Record array with fields (red, green, blue, alpha, width)
* Any set of arguments and keyword arguments accepted by
:func:`mkPen <pyqtgraph.mkPen>`.
* 'default' to use the default foreground color.
* None to disable line drawing
* Record array with fields (red, green, blue, alpha, width)
* Any set of arguments and keyword arguments accepted by
:func:`mkPen <pyqtgraph.mkPen>`.
* 'default' to use the default foreground color.
"""
if len(args) == 1 and len(kwargs) == 0:
self.pen = args[0]

View File

@ -32,9 +32,9 @@ class HistogramLUTItem(GraphicsWidget):
Includes:
- Image histogram
- Movable region over the histogram to select black/white levels
- Gradient editor to define color lookup table for single-channel images
- Image histogram
- Movable region over the histogram to select black/white levels
- Gradient editor to define color lookup table for single-channel images
Parameters
----------

View File

@ -869,9 +869,9 @@ class ImageItem(GraphicsObject):
``self.xp.histogram()``. If `bins` is `auto`, a bin number is automatically
chosen based on the image characteristics:
* Integer images will have approximately `targetHistogramSize` bins,
with each bin having an integer width.
* All other types will have `targetHistogramSize` bins.
* Integer images will have approximately `targetHistogramSize` bins,
with each bin having an integer width.
* All other types will have `targetHistogramSize` bins.
If `perChannel` is `True`, then a histogram is computed for each channel,
and the output is a list of the results.

View File

@ -449,11 +449,11 @@ class InfLineLabel(TextItem):
This class extends TextItem with the following features:
* Automatically positions adjacent to the line at a fixed position along
the line and within the view box.
* Automatically reformats text when the line value has changed.
* Can optionally be dragged to change its location along the line.
* Optionally aligns to its parent line.
* Automatically positions adjacent to the line at a fixed position along
the line and within the view box.
* Automatically reformats text when the line value has changed.
* Can optionally be dragged to change its location along the line.
* Optionally aligns to its parent line.
=============== ==================================================================
**Arguments:**

View File

@ -62,12 +62,12 @@ class LinearRegionItem(GraphicsObject):
swapMode Sets the behavior of the region when the lines are moved such that
their order reverses:
* "block" means the user cannot drag one line past the other
* "push" causes both lines to be moved if one would cross the other
* "sort" means that lines may trade places, but the output of
getRegion always gives the line positions in ascending order.
* None means that no attempt is made to handle swapped line
positions.
* "block" means the user cannot drag one line past the other
* "push" causes both lines to be moved if one would cross the other
* "sort" means that lines may trade places, but the output of
getRegion always gives the line positions in ascending order.
* None means that no attempt is made to handle swapped line
positions.
The default is "sort".
clipItem An item whose bounds will be used to limit the region bounds.

View File

@ -20,9 +20,9 @@ class PlotCurveItem(GraphicsObject):
Features:
- Fast data update
- Fill under curve
- Mouse interaction
- Fast data update
- Fill under curve
- Mouse interaction
===================== ===============================================
**Signals:**

View File

@ -43,35 +43,35 @@ class PlotItem(GraphicsWidget):
It's main functionality is:
- Manage placement of ViewBox, AxisItems, and LabelItems
- Create and manage a list of PlotDataItems displayed inside the ViewBox
- Implement a context menu with commonly used display and analysis options
- Manage placement of ViewBox, AxisItems, and LabelItems
- Create and manage a list of PlotDataItems displayed inside the ViewBox
- Implement a context menu with commonly used display and analysis options
Use :func:`plot() <pyqtgraph.PlotItem.plot>` to create a new PlotDataItem and
add it to the view. Use :func:`addItem() <pyqtgraph.PlotItem.addItem>` to
add any QGraphicsItem to the view.
This class wraps several methods from its internal ViewBox:
:func:`setXRange <pyqtgraph.ViewBox.setXRange>`,
:func:`setYRange <pyqtgraph.ViewBox.setYRange>`,
:func:`setRange <pyqtgraph.ViewBox.setRange>`,
:func:`autoRange <pyqtgraph.ViewBox.autoRange>`,
:func:`setDefaultPadding <pyqtgraph.ViewBox.setDefaultPadding>`,
:func:`setXLink <pyqtgraph.ViewBox.setXLink>`,
:func:`setYLink <pyqtgraph.ViewBox.setYLink>`,
:func:`setAutoPan <pyqtgraph.ViewBox.setAutoPan>`,
:func:`setAutoVisible <pyqtgraph.ViewBox.setAutoVisible>`,
:func:`setLimits <pyqtgraph.ViewBox.setLimits>`,
:func:`viewRect <pyqtgraph.ViewBox.viewRect>`,
:func:`viewRange <pyqtgraph.ViewBox.viewRange>`,
:func:`setMouseEnabled <pyqtgraph.ViewBox.setMouseEnabled>`,
:func:`enableAutoRange <pyqtgraph.ViewBox.enableAutoRange>`,
:func:`disableAutoRange <pyqtgraph.ViewBox.disableAutoRange>`,
:func:`setAspectLocked <pyqtgraph.ViewBox.setAspectLocked>`,
:func:`invertY <pyqtgraph.ViewBox.invertY>`,
:func:`invertX <pyqtgraph.ViewBox.invertX>`,
:func:`register <pyqtgraph.ViewBox.register>`,
:func:`unregister <pyqtgraph.ViewBox.unregister>`
- :func:`setXRange <pyqtgraph.ViewBox.setXRange>`
- :func:`setYRange <pyqtgraph.ViewBox.setYRange>`
- :func:`setRange <pyqtgraph.ViewBox.setRange>`
- :func:`autoRange <pyqtgraph.ViewBox.autoRange>`
- :func:`setDefaultPadding <pyqtgraph.ViewBox.setDefaultPadding>`
- :func:`setXLink <pyqtgraph.ViewBox.setXLink>`
- :func:`setYLink <pyqtgraph.ViewBox.setYLink>`
- :func:`setAutoPan <pyqtgraph.ViewBox.setAutoPan>`
- :func:`setAutoVisible <pyqtgraph.ViewBox.setAutoVisible>`
- :func:`setLimits <pyqtgraph.ViewBox.setLimits>`
- :func:`viewRect <pyqtgraph.ViewBox.viewRect>`
- :func:`viewRange <pyqtgraph.ViewBox.viewRange>`
- :func:`setMouseEnabled <pyqtgraph.ViewBox.setMouseEnabled>`
- :func:`enableAutoRange <pyqtgraph.ViewBox.enableAutoRange>`
- :func:`disableAutoRange <pyqtgraph.ViewBox.disableAutoRange>`
- :func:`setAspectLocked <pyqtgraph.ViewBox.setAspectLocked>`
- :func:`invertY <pyqtgraph.ViewBox.invertY>`
- :func:`invertX <pyqtgraph.ViewBox.invertX>`
- :func:`register <pyqtgraph.ViewBox.register>`
- :func:`unregister <pyqtgraph.ViewBox.unregister>`
The ViewBox itself can be accessed by calling :func:`getViewBox() <pyqtgraph.PlotItem.getViewBox>`

View File

@ -50,12 +50,12 @@ class ROI(GraphicsObject):
Default mouse interaction:
* Left drag moves the ROI
* Left drag + Ctrl moves the ROI with position snapping
* Left drag + Alt rotates the ROI
* Left drag + Alt + Ctrl rotates the ROI with angle snapping
* Left drag + Shift scales the ROI
* Left drag + Shift + Ctrl scales the ROI with size snapping
* Left drag moves the ROI
* Left drag + Ctrl moves the ROI with position snapping
* Left drag + Alt rotates the ROI
* Left drag + Alt + Ctrl rotates the ROI with angle snapping
* Left drag + Shift scales the ROI
* Left drag + Shift + Ctrl scales the ROI with size snapping
In addition to the above interaction modes, it is possible to attach any
number of handles to the ROI that can be dragged to change the ROI in

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from math import atan2
from ..Qt import QtGui, QtCore
from ..Point import Point
@ -363,8 +364,8 @@ class TargetLabel(TextItem):
"""A TextItem that attaches itself to a TargetItem.
This class extends TextItem with the following features :
* Automatically positions adjacent to the symbol at a fixed position.
* Automatically reformats text when the symbol location has changed.
* Automatically positions adjacent to the symbol at a fixed position.
* Automatically reformats text when the symbol location has changed.
Parameters
----------

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from math import atan2, degrees
from ..Qt import QtCore, QtGui
from ..Point import Point
@ -35,11 +36,11 @@ class TextItem(GraphicsObject):
The effects of the `rotateAxis` and `angle` arguments are added independently. So for example:
* rotateAxis=None, angle=0 -> normal horizontal text
* rotateAxis=None, angle=90 -> normal vertical text
* rotateAxis=(1, 0), angle=0 -> text aligned with x axis of its parent
* rotateAxis=(0, 1), angle=0 -> text aligned with y axis of its parent
* rotateAxis=(1, 0), angle=90 -> text orthogonal to x axis of its parent
* rotateAxis=None, angle=0 -> normal horizontal text
* rotateAxis=None, angle=90 -> normal vertical text
* rotateAxis=(1, 0), angle=0 -> text aligned with x axis of its parent
* rotateAxis=(0, 1), angle=0 -> text aligned with y axis of its parent
* rotateAxis=(1, 0), angle=90 -> text orthogonal to x axis of its parent
"""
self.anchor = Point(anchor)

View File

@ -81,10 +81,10 @@ class ViewBox(GraphicsWidget):
Features:
* Scaling contents by mouse or auto-scale when contents change
* View linking--multiple views display the same data ranges
* Configurable by context menu
* Item coordinate mapping methods
* Scaling contents by mouse or auto-scale when contents change
* View linking--multiple views display the same data ranges
* Configurable by context menu
* Item coordinate mapping methods
"""

View File

@ -53,15 +53,15 @@ class ImageView(QtGui.QWidget):
Widget used for display and analysis of image data.
Implements many features:
* Displays 2D and 3D image data. For 3D data, a z-axis
slider is displayed allowing the user to select which frame is displayed.
* Displays histogram of image data with movable region defining the dark/light levels
* Editable gradient provides a color lookup table
* Frame slider may also be moved using left/right arrow keys as well as pgup, pgdn, home, and end.
* Basic analysis features including:
* ROI and embedded plot for measuring image values across frames
* Image normalization / background subtraction
* Displays 2D and 3D image data. For 3D data, a z-axis
slider is displayed allowing the user to select which frame is displayed.
* Displays histogram of image data with movable region defining the dark/light levels
* Editable gradient provides a color lookup table
* Frame slider may also be moved using left/right arrow keys as well as pgup, pgdn, home, and end.
* Basic analysis features including:
* ROI and embedded plot for measuring image values across frames
* Image normalization / background subtraction
Basic Usage::
@ -71,13 +71,13 @@ class ImageView(QtGui.QWidget):
**Keyboard interaction**
* left/right arrows step forward/backward 1 frame when pressed,
seek at 20fps when held.
* up/down arrows seek at 100fps
* pgup/pgdn seek at 1000fps
* home/end seek immediately to the first/last frame
* space begins playing frames. If time values (in seconds) are given
for each frame, then playback is in realtime.
* left/right arrows step forward/backward 1 frame when pressed,
seek at 20fps when held.
* up/down arrows seek at 100fps
* pgup/pgdn seek at 1000fps
* home/end seek immediately to the first/last frame
* space begins playing frames. If time values (in seconds) are given
for each frame, then playback is in realtime.
"""
sigTimeChanged = QtCore.Signal(object, object)
sigProcessingChanged = QtCore.Signal(object)

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import subprocess, atexit, os, sys, time, random, socket, signal, inspect
import multiprocessing.connection
try:
@ -234,21 +235,21 @@ class ForkedProcess(RemoteEventHandler):
However, fork() comes with some caveats and limitations:
- fork() is not available on Windows.
- It is not possible to have a QApplication in both parent and child process
(unless both QApplications are created _after_ the call to fork())
Attempts by the forked process to access Qt GUI elements created by the parent
will most likely cause the child to crash.
- Likewise, database connections are unlikely to function correctly in a forked child.
- Threads are not copied by fork(); the new process
will have only one thread that starts wherever fork() was called in the parent process.
- Forked processes are unceremoniously terminated when join() is called; they are not
given any opportunity to clean up. (This prevents them calling any cleanup code that
was only intended to be used by the parent process)
- Normally when fork()ing, open file handles are shared with the parent process,
which is potentially dangerous. ForkedProcess is careful to close all file handles
that are not explicitly needed--stdout, stderr, and a single pipe to the parent
process.
- fork() is not available on Windows.
- It is not possible to have a QApplication in both parent and child process
(unless both QApplications are created _after_ the call to fork())
Attempts by the forked process to access Qt GUI elements created by the parent
will most likely cause the child to crash.
- Likewise, database connections are unlikely to function correctly in a forked child.
- Threads are not copied by fork(); the new process
will have only one thread that starts wherever fork() was called in the parent process.
- Forked processes are unceremoniously terminated when join() is called; they are not
given any opportunity to clean up. (This prevents them calling any cleanup code that
was only intended to be used by the parent process)
- Normally when fork()ing, open file handles are shared with the parent process,
which is potentially dangerous. ForkedProcess is careful to close all file handles
that are not explicitly needed--stdout, stderr, and a single pipe to the parent
process.
"""
@ -405,14 +406,14 @@ class QtProcess(Process):
"""
QtProcess is essentially the same as Process, with two major differences:
- The remote process starts by running startQtEventLoop() which creates a
QApplication in the remote process and uses a QTimer to trigger
remote event processing. This allows the remote process to have its own
GUI.
- A QTimer is also started on the parent process which polls for requests
from the child process. This allows Qt signals emitted within the child
process to invoke slots on the parent process and vice-versa. This can
be disabled using processRequests=False in the constructor.
- The remote process starts by running startQtEventLoop() which creates a
QApplication in the remote process and uses a QTimer to trigger
remote event processing. This allows the remote process to have its own
GUI.
- A QTimer is also started on the parent process which polls for requests
from the child process. This allows Qt signals emitted within the child
process to invoke slots on the parent process and vice-versa. This can
be disabled using processRequests=False in the constructor.
Example::

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from ..Qt import QtCore, QtGui, QtWidgets
from OpenGL.GL import *
import OpenGL.GL.framebufferobjects as glfbo
@ -15,9 +16,9 @@ class GLViewWidget(QtWidgets.QOpenGLWidget):
def __init__(self, parent=None, devicePixelRatio=None, rotationMethod='euler'):
"""
Basic widget for displaying 3D data
- Rotation/scale controls
- Axis/grid display
- Export options
- Rotation/scale controls
- Axis/grid display
- Export options
================ ==============================================================
**Arguments:**

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import numpy as np
from ..Qt import QtGui
from .. import functions as fn
@ -8,11 +9,11 @@ class MeshData(object):
"""
Class for storing and operating on 3D mesh data. May contain:
- list of vertex locations
- list of edges
- list of triangles
- colors per vertex, edge, or tri
- normals per vertex or tri
- list of vertex locations
- list of edges
- list of triangles
- colors per vertex, edge, or tri
- normals per vertex or tri
This class handles conversion between the standard [list of vertexes, list of faces]
format (suitable for use with glDrawElements) and 'indexed' [list of vertexes] format

View File

@ -258,8 +258,8 @@ class Parameter(QtCore.QObject):
Return True if this parameter type matches the name *typ*.
This can occur either of two ways:
- If self.type() == *typ*
- If this parameter's class is registered with the name *typ*
- If self.type() == *typ*
- If this parameter's class is registered with the name *typ*
"""
if self.type() == typ:
return True

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from ..Qt import QtGui, QtCore
from ..python2_3 import asUnicode
import os, weakref, re
@ -9,10 +10,10 @@ class ParameterItem(QtGui.QTreeWidgetItem):
Abstract ParameterTree item.
Used to represent the state of a Parameter from within a ParameterTree.
- Sets first column of item to name
- generates context menu if item is renamable or removable
- handles child added / removed events
- provides virtual functions for handling changes from parameter
- Sets first column of item to name
- generates context menu if item is renamable or removable
- handles child added / removed events
- provides virtual functions for handling changes from parameter
For more ParameterItem types, see ParameterTree.parameterTypes module.
"""

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from collections import OrderedDict
import numpy as np
import copy
@ -52,16 +53,17 @@ class SystemSolver(object):
1) The *defaultState* class attribute: This is a dict containing a
description of the variables in the system--their default values,
data types, and the ways they can be constrained. The format is::
{ name: [value, type, constraint, allowed_constraints], ...}
* *value* is the default value. May be None if it has not been specified
yet.
* *type* may be float, int, bool, np.ndarray, ...
* *constraint* may be None, single value, or (min, max)
* None indicates that the value is not constrained--it may be
automatically generated if the value is requested.
* *allowed_constraints* is a string composed of (n)one, (f)ixed, and (r)ange.
Where:
* *value* is the default value. May be None if it has not been specified
yet.
* *type* may be float, int, bool, np.ndarray, ...
* *constraint* may be None, single value, or (min, max)
* None indicates that the value is not constrained--it may be
automatically generated if the value is requested.
* *allowed_constraints* is a string composed of (n)one, (f)ixed, and (r)ange.
Note: do not put mutable objects inside defaultState!

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import os
from ..Qt import QtCore, QtGui
from ..python2_3 import asUnicode
@ -15,9 +16,9 @@ class WidgetParameterItem(ParameterItem):
"""
ParameterTree item with:
* label in second column for displaying value
* simple widget for editing value (displayed instead of label when item is selected)
* button that resets value to default
* label in second column for displaying value
* simple widget for editing value (displayed instead of label when item is selected)
* button that resets value to default
========================== =============================================================
**Registered Types:**
@ -344,12 +345,12 @@ class SimpleParameter(Parameter):
This parameter is backed by :class:`WidgetParameterItem` to represent the
following parameter names:
- 'int'
- 'float'
- 'bool'
- 'str'
- 'color'
- 'colormap'
- 'int'
- 'float'
- 'bool'
- 'str'
- 'color'
- 'colormap'
"""
itemClass = WidgetParameterItem

View File

@ -4,21 +4,21 @@ Magic Reload Library
Luke Campagnola 2010
Python reload function that actually works (the way you expect it to)
- No re-importing necessary
- Modules can be reloaded in any order
- Replaces functions and methods with their updated code
- Changes instances to use updated classes
- Automatically decides which modules to update by comparing file modification times
- No re-importing necessary
- Modules can be reloaded in any order
- Replaces functions and methods with their updated code
- Changes instances to use updated classes
- Automatically decides which modules to update by comparing file modification times
Does NOT:
- re-initialize exting instances, even if __init__ changes
- update references to any module-level objects
ie, this does not reload correctly:
from module import someObject
print someObject
..but you can use this instead: (this works even for the builtin reload)
import module
print module.someObject
- re-initialize exting instances, even if __init__ changes
- update references to any module-level objects
ie, this does not reload correctly:
from module import someObject
print someObject
..but you can use this instead: (this works even for the builtin reload)
import module
print module.someObject
"""
from __future__ import print_function

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import sys
from ..Qt import QtGui, QtCore
from ..SignalProxy import SignalProxy
@ -9,12 +10,12 @@ __all__ = ['ComboBox']
class ComboBox(QtGui.QComboBox):
"""Extends QComboBox to add extra functionality.
* Handles dict mappings -- user selects a text key, and the ComboBox indicates
the selected value.
* Requires item strings to be unique
* Remembers selected value if list is cleared and subsequently repopulated
* setItems() replaces the items in the ComboBox and blocks signals if the
value ultimately does not change.
* Handles dict mappings -- user selects a text key, and the ComboBox indicates
the selected value.
* Requires item strings to be unique
* Remembers selected value if list is cleared and subsequently repopulated
* setItems() replaces the items in the ComboBox and blocks signals if the
value ultimately does not change.
"""

View File

@ -74,10 +74,10 @@ class DataTreeWidget(QtGui.QTreeWidget):
def parse(self, data):
"""
Given any python object, return:
* type
* a short string representation
* a dict of sub-objects to be parsed
* optional widget to display as sub-node
* type
* a short string representation
* a dict of sub-objects to be parsed
* optional widget to display as sub-node
"""
# defaults for all objects
typeStr = type(data).__name__

View File

@ -9,8 +9,8 @@ class ProgressDialog(QtGui.QProgressDialog):
"""
Extends QProgressDialog:
* Adds context management so the dialog may be used in `with` statements
* Allows nesting multiple progress dialogs
* Adds context management so the dialog may be used in `with` statements
* Allows nesting multiple progress dialogs
Example::

View File

@ -21,11 +21,11 @@ class SpinBox(QtGui.QAbstractSpinBox):
Extension of QSpinBox widget for selection of a numerical value.
Adds many extra features:
* SI prefix notation (eg, automatically display "300 mV" instead of "0.003 V")
* Float values with linear and decimal stepping (1-9, 10-90, 100-900, etc.)
* Option for unbounded values
* Delayed signals (allows multiple rapid changes with only one change signal)
* Customizable text formatting
* SI prefix notation (eg, automatically display "300 mV" instead of "0.003 V")
* Float values with linear and decimal stepping (1-9, 10-90, 100-900, etc.)
* Option for unbounded values
* Delayed signals (allows multiple rapid changes with only one change signal)
* Customizable text formatting
============================= ==============================================
**Signals:**
@ -150,13 +150,13 @@ class SpinBox(QtGui.QAbstractSpinBox):
format (str) Formatting string used to generate the text shown. Formatting is
done with ``str.format()`` and makes use of several arguments:
* *value* - the unscaled value of the spin box
* *suffix* - the suffix string
* *scaledValue* - the scaled value to use when an SI prefix is present
* *siPrefix* - the SI prefix string (if any), or an empty string if
this feature has been disabled
* *suffixGap* - a single space if a suffix is present, or an empty
string otherwise.
* *value* - the unscaled value of the spin box
* *suffix* - the suffix string
* *scaledValue* - the scaled value to use when an SI prefix is present
* *siPrefix* - the SI prefix string (if any), or an empty string if
this feature has been disabled
* *suffixGap* - a single space if a suffix is present, or an empty
string otherwise.
regex (str or RegexObject) Regular expression used to parse the spinbox text.
May contain the following group names:

View File

@ -94,12 +94,12 @@ class TableWidget(QtGui.QTableWidget):
"""Set the data displayed in the table.
Allowed formats are:
* numpy arrays
* numpy record arrays
* metaarrays
* list-of-lists [[1,2,3], [4,5,6]]
* dict-of-lists {'x': [1,2,3], 'y': [4,5,6]}
* list-of-dicts [{'x': 1, 'y': 4}, {'x': 2, 'y': 5}, ...]
* numpy arrays
* numpy record arrays
* metaarrays
* list-of-lists [[1,2,3], [4,5,6]]
* dict-of-lists {'x': [1,2,3], 'y': [4,5,6]}
* list-of-dicts [{'x': 1, 'y': 4}, {'x': 2, 'y': 5}, ...]
"""
self.clear()
self.appendData(data)

View File

@ -242,10 +242,10 @@ class TreeWidgetItem(QtGui.QTreeWidgetItem):
"""
TreeWidgetItem that keeps track of its own widgets and expansion state.
* Widgets may be added to columns before the item is added to a tree.
* Expanded state may be set before item is added to a tree.
* Adds setCheked and isChecked methods.
* Adds addChildren, insertChildren, and takeChildren methods.
* Widgets may be added to columns before the item is added to a tree.
* Expanded state may be set before item is added to a tree.
* Adds setCheked and isChecked methods.
* Adds addChildren, insertChildren, and takeChildren methods.
"""
def __init__(self, *args):
QtGui.QTreeWidgetItem.__init__(self, *args)

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from ..Qt import QtCore, QtGui
from ..ptime import time
from .. import functions as fn
@ -9,8 +10,8 @@ class ValueLabel(QtGui.QLabel):
QLabel specifically for displaying numerical values.
Extends QLabel adding some extra functionality:
- displaying units with si prefix
- built-in exponential averaging
- displaying units with si prefix
- built-in exponential averaging
"""
def __init__(self, parent=None, suffix='', siPrefix=False, averageTime=0, formatStr=None):

View File

@ -1,4 +1,5 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, sys, argparse, random
from shell import shell, ssh
@ -167,16 +168,16 @@ def build(args):
======== Build complete. =========
* Source package: built
* Pip install test: {pip_test}
* Debian packages: {deb_status}
* Windows installers: {exe_status}
* Package files in {pkg_dir}
* Source package: built
* Pip install test: {pip_test}
* Debian packages: {deb_status}
* Windows installers: {exe_status}
* Package files in {pkg_dir}
Next steps to publish:
* Test all packages
* Run script again with --publish
* Test all packages
* Run script again with --publish
""").format(**args.__dict__))

View File

@ -425,10 +425,10 @@ def getVersionStrings(pkg):
"""
Returns 4 version strings:
* the version string to use for this build,
* version string requested with --force-version (or None)
* version string that describes the current git checkout (or None).
* version string in the pkg/__init__.py,
* the version string to use for this build,
* version string requested with --force-version (or None)
* version string that describes the current git checkout (or None).
* version string in the pkg/__init__.py,
The first return value is (forceVersion or gitVersion or initVersion).
"""