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

Binary operations over array of workspaces do not work similar to them working on a single workspace from Python #10799

Closed
abuts opened this issue Jul 18, 2014 · 2 comments
Assignees
Labels
Framework Issues and pull requests related to components in the Framework Stale This label is automatically applied to issues that are automatically closed by the stale bot

Comments

@abuts
Copy link
Member

abuts commented Jul 18, 2014

This issue was originally TRAC 9957

lets assume workspaces w1, w1s, w2 and w2s are loaded in Mantid and can be added together

then the script:

w1=mtd['w1']
ws=mtd['w1s']
w2=mtd['w2']
w2s=mtd['w2s']


ws+=w1;
w2s+=w2;

works as expected and ws and w2s after the script are the sum of the
initial workspace and the addendum.

If, from other side, one tries to work like this:

w1=[mtd['w1'],mtd['w2']]
ws=[mtd['ws'],mtd['w2s']]

for i in xrange(len(ws)):
   ws[i]+=w1[i]
   print "Sum workspace has {0} events in it".format(ws[i].getNumberEvents())

result will be different and ws and w2s in Mantid will remain unchanged despite print row in the loop would report that the workspaces are added together (print will work if the workspaces are event workspaces).

@abuts abuts added the Framework Issues and pull requests related to components in the Framework label Jun 3, 2015
@stale
Copy link

stale bot commented Feb 24, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you feel this is incorrect please comment to keep it alive, with a reason why.

To prevent closure, e.g. for long-term planning issues, add the "Never Stale" label.

@stale stale bot added the Stale This label is automatically applied to issues that are automatically closed by the stale bot label Feb 24, 2021
@stale
Copy link

stale bot commented Mar 3, 2021

This issue has been closed automatically. If this still affects you please re-open this issue with a comment so we can look into resolving it.

@stale stale bot closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework Stale This label is automatically applied to issues that are automatically closed by the stale bot
Projects
None yet
Development

No branches or pull requests

2 participants