Skip to content

Commit

Permalink
Merge pull request #93 from valeriupredoi/get_rid_deprecated_numpy_dt…
Browse files Browse the repository at this point in the history
…ypes

Get rid deprecated numpy dtypes np.int np.float and np.bool
  • Loading branch information
valeriupredoi authored Mar 22, 2023
2 parents 6c9542a + 3c6b3d6 commit 965de20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions bgcval2/bgcvaltools/bv2tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,10 +953,10 @@ def robinPlotQuad(lons,

if scatter:
if doLogs[i] and spl in [221, 222]:
rbmi = np.int(np.log10(rbmi))
rbmi = np.int32(np.log10(rbmi))
rbma = np.log10(rbma)
if rbma > np.int(rbma): rbma += 1
rbma = np.int(rbma)
if rbma > np.int32(rbma): rbma += 1
rbma = np.int32(rbma)

if doLogs[i]:
ims.append(bms[i].scatter(
Expand Down Expand Up @@ -1199,10 +1199,10 @@ def HovPlotQuad(
axs.append(fig.add_subplot(spl))
if scatter:
if doLogs[i] and spl in [221, 222]:
rbmi = np.int(np.log10(rbmi))
rbmi = np.int32(np.log10(rbmi))
rbma = np.log10(rbma)
if rbma > np.int(rbma): rbma += 1
rbma = np.int(rbma)
if rbma > np.int32(rbma): rbma += 1
rbma = np.int32(rbma)

if doLogs[i]:
ims.append(
Expand Down Expand Up @@ -1463,10 +1463,10 @@ def ArcticTransectPlotQuad(
axs.append(fig.add_subplot(spl))
if scatter:
if doLogs[i] and spl in [221, 222]:
rbmi = np.int(np.log10(rbmi))
rbmi = np.int32(np.log10(rbmi))
rbma = np.log10(rbma)
if rbma > np.int(rbma): rbma += 1
rbma = np.int(rbma)
if rbma > np.int32(rbma): rbma += 1
rbma = np.int32(rbma)

if doLogs[i]:
ims.append(
Expand Down Expand Up @@ -1989,7 +1989,7 @@ def histsPlot(datax,

if logx:
maxd = np.ma.power(10.,
np.int(np.ma.max(np.ma.abs(np.ma.log10(d))) + 1))
np.int32(np.ma.max(np.ma.abs(np.ma.log10(d))) + 1))
print(maxd, 1 / maxd)
n, bins, patchesx = pyplot.hist(d,
histtype='stepfilled',
Expand Down
2 changes: 1 addition & 1 deletion bgcval2/functions/applyLandMask.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
def loadDataMask(areafile, maskname):
global tmask
nc = dataset(areafile, 'r')
tmask[(areafile, maskname)] = np.array(nc.variables[maskname][:].squeeze(), dtype=np.bool)
tmask[(areafile, maskname)] = np.array(nc.variables[maskname][:].squeeze(), dtype=bool)
nc.close()
return tmask[(areafile, maskname)]

Expand Down
2 changes: 1 addition & 1 deletion bgcval2/timeseries/timeseriesTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def getHorizontalSlice(nc, coords, details, layer, data=''):
if type(layer) in [
type(0),
np.int64,
np.int,
int,
]:
k = layer
try:
Expand Down

0 comments on commit 965de20

Please sign in to comment.