-- Fixed #1357 by applying the same direction already discussed upstream, not a new design.
This patch follows the __array_priority__ / reverse-operator approach that later appears in #1373. #1358 is
already merged.
-- Changes:
__array_priority__ = 10 to ArrayContainer__radd__, __rsub__, and __rtruediv__ to DataContainersrc/common/Utilities.py-- Checked the reported cases: ay * x, 1 + x, ax + x, ax - x, ay / x, 2 / x
These now return SIRF containers instead of numpy.ndarray or TypeError.
#1357 repro on the patched branchsrc/xSTIR/pSTIR/tests/tests_data_container_algebra.py -vPlease read and adhere to the contribution guidelines.
Please tick the following:
https://github.com/SyneRBI/SIRF/pull/1378
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Thanks @Dimitra-Kyriakopoulou. can you clarify? This is lifting the _array_priority_ to top-level in the SIRF hierarchy?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
ok. @evgueni-ovtchinnikov will review this. thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
so far as I can see, this PR just duplicates #1373 - I suggest we rather merge #1373, and if my understanding is correct just drop this one
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Dear Professor @evgueni-ovtchinnikov and Professor @KrisThielemans,
I just checked this and Professor Ovtchinnikov is absolutely right. I had myself explicitly referenced #1373, because I understood it as the upstream direction for fixing #1357 rather than as an already complete implementation of it. Because it was still open, and under the time pressure here, I did not realise that #1373 already contained the same functional changes, and in fact, as I now see, also more follow-up work (extra result-type checks and docs/changelog updates). I am deeply sorry for taking your time on this, and I wholeheartedly thank Professor Ovtchinnikov for pointing it out and saving me from unintentionally duplicating existing work -in fact in a way that could have come close to indirect plagiarism.
I AM DEEPLY SORRY,
Dimitra
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
no problem. Closing this.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()