Skip to content

Changed the np.int(samps/2) into int(samps/2) for numpy latest compat…#5

Open
roypratyay wants to merge 1 commit intoJackWalpole:masterfrom
roypratyay:master
Open

Changed the np.int(samps/2) into int(samps/2) for numpy latest compat…#5
roypratyay wants to merge 1 commit intoJackWalpole:masterfrom
roypratyay:master

Conversation

@roypratyay
Copy link

Changed the np.int(samps/2) into int(samps/2) for numpy latest compatibility with int for the Attribute Error given below.


AttributeError Traceback (most recent call last)
in <cell line: 8>()
6 sample_interval = st[0].stats.delta
7 realdata = sw.Pair(north, east, delta=sample_interval)
----> 8 realdata.plot()

4 frames
/usr/local/lib/python3.10/dist-packages/splitwavepy/core/pair.py in plot(self, **kwargs)
272 # trace
273 ax0 = plt.subplot(gs[0])
--> 274 self._ptr( ax0, **kwargs)
275
276 # particle motion

/usr/local/lib/python3.10/dist-packages/splitwavepy/core/pair.py in _ptr(self, ax, **kwargs)
323 # plot window markers
324 if self.window.width < self._nsamps():
--> 325 w1 = ax.axvline(self.wbeg(),linewidth=1,color='k')
326 w2 = ax.axvline(self.wend(),linewidth=1,color='k')
327

/usr/local/lib/python3.10/dist-packages/splitwavepy/core/data.py in wbeg(self)
100 Window start time.
101 """
--> 102 sbeg = self.window.start(self._nsamps())
103 return sbeg * self.delta
104

/usr/local/lib/python3.10/dist-packages/splitwavepy/core/window.py in start(self, samps)
38 raise Exception('samps must be odd to have definite centre')
39 else:
---> 40 centre = np.int(samps/2)
41 return centre + self.offset - hw
42

/usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr)
317
318 if attr in former_attrs:
--> 319 raise AttributeError(former_attrs[attr])
320
321 if attr == 'testing':

AttributeError: module 'numpy' has no attribute 'int'.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant