from pwlf import PiecewiseLinFit
import numpy as np
fit = PiecewiseLinFit(np.linspace(0, 10, dtype=np.float128), np.random.random(50))
fit.fit(2)
fit.p_values()
Traceback (most recent call last):
File "/home/doron/repos/lab-ion-trap-simulations/./pwfit_float128_bug.py", line 8, in <module>
print(fit.p_values())
^^^^^^^^^^^^^^
File "/nix/store/8p528p5cji81aidpbpwiyyz5s9nb1lz4-python3-3.12.8-env/lib/python3.12/site-packages/pwlf/pwlf.py", line 1484, in p_values
p = 2.0 * stats.t.sf(np.abs(t), df=n - k - 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/8p528p5cji81aidpbpwiyyz5s9nb1lz4-python3-3.12.8-env/lib/python3.12/site-packages/scipy/stats/_distn_infrastructure.py", line 2203, in sf
place(output, cond, self._sf(*goodargs))
^^^^^^^^^^^^^^^^^^^
File "/nix/store/8p528p5cji81aidpbpwiyyz5s9nb1lz4-python3-3.12.8-env/lib/python3.12/site-packages/scipy/stats/_continuous_distns.py", line 7716, in _sf
return sc.stdtr(df, -x)
^^^^^^^^^^^^^^^^
TypeError: ufunc 'stdtr' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
The following MWE:
Errors for me with:
However, without the
dtype=np.float64, no error.