Commit Graph

2706 Commits

Author SHA1 Message Date
KIU Shueng Chuan
70c123a95c fix localPos() deprecated warnings 2021-05-13 08:42:45 +08:00
KIU Shueng Chuan
60661f586f fix: QVector3D has no copy constructor 2021-05-13 08:23:06 +08:00
Ogi Moore
96e83b7d43
Merge pull request #1766 from pijyoi/vst_numba_toggle
VideoSpeedTest.py : Add numba checkbox
2021-05-07 08:40:03 -07:00
KIU Shueng Chuan
09ce81655d VideoSpeedTest.py : Add numba checkbox 2021-05-07 15:35:27 +08:00
Nils Nemitz
bfc63bb730
Make plotting with gradients more fun (#1742)
* added convenience functions to better handle plotting with gradients

* docstring correction, example name correction

* retrying to get  documentation format right

* another attempt at cleaning up docs

* Don't hardcode timer type (and docs fixing attempt)

* more docstring re-formatting

* linebreaks in docstrings

* more documentation adjustments

* documentation pass

* some corrections to documentation

* more adjustments to documentation

* again?

* removed some whitespace and redundant blank lines, changed some checks '== None' to 'is None'

* fixed mis-spelling QColor as Qcolor
2021-05-06 23:20:21 -07:00
Martin Chase
2fb7cdafbd
more complete test yields more complete behavior (#1765) 2021-05-05 18:07:34 -07:00
Martin Chase
fa1be1e5bf
show and hide properly for maxTraces; +test (#1764) 2021-05-05 17:08:04 -07:00
Kenneth Lyons
cafe079910
Support horizontal HistogramLUT{Item,Widget} (#1757)
* Improve HistogramLUTItem docs, a few cosmetic changes

* Initial implementation of horizontally-oriented HistogramLUTItem

- Also adds support in HistogramLUTWidget
- Fixes AxisItem orientation bug for vertical orientation
- Make use of GradientEditorItem orientation (fixes another bug for
  vertical orientation)
- Use horizontal orientation in an example for demonstration

* Remove unused HistogramLUTItem option

* A few more minor fixups

* Copy paste bug

* Use f-strings

* Update from review and a couple more minor updates

* Woops

* Add doc for orientation arg

* Add top/bottom orientation to doc. Expand on levelMode doc a bit
2021-05-04 21:25:42 -07:00
Ogi Moore
7dd033c03b
Merge pull request #1759 from alimustafashah/master
#1758 Fixed typo in InfiniteLine (sigclicked vs. sigClicked)
2021-05-03 20:31:51 -07:00
shahmustafa54
e1b1410260 Fixed typo in InfiniteLine (sigclicked vs. sigClicked) 2021-05-04 06:03:17 +05:00
Ogi Moore
cf70cf4395
Merge pull request #1754 from j9ac9k/remove-pytest-extensions-from-ci
Remove pytest extensions from ci
2021-05-01 21:28:49 -07:00
Ogi Moore
2fd5337215 Run processEvents twice to make sure plot is redrawn 2021-05-01 18:05:33 -07:00
Ogi Moore
cb48ce0548 Remove pytest-cov 2021-05-01 14:23:33 -07:00
Ogi Moore
6163a60198 Remove pytest-xdist 2021-05-01 14:23:28 -07:00
Martin Chase
85e2574230
useCupy option should be settable after ImageItem init (#1749)
* do not cache the cupy so the config option can be set later

* getCupy will always return None if the option is not set

* test of failing behavior

* divorce skip from option; restore option after test
2021-04-30 10:41:11 -07:00
Fernando Bordignon
7dc4823cc6
Update symbols documentation and inverted up and down arrows of scatterplotitem (#1747) 2021-04-29 19:34:19 -07:00
pijyoi
4d6a8e4998
add usage of numba (for rescale) (#1695)
* implement rescale using numba

* workaround to pass test_makeARGB.py

* key on (input, output) manually

* remove minimum version check

* signature needs to be a list of signatures

numba considers it a mistake for single-item non-list but works around
it internally

* add numba test to test_makeARGB.py

* add numba as dependency in CI

* handle properly the case where useNumba was already True

* restore useCupy setting after test

* filter numba nan warning

* don't make changes to test_cupy_makeARGB_...
2021-04-28 22:29:09 -07:00
Nils Nemitz
a7bc2b9a63
clean-up of PlotDataItem downsample methods (#1725)
* clean-up of PlotDataItem downsample methods

* high end of range at low end, not zero

Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-04-28 22:07:24 -07:00
Martin Chase
4ee1fe4388
fix bug when plotting boolean arrays (#1748)
* test and fix for plotting boolean arrays

* smaller is faster

* oh, that bool went away

* tests should keep up with optimizations
2021-04-28 21:35:27 -07:00
Ogi Moore
a534132c62
Various performance improvements to pg.Point (#1741)
This change makes use of QPointF methods which perform faster than the python
equivalent methods.  Furthermore, some tests are added.

* Set __slots__ to empty tuple for pg.Point
* Make Point.angle() behave as Vector.angle()
2021-04-28 21:29:47 -07:00
Ogi Moore
fe66f3fd12
Merge pull request #1746 from pijyoi/fix_cprint_remote
fix: cprint of remote output needs decode()
2021-04-28 20:46:24 -07:00
KIU Shueng Chuan
306e9c2498 fix: cprint of remote output needs decode() 2021-04-28 16:38:15 +08:00
Ogi Moore
2cbc86bee1
Merge pull request #1743 from j9ac9k/cleanup-some-static-code-checks
Cleanup some static code checks
2021-04-25 22:01:06 -07:00
Ogi Moore
2d8d1d6d32 Add tmp_module fixture for test_reload 2021-04-25 21:36:42 -07:00
Ogi Moore
7c48233bfa Remove unreachable code 2021-04-25 21:36:23 -07:00
Ogi Moore
38dccf8642 Fix indentation bug with flowchart 2021-04-25 20:10:54 -07:00
Ogi Moore
00a0ddb0d4 Do not import value of mutable attribute
This was brought to the attention via the stack type checker, Easy fix so it is being
implemented.
2021-04-25 20:08:47 -07:00
Ogi Moore
4d388ee633 Use open context-manager instead of file.open()
Static code checker identified multiple places where a file is opened
but is not necessarily closed.  This commit addressed that with the
exception of RemoteGraphicsView.py
2021-04-25 17:05:05 -07:00
Ogi Moore
cf95964678
Merge pull request #1738 from pijyoi/fix_font
use Format_RGB32 when using QImage as paint device
2021-04-24 09:43:42 -07:00
Ogi Moore
d9a3774f6c
Merge pull request #1739 from pijyoi/manual_form
Export dialog: ParameterTree needs 2 columns
2021-04-24 09:41:40 -07:00
Ogi Moore
6a708dc203
Merge pull request #1724 from j9ac9k/use-math-module-for-single-values
Use math module methods for scalars
2021-04-23 23:10:17 -07:00
Ogi Moore
03ea368454 Clean up Errors for CodeQL analyzer
CodeQL identified some errors and warnings, which this commit cleans up.
2021-04-23 22:44:29 -07:00
Ogi Moore
329423f525 Use QTransform.rotateRadians when appropriate
In a few places in the library, we are doing the conversion from radians
to degrees just so we can call QTransform.rotate(), but there is a
QTransform.rotateRadians() method which would be more suitable, thus
making it so we do not have to handle the conversions ourselves
2021-04-23 22:43:57 -07:00
Ogi Moore
e1415cb3a8 Use np.pi or math.pi instead of just pi 2021-04-23 22:43:57 -07:00
Ogi Moore
6a386e723b Fix overflow warning in QColor by using np.isfinite 2021-04-23 22:43:57 -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
314121192a Use math module for isfinite or isnan for scalars
Various places in the library attempt to check if scalars are finite
via numpy methods, which are intended to be used on numpy arrays.  Using
the math module equivalent functions on scalars is significantly faster.

In a few places, I also use numpy methods explicitly (np.all vs. all)
2021-04-23 22:43:57 -07:00
Ogi Moore
b0769f4be9 Use math.radians and math.degrees
Many places in the library were doing radian to degree conversion
via the manual calculation.  Doing timeit benchmarks on my system, I
am able to get a 4x speedup by using math.degrees or math.radians
instead
2021-04-23 22:43:51 -07:00
Ogi Moore
1138c67d45 Use math module trig functions for scalars
This commit replaces the use of np.sin/np.cos/np.tan uses throughout
the library with math.sin/math.cos/math.tan for scalar values
2021-04-23 22:42:46 -07:00
KIU Shueng Chuan
e3372fddc5 specify that ParameterTree needs 2 columns in .ui 2021-04-24 11:21:12 +08:00
Ogi Moore
c4a1cf11a1 Use clip_array or clip_scalar instead of np.clip
Significant performance issues have been identified with np.clip
and thus clip_array was created to speed up the operation.  In addition
clip_scalar was created to clip a scalar value between two other values
this commit replaces many uses of np.clip from operating on scalars to
using clip_scalar instead
2021-04-23 11:53:00 -07:00
Ogi Moore
85c726e49a Replace uses of np.log on scalers with math.log 2021-04-23 11:53:00 -07:00
Ogi Moore
b01e0e0895 Remove unused function and change line calc
Using @pijyoi's suggestion regarding line calculation broadcasting
2021-04-23 11:53:00 -07:00
Ogi Moore
f60fa3b534 Use clip_array instead of np.clip in GLVolumeItem 2021-04-23 11:53:00 -07:00
Ogi Moore
f8cefa6284 Use hypot method to avoid over/underflow errors
Use hypot instead of manual calculation
2021-04-23 11:53:00 -07:00
Ogi Moore
b0a3849960 Use math module methods for singular values
Using numpy methods that are intended for vectorized operations is
substantially slower than using the math module, so when feasible the
math module methods should be used.
2021-04-23 11:53:00 -07:00
KIU Shueng Chuan
fbc86cd2c5 use Format_RGB32 when using QImage as paint device
this allows sub-pixel font antialiasing to take place.
2021-04-23 18:54:21 +08:00
Ogi Moore
a9161e0794
Merge pull request #1735 from pijyoi/fix_dpr
unify _dpiRatio() and devicePixelRatio()
2021-04-22 09:52:09 -07:00
Ogi Moore
9a77c223f0
Merge pull request #1736 from pijyoi/remote_dpr
be hidpi-aware for remote rendering
2021-04-22 09:51:19 -07:00
KIU Shueng Chuan
51871cd01e be hidpi-aware for remote rendering 2021-04-22 17:26:46 +08:00