Edouard Choinière
95cafd1a3f
style: Normalise numpy imports with import numpy as np
...
The convention when importing numpy is to use `import numpy as np`
Fixes: unconventional-import-alias (ICN001)
Ruff rule: https://docs.astral.sh/ruff/rules/unconventional-import-alias/
2025-02-08 16:48:57 +00:00
Alexandre Detiste
0257f755cf
remove most of Python2 compatibility code
2025-02-02 20:17:45 -05:00
Alexandre Detiste
beb9932241
remove usage of six.print_()
2025-02-02 20:10:38 -05:00
Randy Döring
f7d1d8188c
Fix NumPy 2.0 deprecations via running ruff ( #2580 )
...
* Fix NumPy 2.0 deprecations via running `ruff check --select NPY201 --fix --exclude docs/sphinx/rest_substitutions/snippets/python/converted`
See https://numpy.org/devdocs/numpy_2_0_migration_guide.html#numpy-2-0-migration-guide
* Use `numpy.any` instead of `any` because the latter does not work for multidimensional arrays.
2024-08-21 19:53:57 -04: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
PChemGuy
af3721f167
Explicit NumPy.float64 to int typecasting in FCObjects.py
...
I cannot tell whether the original code worked before, but this explicit typecasting is necessary now.
The issue occurs, for example if attempting to execute "PieChart.py" or "ScaledBitmap2Demo.py" in "samples\floatcanvas". Without typecasting, type errors are thrown, such as "TypeError: Image.Scale(): argument 1 has unexpected type 'numpy.float64'".
Apparently, this problem might be due to recent updates in Python and NumPy.
2022-08-20 21:43:22 +03:00
PChemGuy
8d771a389c
py3: use six.moves.range instead of xrange
...
The xrange module was removed in Python 3 and we should
use 'six.moves.range' instead of 'xrange' to make
code compatible with py 2 and 3 as well.
2022-08-20 13:58:51 +03:00
Scott Talbert
6da0064551
Replace deprecated PyEval_CallObject with PyObject_CallObject
2022-01-11 17:35:31 -05:00
Christian Clauss
25ba122168
Fix typos discovered by codespell
2021-08-07 18:55:49 +02:00
Robin Dunn
6332e818e7
Add a MacReopenApp method for the superdoodle sample
2020-12-18 15:02:55 -08:00
Robin Dunn
35931985ab
Update some copyright years
2020-11-11 15:55:30 -08: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
Robin Dunn
92f8cd2d55
Fix lots of misspelled words
2020-07-14 11:38:32 -07:00
Robin Dunn
7a05d20d82
Merge pull request #1572 from pbrod/Fix_issue1571
...
Fixes issue 1571:
2020-03-23 16:07:22 -07:00
Robin Dunn
41c5af9cde
Merge pull request #1569 from pbrod/Fix_issue1554
...
Fixes issue # 1554:
2020-03-23 15:35:41 -07:00
Per A. Brodtkorb
e4e8bf8317
Fixes issue 1571:
...
Adding missing close for open.
If the "close()" call is missing after a "open(filename)" call, the filename isn't guaranteed to be closed before the interpreter exits.
This is generally a bad practice as explained here: https://stackoverflow.com/questions/7395542/is-explicitly-closing-files-important
Also replaced "fid=open(filename) fid.close()" statements for files with the safer
"with open(filename) as fid:" blocks. See https://www.python.org/dev/peps/pep-0343/
2020-03-23 17:16:44 +01:00
Per A. Brodtkorb
fc1823315b
Fixes issue # 1554:
...
Replaced "== None" and "!= None" with "is None" and "is not None", respectively, because the former is slower and error-prone.
2020-03-23 11:53:36 +01: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
b680b7f16e
More color name fixes
2020-02-27 14:33:23 -08:00
Robin Dunn
91b4c8077e
No need to call wx.InitAllImageHandlers any more, it is called when wx is first imported.
2020-02-26 09:56:08 -08:00
Robin Dunn
81001efb9b
Use a valid color name
2020-02-26 09:55:17 -08:00
Robin Dunn
d79d9859cb
Switch to a sizer in the superdoodle about box
2019-10-23 18:11:20 -07:00
Robin Dunn
a5a31c96ac
Merge pull request #1412 from wxWidgets/add-archivehandler-example
...
Add an example of viewing html pages from a .zip file
2019-10-23 18:07:25 -07:00
Robin Dunn
9612361045
Add an example of viewing html pages from a .zip file
2019-10-23 14:51:10 -07:00
topic2k
90c355c88e
Use default position for PopupMenu in samples.doodle.doodle.DoodleWindow
2019-10-23 09:43:57 +02:00
Robin Dunn
db2ce6ecb7
change arrow characters
2019-10-22 19:49:09 -07:00
Robin Dunn
93f62789cc
Call MSWSetEmulationLevel
2019-10-22 19:45:34 -07:00
Robin Dunn
c92f2484c0
Show how to use the MemoryFSHandler and a custom WebViewHandler
2019-10-22 19:26:46 -07:00
topic2k
873fd00a41
time.clock() is removed in Python 3.8
...
Two more places where `time.clock()` is called. Adopt the imports accordingly.
2019-09-15 12:55:34 +02:00
Robin Dunn
aa8711ce82
Add README file
2019-09-12 15:05:49 -07:00
Robin Dunn
5680b4adff
wxPyConstructObject should be sufficient so wxPyMake_wxObject is no longer needed.
2019-09-12 14:58:07 -07:00
Robin Dunn
a2e12af3d8
Remove the hack for wx.CallAfter. A fix for wx.GetApp when embedding is on the way
2019-09-12 14:56:18 -07:00
Robin Dunn
1fa7200cbd
Load sip.h from wxPython's include folder
2019-09-12 14:36:29 -07:00
Christoph Schmidt-Hieber
76dea0e4f7
Move ugly hack to even uglier location
2019-09-05 13:22:27 +02:00
Christoph Schmidt-Hieber
36789e3449
Improve robustness of looking up wrapped wxObject
2019-09-05 13:22:00 +02:00
Christoph Schmidt-Hieber
5ebabf4300
Update embedded sample for Linux (gtk3)
2019-09-04 15:52:44 +02:00
Christoph Schmidt-Hieber
1560cb648e
Port embedded sample from Classic to Phoenix
...
Partly addresses issue #1336
2019-09-04 14:39:18 +02:00
Robin Dunn
221a98e902
Merge pull request #1223 from RobinD42/more-build-tweaks
...
More build tweaks
(cherry picked from commit d1b79db2a9
)
2019-05-13 19:59:29 -07:00
Robin Dunn
fb4b52681b
Add doodle sample
...
(cherry picked from commit bfd7bd588b
)
2019-04-12 20:32:41 -07:00
Robin Dunn
6167177c1a
Add a button to the mainloop sample to test wx.PostEvent
...
(cherry picked from commit 53219c9e00
)
2019-02-27 12:59:17 -08:00
Metallicow
230bf5d6d3
Optimize All PNGs Nov2018
...
Since I had to fix a image issue and optimize it. I decided to rerun FileOptimizer 13.30.2393 over all pngs. Small bytes for some that had been optimized before, but this comit covers all pngs that may have been missed in the past. Maybe revisit running them all again in 2 years. Total time to process all pngs: approx 8 hours.
As technology improves this will only get better/faster when downloading, loading in browser, embedded, etc...
2018-11-13 16:08:12 -06:00
Robin Dunn
705aa63d75
Merge branch 'more-windowidref' into wxPy-4.0.x
...
(cherry picked from commit ada7b2fc51
)
2018-06-25 19:12:00 -07:00
Robin Dunn
b77c88a280
Merge tag 'wxPython-4.0.2' into wxPy-4.0.x
...
(cherry picked from commit 4c56c39e52
)
2018-06-17 22:04:22 -07:00
Craig MacEachern
41c0ceb3da
Fix TypeError in samples/hello.py
...
The call to wx.StaticBitmap in hello.py produces a TypeError. The argument should be 'bitmap=bmp' not 'label=bmp'
2017-10-23 10:40:07 -04:00
Robin Dunn
b50b321d0e
Fix some virtual method signatures
2017-04-25 14:37:50 -07:00
Robin Dunn
ac3282148b
Update copyright in packaging and samples
2017-02-13 16:31:34 -08:00
Metallicow
01f8f09f60
Trim trailing space samples directory
2016-12-05 16:34:47 -06:00
Robin Dunn
73f0622bf6
Additional ribbonbar_demo tweaks and cleanup.
2016-08-23 14:29:32 -07:00
Scott Talbert
a3b10d5d63
Fix crash in ribbonbar sample
...
The ArtProvider shouldn't be cloned in this case because SetArtProvider() does
not take ownership of the object in this case. Because of that, once the
cloned provider goes out of scope and gets garbage collected, future uses will
crash.
Fixes #141 .
2016-08-20 23:16:39 -04:00