Conversation
|
@jl-wynen Do you have any preferences on how to proceed? |
src/scippneutron/conversion/tof.py
Outdated
| return np.NAN if delta_tof <= 0.0 else dE(tof, t0, scale, incident_energy) | ||
|
|
||
| # Converting everything to float64... | ||
| # could make a different branch for float32? |
There was a problem hiding this comment.
Branch? We would need to extend the C++ implementation, no?
There was a problem hiding this comment.
Yes, and branch here to compile two difference numba.cfuncs
There was a problem hiding this comment.
Is there a practical need for single precision floats in this case?
There was a problem hiding this comment.
Could be, inelastic data can be huge.
src/scippneutron/conversion/tof.py
Outdated
| return func(tof, t0, scale, incident_energy) | ||
|
|
||
| # Should we keep this to continue support if the user does not have numba? | ||
| # Or should numba become a mandatory dependency of scippneutron? |
There was a problem hiding this comment.
For now we should keep both because numba is a pretty big dependency. But we need a way to select which implementation is used in order to test both.
There was a problem hiding this comment.
One way would be to use tox, with two different environments (with and without numba)?
There was a problem hiding this comment.
Yes. This would be expensive but thorough because it would ensure that everyhing works without numba.
|
Looks reasonable. Except, we maybe shouldn't use |
Why? |
|
I think it is actually recommended? It avoids putting more than necessary into the |
|
But I was suggesting try:
import numba
except ImportError:
numba = None
[...]
if numba is not None:
def kernel():
...
else:
kernel = None |
Considering some options for using
scipp.elemwise_func. Please see comments in code.