Skip to content
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

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

chris-b1
Copy link

@chris-b1 chris-b1 commented Aug 9, 2018

@@ -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
Copy link
Owner

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)

Copy link
Author

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

Copy link
Owner

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.

@jbrockmendel jbrockmendel merged commit 6ae2c72 into jbrockmendel:contained4 Aug 9, 2018
@jbrockmendel
Copy link
Owner

Would “from libc.stdint cimport int64_t” work cross-platform? That would make some nice simplifications feasible.

@chris-b1
Copy link
Author

It does not - MSVC 2008 didn't ship a <stdint.h> which is why we have our shim

# 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

jbrockmendel added a commit that referenced this pull request Oct 25, 2021
jbrockmendel pushed a commit that referenced this pull request Aug 15, 2022
… 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
jbrockmendel pushed a commit that referenced this pull request Mar 12, 2024
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants