-
Notifications
You must be signed in to change notification settings - Fork 2
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
some typedefs for MSVC 2008 #2
Conversation
@@ -24,10 +24,10 @@ cdef extern from "Python.h": | |||
bint PyComplex_Check(object obj) nogil | |||
bint PyObject_TypeCheck(object obj, PyTypeObject* type) nogil | |||
|
|||
from numpy cimport int64_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll trust you if you say this is necessary, but this doesn't make sense to me. I took the ctypedef signed long long int64_t
from the numpy __init__.pxd
, so shouldn't these be equivalent?
(Using the extern version instead of the cimport version is necessary to avoid the NPY_NO_DEPRECATED warnings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe "numpy/arrayobject.h" only defines npy_int64
- it is only the cython pxd that also typedefs this to int64_t
.
So then this typedef is basically a noop (?)
ctypedef signed long long int64_t
The function failing to compile is this one from util.pxd. <stdint.h> is normally included in cython generated code, so on all platforms but MSVC 2008 it is providing the necessary int64_t typedef
cdef inline int64_t get_nat():
return NPY_MIN_INT64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clearing this up. Is there a viable fix that doesn't involve the from numpy cimport
?
I'm going to merge this here so we can move the master-PR along; hopefully we can get rid of the cimport in the next round of cython-cleaning.
Would “from libc.stdint cimport int64_t” work cross-platform? That would make some nice simplifications feasible. |
It does not - MSVC 2008 didn't ship a # Python 2.7.15 |Anaconda, Inc.| (default, May 1 2018, 18:37:09) [MSC v.1500 64 bit (AMD64)]
%%cython
from libc.stdint cimport int64_t
def add_one(int64_t a):
return a + 1
# ~\.ipython\cython\_cython_magic_d325870c8ea59abec727c4b979472cb0.c(579) :
fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory |
… field today/now shown in error (pandas-dev#47860) * Revert "addressing reviews CL#1" This reverts commit 69dc2d4. * Added improvements in to_datetime Error reporting message - incorrect field now/today shown as error * Added improvements in to_datetime Error reporting message - incorrect field now/today shown as error * added testcase * adding position info & updated testcase * precommit format changes * addressing review comments * addressing review comments * addressing review comments * addressing review comments * addressing review comments #2 * addressing review comments
* Add return info for nsmallest method * Add result info on nunique. * Add return information to pipe method. * Add return information for boxplot method * Add return information for kde plot. * Add result information for scatter plot. * Remove resolved methods from ignore_functions parameter * Reinsert method to code checker which was erroneously removed.
ref pandas-dev#22235