Commit Graph

9 Commits

Author SHA1 Message Date
Anna Petrasova
62e9c7881e Fix Python 3.10 in lib.plot
Fixes drawing lines

(cherry picked from commit 28b7ba5794)
2022-02-15 20:21:08 -05:00
Scott Talbert
8c43b40baf Fix a bunch of Python 3.10 issues with pure-Python classes and demos
In Python 3.10, a change[1] was implemented where extension functions
that take integer arguments will no longer silently accept non-integer
arguments (e.g., floats) that can only be converted to integers with a
loss of precision.  This PR fixes most of these issues in the pure-Python
classes and demos by explicitly converting the parameters to int before
passing them to wxWidgets.  There is loss of precision, but this was
happening before (automatically) anyway as most wxWidgets DeviceContext
functions operate using integers.

Additionally, the PR fixes a few sizing issues, mostly with SpinCtrls being
too small on GTK3.

This is an example of the relevant exception:
Traceback (most recent call last):
  File "/usr/lib64/python3.10/site-packages/wx/lib/agw/pygauge.py", line 355, in OnPaint
    r.width = w
TypeError: 'float' object cannot be interpreted as an integer

Fixes #2038.

[1] https://bugs.python.org/issue37999

(cherry picked from commit 173d079681)
2022-02-15 20:16:53 -05:00
Robin Dunn
0ea6f19bad Switch wx.lib.plot to use a warning class derived from a new wx.wxPyDeprecationWarning so it doesn't need to enable all warnings by default. 2018-07-03 21:10:28 -07:00
Robin Dunn
77de0cfb7d Merge branch 'refactor-lib.plot-part3' of https://github.com/dougthor42/Phoenix into dougthor42-refactor-lib.plot-part3 2017-09-08 09:20:11 -07:00
Robin Dunn
fc10486740 Ensure there are at least 3 points in the list for DrawSpline 2017-06-30 13:22:31 -07:00
Douglas Thor
600cfb4d6c Miscellaneous cleanup, moved pairwise to utils.py 2016-11-28 14:53:35 -08:00
Douglas Thor
8832bb7880 Documentation fixes.
+ added deprecation note to docstring of PolyPoint.setLogScale
+ Replaced PendingDeprecation decorator with function.
  + This fixes the documentation having `wrapper(*args, **kwargs)`
+ Fixed some minor errors due to package conversion
+ Updated sphinx x-refs to reflect new package structure.
2016-11-28 14:40:59 -08:00
Douglas Thor
15a8b2d13b Documentation updates
+ Sphinx cross-references and pylint: disable
+ Added __docformat__ and import comments
2016-07-07 09:13:20 -07:00
Douglas Thor
81244b6a7e Renamed plot.py to polyobjects.py
+ Moved DisplaySide, scale_and_shift_point, and set_displayside to utils.py
  + renamed _DisplaySide to DisplaySide
  + renamed _set_displayside to set_displayside
+ updated imports to reflect package rename
+ changed format of imports in __init__.py to be more PEP8-like.
+ updated numpy import exception
+ whitespace cleanups.
2016-07-07 09:13:20 -07:00