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>
Saving and loading a RecMeasure, PlayRecMeasure or FRFMeasure with pytta.save and pytta.load failed or lost data: - json.dump failed on NumPy scalars (fftDegree is np.int64); every json.dump now converts them with .item(). - ChannelsList refused NumPy integers, which load passes; it now accepts any NumPy number. - load renumbered a channel and then looked it up again by its old number; channels are now restored by position. - RecMeasure was loaded with channel 0, and the output channels of PlayRecMeasure and FRFMeasure were never restored. - the base fields of a measurement (sampling rate, frequency limits, length domain, comment) were not saved, since _to_dict of the measurements did not call the base one, and the channel code was neither saved nor restored. With this, all tests in tests/test_pyttasave.py and tests/test_h5io.py pass. The coordinates and orientation of channels are saved but still not restored. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 31, 2026
The coordinates and orientation of each channel were saved but not restored on load; they now are, and files without them keep the defaults. Setting a point with x = 0, such as an orientation along the y axis, raised ZeroDivisionError because the azimuth was arctan(y / x); it is now arctan2(y, x), which also gives the right quadrant for x < 0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 31, 2026
[FIX] window the impulse response before filtering for C80, D50 and support (ISO 3382-1, A.3.4)
#127
Open
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.
This PR builds on #52, whose two commits come first, since the tests of
tests/test_pyttasave.pycreate their sweeps withpytta.generate. The change proposed here is the last commit. With it, every test intests/passes (18 of 18 ondevelopmentplus #52), and this addresses #23.Saving and loading a
RecMeasure,PlayRecMeasureorFRFMeasurewithpytta.saveandpytta.loadfailed or lost data. Each cause is fixed where it starts:json.dumpfailed on NumPy scalars (fftDegreeis annp.int64). Everyjson.dumpnow converts them with.item().ChannelsListrefused NumPy integers, whichloadpasses. It now accepts any NumPy number.loadrenumbered a channel and then looked it up again by its old number, which raisedIndexErroras soon as the saved numbers differed from 1, 2, 3, and so on. Channels are now restored by position.RecMeasurewas loaded with a channel 0, and the output channels ofPlayRecMeasureandFRFMeasurewere saved but never restored._to_dictof the measurements did not call the base one, so the sampling rate, frequency limits, length domain and comment were not saved. The channel code was neither saved nor restored. Files written before this change load with the default code.A second commit restores the coordinates and orientation of the channels, which were saved but not restored; files without them keep the defaults. While testing it, setting an orientation along the y axis raised
ZeroDivisionError, becauseCoordinateObjtook the azimuth asarctan(y / x). It now usesarctan2(y, x), which also gives the right quadrant for x < 0.tests/test_pytta_channels.pysaves and loads a channel with coordinates and orientation.Checked with Python 3.12, numpy 1.26 and scipy 1.17.
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com