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

BLD: add missing noexcept qualifier (Cython 3 compat) #4373

Merged
merged 1 commit into from
Mar 14, 2023

Conversation

neutrinoceros
Copy link
Member

PR Summary

This resolves the last compilation error on Cython 3.0.0b1 currently listed in #4355
While this is sufficient to enable compilation on my personal dev machine, compilation still fails on GHA, so I won't enable continuous testing yet, and will tackle these issues next.

@neutrinoceros neutrinoceros added the refactor improve readability, maintainability, modularity label Mar 14, 2023
Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

Any idea why we need this? Is it called from a no except function?

@neutrinoceros
Copy link
Member Author

Here are the errors this fixes:

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              cdef OctKey okey
              cdef OctKey **oresult = NULL
              okey.key = key
              okey.node = NULL
              oresult = <OctKey **> tfind(<void*>&okey,
                  &self.tree_root, root_node_compare)
                                   ^
      ------------------------------------------------------------

      yt/geometry/oct_container.pyx:982:29: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              cdef np.int64_t key = 0
              cdef OctKey *ikey = &self.root_nodes[self.num_root]
              key = self.ipos_to_key(ind)
              self.root_nodes[self.num_root].key = key
              self.root_nodes[self.num_root].node = next
              tsearch(<void*>ikey, &self.tree_root, root_node_compare)
                                                    ^
      ------------------------------------------------------------

      yt/geometry/oct_container.pyx:1057:46: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              # This gets called BEFORE the superclass deallocation.  But, both get
              # called.
              cdef OctKey *ikey
              for i in range(self.num_root):
                  ikey = &self.root_nodes[i]
                  tdelete(<void *>ikey, &self.tree_root, root_node_compare)
                                                         ^
      ------------------------------------------------------------

      yt/geometry/oct_container.pyx:1076:51: Cannot assign type 'int (const void *, const void *) except? -1 nogil' to 'int (*)(const void *, const void *) noexcept nogil'

@neutrinoceros neutrinoceros marked this pull request as ready for review March 14, 2023 13:48
@neutrinoceros
Copy link
Member Author

The mergeable bot appears to be stuck. Any way to retrigger it ?

@neutrinoceros
Copy link
Member Author

nevermind, I think it was just my browser's cache lying to me.

@neutrinoceros neutrinoceros merged commit ba88d3e into yt-project:main Mar 14, 2023
@neutrinoceros neutrinoceros deleted the cython3_noexcept branch March 14, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor improve readability, maintainability, modularity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants