Skip to content

Commit

Permalink
updated deprecated numpy methods
Browse files Browse the repository at this point in the history
  • Loading branch information
carinecosta committed Oct 7, 2024
1 parent 3fe4af2 commit b2ea9ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions seapy/roms/interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def __interp_grids(src_grid, child_grid, ncsrc, ncout, records=None,
# Compute the max number of hold in memory
maxrecs = np.maximum(1,
np.minimum(len(records),
np.int(_max_memory /
np.int64(_max_memory /
(child_grid.lon_rho.nbytes +
src_grid.lon_rho.nbytes))))
for rn, recs in enumerate(seapy.chunker(records, maxrecs)):
Expand All @@ -327,7 +327,7 @@ def __interp_grids(src_grid, child_grid, ncsrc, ncout, records=None,
ncout.sync()
else:
maxrecs = np.maximum(1, np.minimum(
len(records), np.int(_max_memory /
len(records), np.int64(_max_memory /
(child_grid.lon_rho.nbytes *
child_grid.n +
src_grid.lon_rho.nbytes *
Expand Down Expand Up @@ -372,7 +372,7 @@ def __interp_grids(src_grid, child_grid, ncsrc, ncout, records=None,
srcangle = getattr(src_grid, 'angle', None)
dstangle = getattr(child_grid, 'angle', None)
maxrecs = np.minimum(len(records),
np.int(_max_memory /
np.int64(_max_memory /
(2 * (child_grid.lon_rho.nbytes *
child_grid.n +
src_grid.lon_rho.nbytes *
Expand Down Expand Up @@ -480,7 +480,7 @@ def field2d(src_lon, src_lat, src_field, dest_lon, dest_lat, dest_mask=None,
records = np.arange(0, src_field.shape[0])
maxrecs = np.maximum(1,
np.minimum(records.size,
np.int(_max_memory /
np.int64(_max_memory /
(dest_lon.nbytes + src_lon.nbytes))))
for rn, recs in track(enumerate(seapy.chunker(records, maxrecs)),
total=maxrecs, description="interp 2d".center(20)):
Expand Down Expand Up @@ -550,7 +550,7 @@ def field3d(src_lon, src_lat, src_depth, src_field, dest_lon, dest_lat,
records = np.arange(0, src_field.shape[0])
maxrecs = np.maximum(1,
np.minimum(records.size,
np.int(_max_memory /
np.int64(_max_memory /
(dest_lon.nbytes *
dest_depth.shape[0] +
src_lon.nbytes *
Expand Down
4 changes: 2 additions & 2 deletions seapy/tide.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
__const_file[f]['sat']['phcorr'],
__const_file[f]['sat']['amprat'],
__const_file[f]['sat']['ilatfac'])
__const[f] = __cformat(np.float(__const_file[f]['freq']),
__const[f] = __cformat(np.float64(__const_file[f]['freq']),
__const_file[f]['doodson'],
np.float(__const_file[f]['semi']),
np.float64(__const_file[f]['semi']),
__sat, __shallow)

default_tides = ['M4', 'K2', 'S2', 'M2', 'N2',
Expand Down

0 comments on commit b2ea9ba

Please sign in to comment.