Giter Site home page Giter Site logo

Compatibility with cython3 about gudhi-devel HOT 4 CLOSED

mglisse avatar mglisse commented on June 6, 2024
Compatibility with cython3

from gudhi-devel.

Comments (4)

mglisse avatar mglisse commented on June 6, 2024

This handling of __ is a general Python thing: https://docs.python.org/3/tutorial/classes.html#private-variables

In [1]: class A:
   ...:     def __x(self):
   ...:         return True
   ...: a = A()
   ...: a.__x()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In [1], line 5
      3         return True
      4 a = A()
----> 5 a.__x()

AttributeError: 'A' object has no attribute '__x'

In [2]: a._A__x()
Out[2]: True

from gudhi-devel.

VincentRouvreau avatar VincentRouvreau commented on June 6, 2024

A reminder on this #777 (comment)

from gudhi-devel.

mglisse avatar mglisse commented on June 6, 2024

It seems that the only issue is using the functions __is_defined() and __is_persistence_defined() in tests. @VincentRouvreau , what do you prefer?

  1. remove the assertions on those 2 functions from the tests
  2. rename them so they start with a single underscore
  3. on the day we switch to cython3, update the tests to _SimplexTree__is_defined, etc
  4. other

I think I am in favor of option 2 (it is simple, compatible with both versions of cython, and I don't think the protection offered by the double underscore is that important here, but I could be wrong). We could also remove one underscore from persistence_graphical_tools.__min_birth_max_death while we are at it.

from gudhi-devel.

mglisse avatar mglisse commented on June 6, 2024

Cython3 is now out, and at least one macosx+windows CI job already uses it and fails (the exception specifications don't match)

/Users/runner/work/gudhi-devel/gudhi-devel/src/python/gudhi/simplex_tree.pyx:613:65: Cannot assign type 'bool (vector[int], void *) except? -1' to 'blocker_func_t'

from gudhi-devel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.