Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate changed stimsets better #1908

Merged
merged 12 commits into from
Oct 11, 2023
Merged

Propagate changed stimsets better #1908

merged 12 commits into from
Oct 11, 2023

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented Sep 28, 2023

Since the introduction of combine epochs for the wavebuilder in 9b80987
(WaveBuilder: Add new epoch type Combine, 2015-11-12) we need to maintain
a wave with the shorthand<->full name mapping. This mapping is updated in
WB_UpdateEpochCombineList.

Now that function was not called when loading stimsets from NWB and not
after starting the wavebuilder panel which resulted in errors trying to
recreate combine epochs.

This is now fixed. In order to make the fix less hacky we also introduced
WB_UpdateChangedStimsets which also calls
DAP_UpdateDaEphysStimulusSetPopups which needs to be called in the same
cases.

Close #1907.

@timjarsky The issue is a plain list updating issue. The stimset itself is good.

@timjarsky
Copy link
Collaborator

@t-b I'm getting:

Stimset : Could not create the wave from formula of version 1
  WB_FillWaveFromFormula: Error executing the formula "ten_da_0?+twenty_da_0?+forty_da_0?+eighty_da_0?+onesixty_da_0?+threetwenty_da_0?"

@timjarsky timjarsky assigned t-b and unassigned timjarsky Sep 28, 2023
t-b added 5 commits September 29, 2023 19:15
Since the introduction of combine epochs for the wavebuilder in 9b80987
(WaveBuilder: Add new epoch type Combine, 2015-11-12) we need to maintain
a wave with the shorthand<->full name mapping. This mapping is updated in
WB_UpdateEpochCombineList.

Now that function was not called when loading stimsets from NWB and not
after starting the wavebuilder panel which resulted in errors trying to
recreate combine epochs.

This is now fixed. In order to make the fix less hacky we also introduced
WB_UpdateChangedStimsets which also calls
DAP_UpdateDaEphysStimulusSetPopups which needs to be called in the same
cases.
@t-b t-b force-pushed the bugfix/1908-combine-stimsets branch from d5ae84c to de23b63 Compare September 29, 2023 17:22
@t-b
Copy link
Collaborator Author

t-b commented Sep 29, 2023

@timjarsky Please try again. I do need a demo if it is still broken.

@t-b t-b assigned timjarsky and unassigned t-b Sep 29, 2023
@timjarsky
Copy link
Collaborator

@t-b after inducing the issue, then trying combine a single stimset, I get:

  Stimset : Could not create the wave from the formula** Make gave error: the number of points in a wave must be between 0 and 214700 million.

@timjarsky timjarsky assigned t-b and unassigned timjarsky Sep 29, 2023
@t-b
Copy link
Collaborator Author

t-b commented Sep 29, 2023

Bug is present if one stimset is named like the end of another stimset. The function WB_FormulaSwitchToShortHand does buggy replacement.

@t-b t-b assigned timjarsky and unassigned t-b Oct 2, 2023
@t-b
Copy link
Collaborator Author

t-b commented Oct 2, 2023

@timjarsky Please try again.

t-b added 4 commits October 3, 2023 19:53
Since forever we just gathered the stimset lists for the currently created
combine epoch. But we can do it actually more efficient if we store these
lists permanently.

And by filling epochCombineList on creation initially we also avoid
recreation issues where neither a wavebuilder panel was created nor a
device locked.
When we don't have any stimsets the for-loop would never finish.
Forgotten in effe355 (MIES_WaveBuilderPanel.ipf: Add
GetEpochParameterNames, 2021-05-28).
@t-b t-b force-pushed the bugfix/1908-combine-stimsets branch from 4b57da8 to a3ee26b Compare October 3, 2023 17:54
@t-b
Copy link
Collaborator Author

t-b commented Oct 3, 2023

Tests should be fixed.

@t-b t-b enabled auto-merge October 3, 2023 17:54
@t-b t-b assigned t-b and unassigned timjarsky Oct 3, 2023
@t-b
Copy link
Collaborator Author

t-b commented Oct 3, 2023

Tests are still failing.

t-b added 3 commits October 3, 2023 22:27
We must not just replace stimset names as two stimsets might have the same
ending substring.

By just replacing only full words we avoid the issue without having to
change what we store in WPT.

Bug introduced in the initial version in 9b80987 (WaveBuilder: Add new
epoch type Combine, 2015-11-12).
@t-b t-b force-pushed the bugfix/1908-combine-stimsets branch from a3ee26b to ee589bc Compare October 3, 2023 20:27
@t-b t-b assigned timjarsky and unassigned t-b Oct 3, 2023
@t-b t-b merged commit b7140bb into main Oct 11, 2023
16 checks passed
@t-b t-b deleted the bugfix/1908-combine-stimsets branch October 11, 2023 20:23
@timjarsky timjarsky assigned t-b and unassigned timjarsky Oct 11, 2023
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.

wavebuilder "combine" not working with multiple addition
2 participants