Skip to content

Fix Panda subclasses being saved as 'Panda' in stimulus_class#2

Merged
alexevag merged 2 commits into
mainfrom
fix/panda-stimulus-class-name
May 11, 2026
Merged

Fix Panda subclasses being saved as 'Panda' in stimulus_class#2
alexevag merged 2 commits into
mainfrom
fix/panda-stimulus-class-name

Conversation

@alexevag
Copy link
Copy Markdown
Contributor

@alexevag alexevag commented May 8, 2026

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

  • Run a TonesPanda task and confirm a row in the Tones table is saved with all 4 columns populated.
  • Confirm StimCondition.stimulus_class = 'TonesPanda' (not 'Panda').
  • Run an existing pure Panda task and confirm it still works (window opens, objects render) and everything is saved correctly in the Database like the stimulus class name.

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
Copy link
Copy Markdown
Contributor

TonesPanda works properly in both a multimodal task and a pure Panda task, saving StimCondition.stimulus_class as TonesPanda or Panda, respectively. All tables and columns are populated.

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.
@alexevag alexevag merged commit acf4c60 into main May 11, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants