[Numpy-discussion] code review for datetime arange
Thu Jun 9 16:27:19 CDT 2011
On Thu, Jun 9, 2011 at 10:58 PM, Mark Wiebe <firstname.lastname@example.org> wrote:
> On Thu, Jun 9, 2011 at 3:41 PM, Christopher Barker <Chris.Barker@noaa.gov>
> Your branch works fine for me (OS X, py2.6), no failures. Only a few
deprecation warnings like:
DeprecationWarning: DType strings 'O4' and 'O8' are deprecated because they
are platform specific. Use 'O' instead
> Mark Wiebe wrote:
>> > Because of the nature of datetime and timedelta, arange has to be
>> > slightly different than with all the other types. In particular, for
>> > datetime the primary signature is np.arange(datetime, datetime,
>> > I've implemented a simple extension which allows for another way to
>> > specify a date range, as np.arange(datetime, timedelta, timedelta).
>> Did you think about how to document which of these basic functions work
with datetime? I don't think that belongs in the docstrings, but it may then
be hard for the user to figure out which functions accept datetimes. And
there will be no usage examples in the docstrings.
Besides docs, I am not sure about your choice to modify functions like
arange instead of writing a module of wrapper functions for them that know
what to do with the dtype. If you have a module you can group all relevant
functions, so they're easy to find. Plus it's more future-proof - if at some
point numpy grows another new dtype, just create a new module with wrapper
funcs for that dtype.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion