Closed tomasstolker closed 1 year ago
Ah, originally, the function definition does not allow arrays for after_date
but this can be easily changed. PR #336 adds this functionality (we don't even need the else
because the np.float64 output by np.ceil for single values has the astype
function as well.
Great, thanks a lot!
Sorry I didn't explain it properly I realize now. The problem that I ran into was a case where after_date
is a float instead of None, while tau
, ref_epoch
, and period
are arrays. In that case num_periods
became an array and caused the error.
I agree that for after_date
it is typically not required to use an array but your fix seems fine and adds even a bit more flexibility to the function 👍.
Thanks again 😊
fixed in #336
Hey @sblunt, just a minor issue I ran into: when setting
after_date
intau_to_tp
, it causes an error if the input are arrays instead of floats becausenum_periods = int()
requires a float. This would fix it I think: