Re: [Numpy-discussion] casting from datetime64

2019-05-13 Thread Alex Samuel
Thanks! I understand your hesitation; certainly if I am using undocumented APIs (or even if they are otherwise unused) I understand that it will be on my shoulders to preserve compatibility if you change things. But I would definitely like to get basic functionality working with current (and old

Re: [Numpy-discussion] casting from datetime64

2019-05-12 Thread Sebastian Berg
Hi Alex, On Mon, 2019-05-13 at 00:35 -0400, Alex Samuel wrote: > Hi, > > When registering a custom cast function from datetime64 to another > dtype, how can I get the units? > > I am calling PyArray_RegisterCastFunc from NPY_DATETIME. Ideally, > I'd like to register a separate cast function for

[Numpy-discussion] casting from datetime64

2019-05-12 Thread Alex Samuel
Hi, When registering a custom cast function from datetime64 to another dtype, how can I get the units? I am calling PyArray_RegisterCastFunc from NPY_DATETIME. Ideally, I'd like to register a separate cast function for each datetime64 units (or none at all... I don't want all units to be casta