New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix numpy warnings #969

Merged
merged 23 commits into from Feb 12, 2016

Conversation

Projects
None yet
4 participants
@ssanderson
Member

ssanderson commented Jan 22, 2016

Toward fixing #954.

setup.py Outdated
may be run before numpy has been installed, in which case
importing numpy and calling `numpy.get_include()` will fail.
"""
numpy_incl = resource_filename('numpy', 'core/include')

This comment has been minimized.

@llllllllll

llllllllll Jan 22, 2016

Member

how is this different from numpy.get_include()

dtype('datetime64[%s]' % unit): datetime64('NaT', unit)
for unit in ('ns', 'us', 'ms', 's', 'm', 'D')
}
NaT_for_dtype = NaTmap.__getitem__

This comment has been minimized.

@llllllllll

llllllllll Jan 22, 2016

Member

toolz.curried.operator.getitem(NaTmap) maybe?

setup.py Outdated
# usual super() invocation because distutils' build_class, of
# which Cython's build_ext is a subclass, is an old-style class
# in Python 2, which doesn't support `super`.
cython_build_ext.build_extensions(self)

This comment has been minimized.

@llllllllll

llllllllll Jan 22, 2016

Member

get around this by subclassing cython_build_ext and object.

@ssanderson ssanderson force-pushed the master branch from 110798b to 0dac2e0 Jan 22, 2016

@ssanderson ssanderson force-pushed the fix-numpy-warnings branch 2 times, most recently from 132c820 to 69ff6a8 Jan 22, 2016

@llllllllll llllllllll force-pushed the fix-numpy-warnings branch 8 times, most recently from 9fe7792 to 98f5920 Jan 29, 2016

@richafrank richafrank force-pushed the fix-numpy-warnings branch from 107ebf3 to 04d5b21 Feb 3, 2016

)
data.to_csv(path)
except (OSError, IOError, HTTPError):
logger.exception('falied to cache the new benchmark returns')

This comment has been minimized.

@richafrank

richafrank Feb 3, 2016

Member

typo "failed"

_FILLVALUE_DEFAULTS = {
float64_dtype: nan,
datetime64ns_dtype: np_NaT,
datetime64ns_dtype: NaT_for_dtype(datetime64ns_dtype),

This comment has been minimized.

@richafrank

richafrank Feb 3, 2016

Member

Can reuse above const

beginmask = (begindates == np_NaT)
endmask = (enddates == np_NaT)
beginmask = (begindates == NaT)
endmask = (enddates == NaT)

This comment has been minimized.

@richafrank

richafrank Feb 3, 2016

Member

@ssanderson Should we use the dtype from begin/enddates?

This comment has been minimized.

@ssanderson

ssanderson Feb 3, 2016

Member

busday_count only supports datetime64[D], so this should only ever be NaTD:

In [6]: busday_count(arange(0, 3, dtype='datetime64[ns]'), arange(0, 3, dtype='datetime64[ns]'))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-3e0be598dbd6> in <module>()
----> 1 busday_count(arange(0, 3, dtype='datetime64[ns]'), arange(0, 3, dtype='datetime64[ns]'))

TypeError: Iterator operand 0 dtype could not be cast from dtype('<M8[ns]') to dtype('<M8[D]') according to the rule 'safe'

In [7]: busday_count(arange(0, 3, dtype='datetime64[D]'), arange(0, 3, dtype='datetime64[D]'))
Out[7]: array([0, 0, 0])

@llllllllll llllllllll force-pushed the fix-numpy-warnings branch from 30de496 to c799233 Feb 3, 2016

@richafrank richafrank force-pushed the fix-numpy-warnings branch from c799233 to 24a2921 Feb 11, 2016

richafrank added a commit that referenced this pull request Feb 12, 2016

@richafrank richafrank merged commit fca7936 into master Feb 12, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@richafrank richafrank deleted the fix-numpy-warnings branch Feb 12, 2016

@lzrobbytan

This comment has been minimized.

lzrobbytan commented on 9a253d5 Feb 16, 2016

which numpy version do we use here please?

This comment has been minimized.

Member

llllllllll replied Feb 16, 2016

As of this PR we support numpy>=1.9.2

@richafrank richafrank referenced this pull request Mar 7, 2016

Closed

Update dependencies #894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment