Commit Graph

16 Commits

Author SHA1 Message Date
neofelis2X
6f2ca2b5e5 Docs: fix various minor sphinx parsing issues 2025-02-24 23:03:37 +01:00
Tim Riddermann
516539a7a0 Since numpy 1.20 the aliases np.int and np.float are deprecated (see https://numpy.org/devdocs/release/1.20.0-notes.html#using-the-aliases-of-builtin-types-like-np-int-is-deprecated). The buildin types should be used instead. Since numpy 1.24 an AttributeError exception is thrown when np.int or np.float is used. 2023-02-28 16:07:02 +01:00
Anna Petrasova
28b7ba5794 Fix Python 3.10 in lib.plot
Fixes drawing lines
2021-12-29 23:23:33 -05:00
Robin Dunn
d9725119d7 Merge pull request #2039 from swt2c/pygauge_py3.10
Fix a bunch of Python 3.10 issues with pure-Python classes and demos
2021-12-13 20:54:44 -08:00
Scott Talbert
173d079681 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
2021-12-01 14:19:00 -05:00
Christian Clauss
25ba122168 Fix typos discovered by codespell 2021-08-07 18:55:49 +02:00
Robin Dunn
732ff6752b Revert "Spelling fixes in wx.lib"
This reverts commit c00b8950da.
The spelling changes were a bit too aggressive.
2020-08-31 13:01:31 -07:00
Robin Dunn
c00b8950da Spelling fixes in wx.lib 2020-07-14 12:53:31 -07:00
Per A. Brodtkorb
033c18fd9f Fixes issue #1556
Replaced XXX.keys() calls with idiomatic python 3 calls that are compatible with python 2 such as eg:
 * replaced "y = xxx.keys()" or "y = list(xxx.keys())" with just "y = list(xxx)"
 * replaced "sorted(xxx.keys())" or "sorted(list(xxx.keys()))" with just "sorted(xxx)"
 * replaced "if not A in B.keys():" with "if A not in B:"
 * replaced "for A in B.keys():"  with "for A in B:"

See also https://python-future.org/compatible_idioms.html
https://python-future.org/compatible_idioms.html#dict-keys-values-items-as-a-list
2020-03-20 18:51:19 +01:00
Robin Dunn
9723f49ec0 Merge pull request #911 from RobinD42/fix-issue902
Switch deprecation warnings in wx.lib.plot
(cherry picked from commit eac1404fcc)
2018-07-04 00:49:07 -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