question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

util.valid_audio validates non-Fortran contiguous arrays

See original GitHub issue

Description

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:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bmcfeecommented, Aug 16, 2019

Great. Can we roll changes to to_mono into this issue as well?

1reaction
bmcfeecommented, Aug 16, 2019

Confirmed, please do!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found