Fix Panda subclasses being saved as 'Panda' in stimulus_class#2
Merged
Conversation
Replace the hardcoded name() override on Panda/OpenfieldPanda (which returned the literal 'Panda' for every subclass) with a class-attribute flag for ShowBase mix-in tracking. The new init() preserves the original class name, so the base Stimulus.name() returns the correct subclass name (e.g. TonesPanda) automatically. Also fixes typos in tones_panda.py default_key (defalut_key, tone_ulse_freq, tone_pcolor, light_volume) and adds 'Tones' to cond_tables so tone parameters are saved completely.
Contributor
|
TonesPanda works properly in both a multimodal task and a pure Panda task, saving |
Add an inline comment describing why init() rebinds self.__class__ to a (cls, ShowBase) subclass at runtime, and why the _showbase_mixed flag guards against re-wrapping on repeated init() calls.
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.
Replace the hardcoded name() override on Panda/OpenfieldPanda (which returned the literal 'Panda' for every subclass) with a class-attribute flag for ShowBase mix-in tracking. The new init() preserves the original class name, so the base Stimulus.name() returns the correct subclass name (e.g. TonesPanda) automatically.
Also fixes typos in tones_panda.py default_key (defalut_key, tone_ulse_freq, tone_pcolor, light_volume) and adds 'Tones' to cond_tables so tone parameters are saved completely.
@GratsakisA Could you please check that this fixes the Tones_Panda issue and that Panda works fine ??