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

@@ -21,7 +21,7 @@ elif ver == 'local':
from floatcanvas import NavCanvas, Resources
from floatcanvas import FloatCanvas as FC
import numpy as N
import numpy as np
## here we create a new DrawObject:
## code borrowed and adapted from Werner Bruhin
@@ -45,7 +45,7 @@ class TriangleShape1(FC.Polygon, ShapeMixin):
L is the length of one side of the Triangle
"""
XY = N.asarray(XY)
XY = np.asarray(XY)
XY.shape = (2,)
Points = self.CompPoints(XY, L)
@@ -59,12 +59,12 @@ class TriangleShape1(FC.Polygon, ShapeMixin):
ShapeMixin.__init__(self)
def CompPoints(self, XY, L):
c = L/ N.sqrt(3)
c = L/ np.sqrt(3)
Points = N.array(((0, c),
Points = np.array(((0, c),
( L/2.0, -c/2.0),
(-L/2.0, -c/2.0)),
N.float64)
np.float64)
Points += XY
return Points
@@ -101,10 +101,10 @@ class DrawFrame(wx.Frame):
FillColor = "CYAN",
FillStyle = "Solid")
Points = N.array(((0,0),
Points = np.array(((0,0),
(1,0),
(0.5, 1)),
N.float64)
np.float64)
data = (( (0,0), 1),
( (3,3), 2),