Changed the np.int(samps/2) into int(samps/2) for numpy latest compat…#5
Open
roypratyay wants to merge 1 commit intoJackWalpole:masterfrom
Open
Changed the np.int(samps/2) into int(samps/2) for numpy latest compat…#5roypratyay wants to merge 1 commit intoJackWalpole:masterfrom
roypratyay wants to merge 1 commit intoJackWalpole:masterfrom
Conversation
…ibility with int.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.intwas a deprecated alias for the builtinint. To avoid this error in existing code, useintby itself. Doing this will not modify any behavior and is safe. When replacingnp.int, you may wish to use e.g.np.int64ornp.int32to 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