Resolve "Bug when computing THE with respect to TCB"
Closes #115 (closed)
- Prevent Numpy's element-wise operations to compute correctly
the_wrt_tcb_withinitial
Merge request reports
Activity
changed milestone to %v1.2
added bug label
requested review from @Nik
Hi @j2b.bayle, thanks, that solves the issue for me!
added 4 commits
-
613921eb...cbd12911 - 3 commits from branch
master
- 6736eca5 - Correctly computes THE wrt TCB
-
613921eb...cbd12911 - 3 commits from branch
Hi @j2b.bayle ,
thanks, this indeed solves the issue for me. I am quite surprised, that changing the order of t and tps_wrt_tcb in the addition already solves it. Did you figure out what went wrong before?
added 1 commit
- 30e5b52a - Allow multiplication of ForEachObject with arrays
Yes, it's a weird behavior from Numpy. When a custom class implements things that makes it look like a custom array class (methods like
__len__()
), Numpy thinks it can take over and vectorize operations -- and therefore bypass the correct flow of operations in Python. So the customForEachObject.__rmul__()
is never called. That's a known inconsistency in Numpy, and you can change it by specifying a higher operation priority inForEachObject
. That's what I did.So I've reverted back the order of the multiplication when computing the THE wrt TCB, and it seems to work okay with me. Could you both check one last time @mastaa and @Nik?
Edited by Jean-Baptiste BaylePerfect! I'll wait for @mastaa confirmation and then will merge this!
- Resolved by Jean-Baptiste Bayle
Also fixed for me!
I discovered that running
import lisainstrument i = lisainstrument.Instrument(size=10000) i.simulate()
was not a problem. The reason is probably that we need an orbit file with a non-zero TPS to TCB deviation?!
added 8 commits
-
30e5b52a...cf9bc90e - 7 commits from branch
master
- d34f3a55 - Allow multiplication of ForEachObject with arrays
-
30e5b52a...cf9bc90e - 7 commits from branch
enabled an automatic merge when the pipeline for d34f3a55 succeeds
mentioned in commit 49744210