Skip to content

Commit 25672c6

Browse files
committed
Fix references to removed numpy.float alias
Solves GitHub issue #589.
1 parent 0231750 commit 25672c6

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ https://semver.org/spec/v2.0.0.html
1212

1313
## [1.3.9]
1414

15+
### Fixed
16+
- Fix references to removed `numpy.float` alias (solves issue [#589],
17+
thanks to @quickbrett).
18+
1519
## [1.3.8] - 2023-08-18
1620

1721
### Changed
@@ -978,6 +982,8 @@ https://semver.org/spec/v2.0.0.html
978982
- Fix glitches in drawing of parallels and meridians.
979983

980984

985+
[#589]:
986+
https://github.com/matplotlib/basemap/issues/589
981987
[#583]:
982988
https://github.com/matplotlib/basemap/issues/583
983989
[#582]:

packages/basemap/doc/users/figures/plotwindvec.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
uin = data.variables['U-component_of_wind_height_above_ground'][:].squeeze()
2222
vin = data.variables['V-component_of_wind_height_above_ground'][:].squeeze()
2323
# add cyclic points manually (could use addcyclic function)
24-
slp = np.zeros((slpin.shape[0],slpin.shape[1]+1),np.float)
24+
slp = np.zeros((slpin.shape[0],slpin.shape[1]+1),np.float64)
2525
slp[:,0:-1] = slpin[::-1]; slp[:,-1] = slpin[::-1,0]
2626
u = np.zeros((uin.shape[0],uin.shape[1]+1),np.float64)
2727
u[:,0:-1] = uin[::-1]; u[:,-1] = uin[::-1,0]

packages/basemap/src/mpl_toolkits/basemap/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4183,7 +4183,7 @@ def warpimage(self,image="bluemarble",scale=None,**kwargs):
41834183
lon_0 = self.projparams['lon_0']
41844184
lonright = lon_0+180.
41854185
lonleft = lon_0-180.
4186-
x1 = np.array(ny*[0.5*(self.xmax + self.xmin)],np.float)
4186+
x1 = np.array(ny*[0.5*(self.xmax + self.xmin)],np.float64)
41874187
y1 = np.linspace(self.ymin, self.ymax, ny)
41884188
lons1, lats1 = self(x1,y1,inverse=True)
41894189
lats1 = np.where(lats1 < -89.999999, -89.999999, lats1)

packages/basemap/src/mpl_toolkits/basemap/test.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,35 @@ class TestShiftGrid(TestCase):
6060

6161
def make_data_cyc(self):
6262
loncyc = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300,\
63-
330, 360],dtype=np.float)
63+
330, 360],dtype=np.float64)
6464
gridcyc = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,\
65-
11, 0]],dtype=np.float)
65+
11, 0]],dtype=np.float64)
6666
lonoutcyc = np.array([-180, -150, -120, -90, -60, -30, 0, 30,60,90,\
67-
120, 150, 180],dtype=np.float)
67+
120, 150, 180],dtype=np.float64)
6868
gridoutcyc = np.array([[ 6, 7, 8, 9, 10, 11, 0, 1, 2,3,\
69-
4, 5, 6]],dtype=np.float)
69+
4, 5, 6]],dtype=np.float64)
7070
return loncyc, gridcyc, lonoutcyc, gridoutcyc
7171

7272
def make_data_nocyc(self):
7373
lonnocyc = np.array([0, 30, 60, 90, 120, 150, 180, 210, 240, 270,\
74-
300, 330],dtype=np.float)
74+
300, 330],dtype=np.float64)
7575
gridnocyc = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\
76-
10, 11]],dtype=np.float)
76+
10, 11]],dtype=np.float64)
7777
lonoutnocyc = np.array([-180, -150, -120, -90, -60, -30, 0, 30, 60,\
78-
90, 120, 150],dtype=np.float)
78+
90, 120, 150],dtype=np.float64)
7979
gridoutnocyc = np.array([[ 6, 7, 8, 9, 10, 11, 0, 1, 2,\
80-
3, 4, 5]],dtype=np.float)
80+
3, 4, 5]],dtype=np.float64)
8181
return lonnocyc, gridnocyc, lonoutnocyc, gridoutnocyc
8282

8383
def make_data_nocyc2(self):
8484
lonnocyc2 = np.array([15, 45, 75, 105, 135, 165, 195, 225, 255, 285,\
85-
315, 345],dtype=np.float)
85+
315, 345],dtype=np.float64)
8686
gridnocyc2 = np.array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\
87-
10, 11]],dtype=np.float)
87+
10, 11]],dtype=np.float64)
8888
lonoutnocyc2 = np.array([-165, -135, -105, -75, -45, -15, 15,45,75,\
89-
105, 135, 165],dtype=np.float)
89+
105, 135, 165],dtype=np.float64)
9090
gridoutnocyc2 = np.array([[ 6, 7, 8, 9, 10, 11, 0, 1, 2,\
91-
3, 4, 5]],dtype=np.float)
91+
3, 4, 5]],dtype=np.float64)
9292
return lonnocyc2, gridnocyc2, lonoutnocyc2, gridoutnocyc2
9393

9494
def test_cyc(self):

0 commit comments

Comments
 (0)