Faster LOS calc signal with new_calc = True#322
Conversation
Didou09
left a comment
There was a problem hiding this comment.
Fine for me when tests are passing,
But there seems to be an issue with array contiguity in unit tests, do you see why ?
Codecov Report
@@ Coverage Diff @@
## devel #322 +/- ##
==========================================
- Coverage 41.03% 40.26% -0.77%
==========================================
Files 79 79
Lines 23472 26345 +2873
==========================================
+ Hits 9632 10609 +977
- Misses 13840 15736 +1896
Continue to review full report at Codecov.
|
|
Not sure of what you mean by "re assigning" but, the problem came from the fact that the result stored in |
Didou09
left a comment
There was a problem hiding this comment.
Tests passing => nice
2 questions though on val_arr and val_2d (see comments)
| # .................................................................. | ||
| if ani: | ||
| val_2d = func(pts, t=t, vect=-usbis, **fkwdargs) | ||
| val_arr = func(pts, t=t, vect=-usbis, **fkwdargs) |
There was a problem hiding this comment.
val_arr does not seem to have been declared, is it voluntary ?
There was a problem hiding this comment.
we declare for speed ups, see my next comment. (Sorry some times I have to push in order to try it in the ITER clusters).
| else: | ||
| val_2d = func(pts, t=t, **fkwdargs) | ||
| val_arr = func(pts, t=t, **fkwdargs) | ||
| val_2d = val_arr |
There was a problem hiding this comment.
Why is val_2d still necessary if we use val_arr now ?
There was a problem hiding this comment.
val_2d is a memory view. So computations and slicing in the other cases are much faster. val_arr is a numpy array, I thought this could be the origin of the errors in the unit tests (I tried different solutions).
I am benchmarking if there is a faster solution (between using only val_2d or using val_2d and val_arr).
There was a problem hiding this comment.
It looks like they take more or less the same time. I decided to only keep the memory view val_2d. I also tried to declare the variable to see if this helped, no visible changes. So I would leave the simplest solution (with only one variable)
|
Latest results: |
|
If tests pass and you agree. I am ok for merging this PR |
|
Yes :) it looks like everything is working ! |
Same as #308 but for the new algorithm implemented (activated whent
LOS_calc_signal(..., new_calc=True, ...)).Here are the results with the same benchmark
The difference is less obvious than in the OPR, but
new_calc=Trueseems to always yield the best results.(I tried the benchmark in the
hpc-login02cluster)