util.valid_audio validates non-Fortran contiguous arrays
See original GitHub issueDescription
Raised during CR of #960 which cl0sed #959. https://github.com/librosa/librosa/pull/960#issuecomment-521862461
Last time we updated valid_audio
was #616 which cl0sed #612
Steps/Code to Reproduce
from librosa import util
import numpy as np
y = np.zeros(1000)
print(util.valid_audio(y))
y_strided = np.zeros(1000)[::2]
print(util.valid_audio(y_strided))
y_clang = np.zeros(1000).reshape(2, 500)
print(util.valid_audio(y_clang, mono=False))
y_fortran = np.asfortranarray(
np.zeros(1000).reshape(2, 500))
print(util.valid_audio(y_fortran, mono=False))
y_fortran_colon = y_fortran[:]
print(util.valid_audio(y_fortran_colon, mono=False))
Expected Results
True
False
False
True
True
Actual Results
True
True
True
True
True
Versions
Darwin-18.6.0-x86_64-i386-64bit
Python 3.7.4 (default, Aug 9 2019, 12:36:10)
[Clang 4.0.1 (tags/RELEASE_401/final)]
NumPy 1.16.4
SciPy 1.3.1
librosa 0.7.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Python numpy array slices are not Fortran Contiguous
Slices of this array are not Fortran contiguous. How can I fix that? hn = hp[0,0:Length-1,:] hn.flags C_CONTIGUOUS : False F_CONTIGUOUS ...
Read more >CONTIGUOUS (Fortran 2008) - IBM
Purpose. The CONTIGUOUS attribute specifies that the array elements of an array pointer, an assumed-shape array TS 29113 begins , or an assumed-rank...
Read more >Source code for sklearn.utils.validation - Mars Documentation
Parameters ---------- spmatrix : sparse matrix Input to validate and convert. ... default=None Whether an array will be forced to be fortran or...
Read more >Aspen Plus User Models - AspenTech Support
Creating Fortran Shared Libraries Using Asplink . ... Flash Utility FLSH_FLASH . ... components are stored in contiguous arrays, from 1 to NCOMP_NCC...
Read more >CDF Frequently Asked Questions - NASA CDF
This program can also be used to validate a CDF. ... in a CDF file and does not require all the data elements...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great. Can we roll changes to
to_mono
into this issue as well?Confirmed, please do!