Repository navigation
Conversation
The name given to generated objects was read by a block copied in 20 places that walked the stack with traceback.walk_stack(None). Since Python 3.12 it starts four frames up instead of two, so in a plain script it walks past the end of the stack and pytta.generate.sweep() raises AttributeError at module level and UnboundLocalError inside a function. One helper, _instanceinfo.caller_name, replaces the copies: it walks from the caller explicitly and returns an empty name when the source line is not available (python -c). Tests run real scripts in a subprocess, since under pytest the stack is deep enough to hide the failure. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
scipy.signal.hann and scipy.signal.tukey were removed in SciPy 1.13. The five calls now use scipy.signal.windows, the same functions with the same defaults. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nals Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
Two crashes that a smoke test of the exported functions found on
development, each with a test that fails without the fix:peak_timeraisedIndexErrorwhenever the largest magnitude of a channel is a negative sample, which is common in impulse responses.ImpulsiveResponseraisedValueError: Window length M must be a non-negative integerfor short signals.peak_time
The function looked for the sample equal to the absolute value of the peak,
np.where(x == abs(max|x|)), which finds nothing when that peak is negative. It now takesnp.argmax(np.abs(x)), the sample of the largest magnitude whatever its sign.Short signals in the regularization
_calculate_regu_spkcrossfades the regularization from freqMin / √2 to freqMin with a Hann window over the bins between them. For a short signal those two frequencies can fall in neighbouring bins, or in the same one: 4096 samples at 48 kHz give bins of 11.7 Hz, and the default freqMin of 17.8 Hz leaves 5 Hz for the crossfade. The window lengthf1idx - f0idxwas then negative. A crossfade narrower than one bin now becomes a switch at the first bin from the lower frequency, which is what the window tends to as its length goes to zero. Signals long enough to resolve the crossfade are not affected.Tests
tests/test_peak_and_short_regularization.py:[0.3, 0.7].This pull request builds on #52, whose fix of
scipy.signal.windows.hannthe regularization needs, and shows its commit until #52 is merged. On top of #52 the 3 failures intest_pyttasave.pythat #60 fixes are the same with and without this change. Checked with Python 3.12, numpy 1.26 and scipy 1.17.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com