Commit Graph

11 Commits

Author SHA1 Message Date
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
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
Robin Dunn
d265d13f6c Spelling fixes in the demo 2020-07-14 12:00:55 -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
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
Metallicow
c273dfa9b1 Trim Trailing Whitespace demos 2016-11-24 19:26:05 -06:00
Werner F Bruhin
ca162ee926 - a few Py3 changes
- add tags
2014-05-26 12:58:45 +02:00
Robin Dunn
ea181b5b72 PR57: Mainly style changes, a few white space stuff and an xrange to range change.
* Phoenix FONTFAMILY, STYLE, WEIGHT Fixes
* PENSTYLE_ & BRUSHSTYLE_ Fixes
* Fix FONTWEIGHT to FONTSTYLE typo
* Phoenix Deprecations: wx.OPEN to wx.FD_OPEN
* Phoenix Deprecations: wx.SAVE to wx.FD_SAVE

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-23 00:19:55 +00:00
Robin Dunn
d64b6bb204 print('with parenthesis') fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-05 22:56:14 +00:00
Robin Dunn
f039f7c367 Initial port of wxPython demo from Classic to Phoenix.
Pulled and squashed from https://github.com/RobinD42/Phoenix/pull/7
Thanks Metallicow!

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 06:06:29 +00:00
Robin Dunn
f96e25db1f Copy the wxPython demo from Classic
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-11 18:24:09 +00:00