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/
This commit is contained in:
Edouard Choinière
2025-02-08 16:48:57 +00:00
parent 45f9e89f5d
commit 95cafd1a3f
26 changed files with 233 additions and 233 deletions

View File

@@ -6,7 +6,7 @@ A small test app that uses FloatCanvas to draw a vector plot.
"""
import wx
import numpy as N
import numpy as np
import random
## import the installed version
@@ -95,19 +95,19 @@ class DrawFrame(wx.Frame):
# what the options are.
self.Canvas.AddRectangle((0, -1.1),
(2*N.pi, 2.2),
(2*np.pi, 2.2),
LineColor = "Black",
LineStyle = "Solid",
LineWidth = 1,
FillColor = None,
FillStyle = "Solid",
InForeground = 0)
for tic in N.arange(7):
for tic in np.arange(7):
self.Canvas.AddText("%1.1f"%tic,
(tic, -1.1),
Position = 'tc')
for tic in N.arange(-1,1.1,0.5):
for tic in np.arange(-1,1.1,0.5):
self.Canvas.AddText("%1.1f"%tic,
(0,tic),
Position = 'cr')
@@ -122,10 +122,10 @@ class DrawFrame(wx.Frame):
#Canvas.Draw()
def Plot(self, event = None):
x = N.arange(0, 2*N.pi, 0.1)
x = np.arange(0, 2*np.pi, 0.1)
x.shape = (-1,1)
y = N.sin(x)
data = N.concatenate((x, y),1)
y = np.sin(x)
data = np.concatenate((x, y),1)
Canvas = self.Canvas
self.Canvas.ClearAll()