Commit Graph

90 Commits

Author SHA1 Message Date
Nathan Jessurun 6f44d27f2d Deprecate `values` opt for list parameter 2021-08-05 15:48:09 -04:00
KIU Shueng Chuan 371facb17f SVGExporter.py : fix background color
1) blue and green were swapped
2) %f used for integer rgb components
3) %d used for float opacity component
2021-08-04 09:19:46 +08:00
KIU Shueng Chuan efa662415e use QColor methods and functions 2021-08-04 09:19:34 +08:00
Kyle Sunden a472f8c5de
Remove all usage of python2_3.py (#1939)
* Remove all usage of python2_3.py

Technically these functions were exported at the top level of the library, this removes them without warning... If we want to we can bring them back for there, but I honestly don't think its needed, as we are py3 only now and have been for multiple releases.

This may introduce a number of 'useless cast' or similar but those were always happening anyway

This PR brought to you by sed

* Update varname in hdf example to avoid collision with builtin

* Clean up some leftover comments surrounding imports of compat code

* Unnecessary string casts

* Additional unnecessary casts

* syntax error fix

* more unnecessary casts

* Yet more unnecessary casts
2021-08-01 21:43:32 -07:00
Kyle Sunden 6a59b7e5b5
Many unused import cleanups (#1935)
* Many unused import cleanups

Ignored some star imports, some vendored code in colorama, only looked within pyqtgraph the library, not e.g. examples

* SpinBox decimal imported with both import and from import
2021-07-31 07:35:23 -07:00
KIU Shueng Chuan 04673ac98b rename: qimage_to_ndarray -> ndarray_from_qimage 2021-07-31 21:10:34 +08:00
KIU Shueng Chuan 6a2bfa5c84 fix PyQt6 long spelling for enums 2021-06-10 03:33:04 +08:00
KIU Shueng Chuan 765f9648cd remove little-endian assumption for image export 2021-06-10 03:18:12 +08:00
Ogi Moore d455da9aec Use Qt6 Enum Namespace
This namespace appears to be valid in PySide2/PyQt5 5.12+ so we may as
well migrate to the newer namespace ourselves.
2021-06-08 21:23:49 -07:00
Ogi Moore a6971c768d Move and Update test-data repo into pyqtgraph repo
To reduce complexity, and make it easier to add more images and tests,
the images in the `test-data` repository should be merged with the main
repository.  Furthermore, we can remove a lot of the subprocess work in
the image_testing.py file, as we no longer need to have it interact with
git.

The images are not the same.  Images were regenerated with Qt6, and now
have proper big and little endian handling thanks to @pijyoi

Second commit is a slightly modified variant of
2e135ab282d6007b34a3854921be54d0e9efb241 authored by @pijyoi
it is to convert qimages to RGBA8888 for testing.  Image
files were regenerated images for the big/little handling

Fixed issue with bogus test from test_NonUniformImage and generated a
new image
2021-05-31 21:05:00 -07:00
Ogi Moore 7c48233bfa Remove unreachable code 2021-04-25 21:36:23 -07:00
Ogi Moore d14a90112c Have test_svg use GraphicsLayoutWidget not the Deprecated GraphicsWindow 2021-02-12 13:08:00 -08:00
KIU Shueng Chuan 310afebe56 fix svg.setResolution(int) deprecation warning
triggered only for PyQt binding, Python 3.8, 3.9

there is a mismatch in API:
- QScreen.logicalDotsPerInchX() -> float
- QSvgGenerator.setResolution(int)
2021-02-06 17:43:12 +08:00
KIU Shueng Chuan 185f9c7dad remove scale, rotate and translate shims 2021-02-01 09:06:23 +08:00
Sérgio Peixoto 3f02b30140
Bugfix/wrong translate implementation (#1520)
* Removes all translate call on the parameter name and moves them into the title instead allowing to decouple visualization from code logic

* Removes all translate calls from the Exporter class property Name and moves the translation logic when setting the QListWidgetItems for the formatList

* Adds missing call to translation function for the export action on GraphicsScene
2021-01-28 08:42:18 -08:00
Ogi Moore b54aa3914d
Attempt i18n localization (#1513)
* Trying translate on exporter strings

* Try translate on other misc context menu strings

* First f-string and I screw it up...

* add more translation calls
2021-01-27 11:34:32 -08:00
KIU Shueng Chuan 6c760f3de1 add PyQt6 to CI
skip tests that don't work for Qt6

add Qt6 and remove Qt4 from test_examples.py

update README.md

switch mouse tests to use QPointF

this eliminates all the special casing for different bindings
2021-01-23 08:31:00 +08:00
KIU Shueng Chuan c0336acc11 bug: style() should have been styleHint()
Style is enum for { StyleNormal, StyleItalic, StyleOblique }
2021-01-23 08:29:52 +08:00
KIU Shueng Chuan 0fa4557ad6 don't cast buttons, enums and flags to int 2021-01-23 08:29:44 +08:00
Ogi Moore 901f772b5f Skip matplotlib qt6 tests 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan cc2b811ed1 drop usage of QDesktopWidget
this drops support for Qt4
2021-01-15 08:25:08 +08:00
KIU Shueng Chuan 1a6918a241 replace QDesktopWidget() with QGuiApplication.primaryScreen()
the "try, except" could be dropped if we drop Qt4 support.

however, primaryScreen() may not be the right screen.
2021-01-15 08:25:07 +08:00
Gabriele Buondonno cae1c66c78
Fix width, height and background in SVG exporter (#1401)
* [SVGExporter] Fix width and height

* [SVGExporter] Fix background color

* [SVGExporter] Remove f-strings

* [Exporter] Fix for QtGui.QGraphicsScene

* Revert "[Exporter] Fix for QtGui.QGraphicsScene"

This reverts commit 5bdd25ea40.

* [test_svg] Fix unit test
2020-10-27 21:27:31 -07:00
Carlos Pascual 23a46b5fb9
Add "left" and "right" step Modes (#1360)
* Add "lstep" and "rstep" step Modes

stepMode is currently either True or False. If it is True,
it requires the user to make len(x) = len(y)+1. This is
inconvenient because it makes it difficult to change the
stepMode on a given curve (just as one would change, e.g.,
its color).

This commit extends the current situation by introducing
two more step modes: "lstep" and "rstep", which do not require
passing an extra x value. In turn, this modes associate each
y value to either the left or the right boundary of the step.

For example, the "rstep" mode is handy when plotting "life"
digital signals in which x,y data pairs are appended as they
are read.

This commit does not modify the behaviour in case of stepMode=True

* Replace step mode names: lstep,rstep -> left,right

* Improve docs for stepMode

Reword docstring and add it to PlotDataItem class too

* Document left and right stepModes as added in v 0.12.0

TODO: confirm the exact version number to use here

* Add comments stress the need for "is True"

Some conditional statements in the code regarding stepMode are
done with "is True". This is actually required since other
possible values such as "left" also evaluate as true but should
not be caught.

* Deprecate boolean API for stepMode

Introduce stepMode="mid" as a replacement of stepMode=True,
but keeping full backwards compatibility with the old API.
Adapt docs, examples and tests accordingly.

* Raise ValueError on unsupported stepMode values

* Rename "mid" step mode to "center"

* Remove "added in 0.12.0" note

See https://github.com/pyqtgraph/pyqtgraph/pull/1360#discussion_r502746919

* Add deprecation warning when stepMode=True

Issue a DeprecationWarning if stepMode=True is being passed to the
constructor or setData() of PlotDataItem or PlotCurveItem.

Note: warnings module is imported locally so that it is esier to
remove once this check is no longer needed.

* Fix wrong syntax in last commit

Fix usage of "default" kwarg in dict.get()
2020-10-13 08:52:07 -07:00
Kenneth Lyons 4110b3e539
Handle axis SI prefix scaling in MatplotlibExporter (#1282)
* Handle axis SI prefix scaling in MatplotlibExporter

* Added some MatplotlibExporter tests and added matplotlib to CI deps

* Install mpl with pip instead of conda

* Cleanup
2020-06-28 08:51:34 -07:00
Karl Georg Bedrich 68b8dbac1a
moved some functionality from method 'export' to new method (#390)
* moved some functionality from method 'export' to new method
'getSupportedFormats' making it accessible from outside
2020-06-01 11:05:39 -07:00
Ogi 173a755b6c Encode csv export header as unicode 2020-05-30 21:13:20 -07:00
2xB 1e81f3dad0 SVGExporter: Correct image pixelation. 2020-04-08 01:14:36 +02:00
Kenneth Lyons 3ba76475d4 Added ImageExporter test for py2-pyside fix 2020-04-03 09:30:23 -07:00
Unknown 6985be2a6f replaced incompatible string construction 2020-03-01 17:46:01 +01:00
Kenneth Lyons ec445e7601 HDF5Exporter handling of ragged curves with tests (#1072)
* HDF5Exporter handles ragged curves by saving them into different datasets based on their names.

* Add HDF5Exporter tests

* Document HDF5Exporter

* Fix tmp file path
2019-11-12 09:01:49 -08:00
Kenneth Lyons faef56c3e7 Qulogic py3 fixes (#1073)
* py3k: Remove reduce calls.

* py3k: Remove compatibility sortList function.

Sorting by key has existed since Python 2.4.

* Remove unnecessary sys.path manipulation.

This file doesn't have any __main__ code to run anyway.

* Use context manager
2019-11-12 08:45:42 -08:00
Kenneth Lyons 61ec73a741 Close windows at the end of test functions (#1042)
* Close windows at the end of test functions

* Can't show window deletion warning during interpreter shutdown
starting
2019-09-27 13:37:40 -07:00
Elliott Sales de Andrade 3edbef6c57 Ensure exported images use integer dimensions.
It seems that the parameter tree doesn't enforce the int type very
strongly.

Also, use some local variables more often.
2019-09-13 01:07:57 -04:00
Axel Jacobsen 27d94cae92 enforce utf-8 encoding for casting QByteArray to str
remove print statements
2019-08-06 12:00:31 -07:00
Ogi c69e04db2d Simpler way of extracting types from QByteArray
Simpler way of extracting bytes from QByteArray
2019-05-25 00:24:48 -07:00
2xB e2b01ccf74 FIX: Correct deletion of matplotlib exporter window object (#868)
E.g. when opening the Matplotlib exporter multiple times, and one closes one instance, Python crashes.
This is caused by the Matplotlib QMainWindow listening to the closeEvent and deleting the only reference of
the window before it is closed properly.
2019-05-23 21:35:01 -07:00
HappyTreeBeard 8420fe984a Fixed bug in unit test where temp file remained open when os.unlink was called (#832) 2019-05-23 21:33:23 -07:00
Ales Erjavec 56950479f9 SVGExport: Initialize option.exposedRect for items that use it 2018-07-06 15:53:28 +02:00
Luke Campagnola 0af4706024
Merge pull request #635 from campagnola/pyside2
WIP: PySide2 support
2018-05-24 17:14:11 -07:00
Luke Campagnola 66dcfc7c67 Merge branch 'develop' into pyside2 2018-05-22 15:22:54 -07:00
Luke Campagnola a86ab30578 fix iteritems 2018-05-15 16:37:20 -07:00
Luke Campagnola ee2d00c42a Add option to remove non-scaling-stroke from svg output 2018-04-25 12:15:14 -07:00
Luke Campagnola 56aae02821 fix svg export failure when first line point is masked 2018-04-25 11:54:06 -07:00
Luke Campagnola d1c027b87d
Merge pull request #641 from markotoplak/qt5_axis_scale
SVGExporter: fix axes position and scale
2018-03-29 18:03:18 -07:00
Luke Campagnola f79bd8d4fb svg export fix: more explicit check 2018-03-29 09:06:20 -07:00
Marko Toplak c7a32d8311 SVG export: handle Qt.NoPen on Qt5 2018-03-02 09:46:51 +01:00
Marko Toplak d09fe6bd47 SVGExporter: logicalDpiX instead of physicalDpiX
Fixes problems with non-aligning axes on Qt5 svg exports.  In the output
svg, the axes were (individually) scaled for physical/logical ration.
2018-03-01 15:40:10 +01:00
Luke Campagnola 82afad8366 Fix up Qt.py and deprecate USE_XX variables 2018-02-16 20:42:34 -08:00
Luke Campagnola 6287874b5c Minor fix - check for ragged array length when exporting to hdf5 2017-09-13 21:37:19 -07:00