Closed Famlam closed 1 year ago
p.s.: note for reproducing that the dimension with 15000 points in the example should be the active dimension of spectrum A (and also for B since that only has 1 dimension)
An alternative fix would be to set the undo action directly after modifying the data, so that the user can revert to the previous state, but I prefer to just throw a human readable error before modifying the data.
I cannot reproduce your error. For me, a message is given that the two data sets are not of the same size, and nothing happens.
In my case I use Combine -> Combine Workspaces, and both spectrum A and B an the right side (as 'to combine').
Not sure what I do differently than you....
I made a stupid mistake in my first post.... I wrote 'Combine workspace', but I should've written Insert From Workspace
, the option underneath. (I somehow always mix them up, hence...). Updated that post too. Apologies for this.
Attached is some dummy data that you can use. Just load both json files in ssNake, then follow the steps above.
Just to be sure, this is how it should look just before getting the error (=when you press OK)
Can you reproduce the issue with this @wfranssen ?
Yes, I can now confirm this. This problem is part of Issue #98 "Combine actions do not check broadcasting". Your pull request probably does not cover all problems that can occur for 'Insert', but it is a good start.
I will merge it now. Thanks for the work.
Your pull request probably does not cover all problems that can occur for 'Insert', but it is a good start.
Correct, if you for instance invert spectrum A and B in this PR, an error also pops up. However, in that case the error occurs before data is modified, so that error is "harmless" (and, simultaneously, more difficult to fix).
Thanks for merging!
Combine
->Insert From Workspace
. Select spectrum B in the dialog that pops upThe following error is shown. Note that, despite the error being shown and the appearance nothing happened, the data is modified (badly). Even worse, the undo action is not yet set when the error occurs.
This PR throws a (human-understandable) error and prevents data from being modified if the dimensions are incorrect.