Skip to content

Remove inline declarations in pxd files #17277

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

Closed
wants to merge 1 commit into from

Conversation

jbrockmendel
Copy link
Member

At the moment (I think since .26, not sure) they don't do anything but cause lots of warnings during cythonizing. Eventually they will raise errors.

cython/cython#1706 (comment)

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

At the moment they dont do anything but cause lots of warnings during
cythonizing.  Eventually they will raise errors.

cython/cython#1706 (comment)
@gfyoung gfyoung added Clean Internals Related to non-user accessible pandas implementation labels Aug 18, 2017
@codecov
Copy link

codecov bot commented Aug 18, 2017

Codecov Report

Merging #17277 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17277      +/-   ##
==========================================
- Coverage      91%   90.99%   -0.02%     
==========================================
  Files         162      162              
  Lines       49547    49547              
==========================================
- Hits        45091    45083       -8     
- Misses       4456     4464       +8
Flag Coverage Δ
#multiple 88.77% <ø> (ø) ⬆️
#single 40.25% <ø> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.72% <0%> (-0.1%) ⬇️
pandas/core/indexes/datetimes.py 95.33% <0%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24b6349...1fc1b7d. Read the comment docs.

@codecov
Copy link

codecov bot commented Aug 18, 2017

Codecov Report

Merging #17277 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17277      +/-   ##
==========================================
- Coverage      91%   90.99%   -0.02%     
==========================================
  Files         162      162              
  Lines       49547    49547              
==========================================
- Hits        45091    45083       -8     
- Misses       4456     4464       +8
Flag Coverage Δ
#multiple 88.77% <ø> (ø) ⬆️
#single 40.25% <ø> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.72% <0%> (-0.1%) ⬇️
pandas/core/indexes/datetimes.py 95.33% <0%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24b6349...1fc1b7d. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Aug 18, 2017

this would need a performance check. older versions of cython may respect this directive.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this likely has much worse performance in most scenarios.

inline khint_t kh_put_pymap(kh_pymap_t*, PyObject*, int*)
inline void kh_del_pymap(kh_pymap_t*, khint_t)
kh_pymap_t* kh_init_pymap()
void kh_destroy_pymap(kh_pymap_t*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are c-functions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But they still trigger the warning when building. So apparently that does not matter

Copy link
Member

@jorisvandenbossche jorisvandenbossche Aug 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the comment in the cython issues, I understand that those will not be inlined anyhow when used in another cython module (cython/cython#1706 (comment))

@@ -38,7 +38,7 @@ cdef class MultiIndexHashTable(HashTable):

cpdef get_item(self, object val)
cpdef set_item(self, object key, Py_ssize_t val)
cdef inline void _check_for_collision(self, Py_ssize_t loc, object label)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this prob should be implemented in the .pxd file; its called a lot

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is just a matter of cut/pasting from the pxi file, you got it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that _check_for_collisions is only used in hashtable.pyx itself? (or in the included template files)
If so, I think we can just remove it here from the pxd file altogether (it is already defined as inline in hashtable itself)

@jreback
Copy link
Contributor

jreback commented Aug 18, 2017

The comment above only seems to apply to cython defintiion, NOT c definitions.

@jbrockmendel
Copy link
Member Author

The comment above only seems to apply to cython defintiion, NOT c definitions.

OK, then this is moving outside my competence zone. We can wait until it starts raising errors and fix it then.

@jreback
Copy link
Contributor

jreback commented Aug 19, 2017

ok, as I said its new in cython 0.26 if you want to specifically address some things great. but will need performance checking.

@jreback jreback closed this Aug 19, 2017
@jbrockmendel jbrockmendel deleted the no_inline branch October 30, 2017 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants