Giter Site home page Giter Site logo

gudhi / gudhi-devel Goto Github PK

View Code? Open in Web Editor NEW
237.0 11.0 65.0 46.47 MB

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.

Home Page: https://gudhi.inria.fr/

License: MIT License

CMake 4.27% TeX 2.36% Python 14.07% Shell 0.07% C++ 73.19% C 0.74% HTML 0.20% CSS 0.02% Assembly 0.90% SourcePawn 0.33% Cython 3.82% Pascal 0.03%
topology tda topological-data-analysis python persistent-homology cpp17

gudhi-devel's Introduction

OSx and Win on Azure Linux on CircleCI Anaconda Cloud Anaconda downloads

GUDHI

The GUDHI library is a generic open source C++ library, with a Python interface, for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding. The library offers state-of-the-art data structures and algorithms to construct simplicial complexes and compute persistent homology.

Source code

We recommend that users get official releases from the GUDHI website.

For potential contributors, to fully checkout GUDHI, after cloning the git repository, you may also need to checkout its submodules using

git submodule update --init

Compilation and installation

To install GUDHI, you can follow the C++ compilation procedure, the Python compilation procedure, use our conda-forge package, or go with Docker.

More information

gudhi-devel's People

Contributors

ajouellette avatar albert-github avatar davidlapous avatar gspr avatar hind-m avatar hschreiber avatar martinroyer avatar mathieucarriere avatar mglisse avatar skachano avatar soriano-trigueros avatar takeshimeonerespect avatar tlacombe avatar ulupo avatar vincentrouvreau avatar wreise avatar yuichi-ike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gudhi-devel's Issues

[Persistence_representations] Missing `inline` for many functions

Trying to link together 2 files that both include gudhi headers, I get many "multiple definition" errors from the Persistence_representations module. Some examples:
Gudhi::Persistence_representations::read_persistence_intervals_in_one_dimension_from_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double), Gudhi::Persistence_representations::PSSK::construct(std::vector<std::pair<double, double>, std::allocator<std::pair<double, double> > > const&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >, unsigned long, double, double), Gudhi::Persistence_representations::Persistence_intervals::Persistence_intervals(char const*, unsigned int), etc.

There is also Gudhi::Persistence_representations::epsi. Making this variable const would work. If it is supposed to remain writable, since we can't use C++17 inline variables yet, it is a bit more complicated.

[doc] OFF file format

The link to http://www.geomview.org/docs/html/OFF.html documenting the OFF file format we use for point sets is repeated in many packages, but not all that use it (for instance the tangential complex, or the python interface). Maybe we should link to our file_formats page, and explain there what variants we support, with an example for a point set so people are not too confused with having to specify edges/faces (just say there are 0).

[Persistence_representations - Persistence_heat_maps] create_Gaussian_filter ignores its second argument

#include <iostream>
#include <gudhi/Persistence_heat_maps.h>

int main(){
  int n=2;
  auto a=Gudhi::Persistence_representations::create_Gaussian_filter(n,.1);
  auto b=Gudhi::Persistence_representations::create_Gaussian_filter(n,10);
  for(int i=0;i<a.size();++i){
    for(int j=0;j<a[0].size();++j){
      std::cout << a[i][j] << ' ';
    }
    std::cout << '\n';
  }
  std::cout << '\n';
  for(int i=0;i<b.size();++i){
    for(int j=0;j<b[0].size();++j){
      std::cout << b[i][j] << ' ';
    }
    std::cout << '\n';
  }
}

prints

0.000106789 0.00214491 0.00583047 0.00214491 0.000106789
0.00214491 0.0430817 0.117108 0.0430817 0.00214491
0.00583047 0.117108 0.318333 0.117108 0.00583047
0.00214491 0.0430817 0.117108 0.0430817 0.00214491
0.000106789 0.00214491 0.00583047 0.00214491 0.000106789

0.000106789 0.00214491 0.00583047 0.00214491 0.000106789 
0.00214491 0.0430817 0.117108 0.0430817 0.00214491 
0.00583047 0.117108 0.318333 0.117108 0.00583047 
0.00214491 0.0430817 0.117108 0.0430817 0.00214491 
0.000106789 0.00214491 0.00583047 0.00214491 0.000106789 

i.e. the same thing whatever sigma we use. The code looks like it is using sigma, but it actually simplifies out (up to rounding errors of course).

[Nerve GIC] document what persistence compute_PD returns

Cover_complex::compute_PD Computes the extended persistence diagram of the complex

This is not sufficient documentation.

  • Persistence_diagram is not documented
  • How are extended diagrams represented? Usual points above the diagonal, and the ones that would be essential in non-extended end up below?
  • What is it the persistence of? The sub-level sets of the associated function?

[Alpha_complex] Building a Delaunay triangulation (without filtration)

I have seen several times people use Alpha_complex to build a Delaunay triangulation, and then ignore the filtration values (overwrite them with other values). IIRC, computing the filtration values is by far the most costly part of Alpha_complex, so this seems wasteful. It could be nice to have an option to say that we don't care about the filtration values.
An alternative way to resolve this would be to have a (simple, copy-pastable) example showing how to build a Simplex_tree representing the Delaunay triangulation of a point cloud, possibly using CGAL's python interface (or anything simple).

[CMake - TBB] TBB requires to link against libatomic on some non-x86_64 architectures

Some non-x86_64 architectures seem to require explicitly linking against libatomic for the things that use TBB. I'm currently just adding it to the list of TBB libraries. Perhaps CMake can do something more intelligent on the architectures where it's needed?
https://git.nonempty.org/debian-gudhi/tree/debian/patches/0007-Force-linking-against-libatomic-for-parts-that-use-T.patch?h=debian/sid&id=fed62e52ab396f0d6ba9029f12d5ef35d7761989

[Global - Copyright] Python Copyrights mention that Gudhi is a generic C++ library, but no mention about Python

The actual Copyrights says:
This file is part of the Gudhi Library. The Gudhi library (Geometric Understanding in Higher Dimensions) is a generic C++ library for computational topology.
It shall say:
This file is part of the Gudhi Library. The Gudhi library (Geometric Understanding in Higher Dimensions) is a generic C++ library, with a Python interface, for computational topology.
All Copyrights to be modified.

[Simplex_tree] shallow move constructor

The memory issue is due to something like a shallow move constructor of
'Simplex_tree' class in Simplex_tree.h:
In 'Simplex_tree' class, 'root_' is of type 'Simplex_tree::Siblings =
Simplex_tree_siblings' and 'filtration_vect_' is of type
'std::vector<Simplex_handle>'. Both type contains 'Simplex_tree_siblings
*', and a 'Simplex_tree' class variable contains the pointer to its
'root_'. Hence, when the move constructor is called, then the address of
'old.root_' is still preserved in new 'Simplex_tree', although 'old' is
deleted.
So I temporarily disabled move constructor so that copy constructor is used
instead.
And I guess to fix it, the address of 'old.root_' should be updated to the
new address of 'root_' in the move constructor.
uncles_ shall be updated somewhere.

Recommend `-DCMAKE_BUILD_TYPE=Release`

In the documentation (say python installation), we show commands to build gudhi, and in particular we show cmake ... Doing this, we get the "CGAL performance notice" which recommends adding -DCMAKE_BUILD_TYPE=Release. Should we add this argument in the doc? Or if for some reason it does not apply, should we disable the warning with CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE=TRUE?

left-over debug printing in python SimplexTree.get_cofaces

import gudhi
st = gudhi.SimplexTree()
st.insert([0,1])
st.insert([0,2])
print(st.get_cofaces([0],1))

The call to get_cofaces prints stuff. I don't think it should, cython/include/Simplex_tree_interface.h should not have any std::cout in it (except if we add a function print or dump).
By the way, the name Complex in that file is misleading, get_cofaces returns a chain (a list of simplices) that does not form a complex (boundaries are not included).

Python module for statistical procedures

Hi all,

I am working on a set of statistical procedures (in python) for persistence diagrams (in the spirit of the TDA R package ).
Other statistical procedures for other persistence representations will be also implemented as soon as these representations will be available in Python.

Should I organize all these codes in a new module called "persistence_statistics" ?
Suggestions for the name of this new module are welcome.

Thanks

Bertrand

[python] nogil

Cython has mechanisms to handle the GIL. I believe some of our C++ functions could be marked with nogil at least, we should investigate that at some point.

[tangential complex] Documentation improvements

(this is for the python doc, but the C++ one likely has the same issue)

  • The user manual presents an example with 4 points and claims that for each point we are going to estimate its tangent subspace. Of course, with 4 points, we aren't going to get good estimates of the tangent subspace at each point... This is super-simplified, normally you have at least dozens of points. Besides, we only claim that we can reconstruct closed curves. Maybe a simple sentence explaining exactly that would help un-confuse users.
  • The manual says "For each point p, estimate its tangent subspace Tp (e.g. using PCA)." The current code is hard-coded to use PCA, as far as I can tell from the doc (it would be nice if it allowed to plug other tangent space estimators). The sentence kind of gives a reader the impression that they are responsible for this tangent space estimation and they should look into PCA or alternatives, when (currently) that's an implementation detail that users cannot access.

[Bitmap_cubical_complex] Perseus file reader rejects infinity

read_perseus_style_file uses istream::operator>>(double&) to read numbers, which does not accept Inf (we had the same issue with other readers before). But that would seem like a useful thing to support, people regularly ask how to handle partial cubical complexes (with missing cells) and setting the filtration value to +Inf is the best we can currently offer.

Missing example of witness complex from distance matrix

It would be nice to have an example showing how to build a witness complex starting from a distance matrix (select a set of landmarks, build the nearest landmark table, etc). I believe there used to be such an example in C++ a long time ago but it got removed. http://gudhi.gforge.inria.fr/doc/latest/group__witness__complex.html claims that example 3 is using a distance matrix, but that's not true. It would also help to use non-integral distances in the example so they are less easily confused with indices.

Trying to write such code in python, the format of the nearest landmark table is not convenient, it contains both integers and floats and thus cannot be a numpy array. I was starting from a distance matrix in a numpy array, selecting a set of landmarks, keeping only the corresponding columns in the matrix. Then I can either argsort or sort the rows but it is inconvenient to get both results mixed so I can pass the result to the witness complex.

[Alpha_complex] new do_sqrt argument

The filtration values we use in the alpha complex are squared radii. Most applications are more interested in a (non-squared) radius. We use squares because if we add weights, taking the square root becomes less meaningful, in particular if the value becomes negative. But I think we should make it as easy as possible for people to get the square root they expect, and a parameter seems to be the easiest, passing do_sqrt=True if we want the square root. The name do_sqrt is just a placeholder for the report, better names are welcome.

[Simplex_tree] Rules of 5 is violated

Missing move and copy assignement.

    Simplex_tree& operator=(const Simplex_tree& other) // copy assignment
    {
         ...;
    }
    Simplex_tree& operator=(Simplex_tree&& other) noexcept // move assignment
    {
        ...;
    }

[Simplex_tree] reset_filtration

A function that resets the filtration of all simplices to a given value could be useful, especially in python where iterating on all simplices is slow.
For instance, I may build a Delaunay triangulation using Alpha_complex. I set new values on the vertices and want the corresponding lower-star filtration (the filtration of a simplex is the max of its vertices). make_filtration_non_decreasing does that if the filtration values of edges, etc are -infinity before, but if the existing filtration values are larger, it gives something different.
I imagine something like st.reset_filtrations(new_value=0, min_dimension=0).

[Python - sphinx] Travis (Mac OS) ImportError: cannot import name 'main' from 'sphinx'

$ ctest -R sphinx_py_test -V
UpdateCTestConfiguration  from :/Users/travis/build/GUDHI/gudhi-devel/build/DartConfiguration.tcl
UpdateCTestConfiguration  from :/Users/travis/build/GUDHI/gudhi-devel/build/DartConfiguration.tcl
Test project /Users/travis/build/GUDHI/gudhi-devel/build
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 30
    Start 30: sphinx_py_test
30: Test command: /usr/local/Cellar/cmake/3.14.2/bin/cmake "-E" "env" "PYTHONPATH=/Users/travis/build/GUDHI/gudhi-devel/build/src/cython" "/usr/local/bin/python3" "/Users/travis/build/GUDHI/gudhi-devel/src/cython/doc/python3-sphinx-build.py" "-b" "doctest" "/Users/travis/build/GUDHI/gudhi-devel/src/cython/doc" "/Users/travis/build/GUDHI/gudhi-devel/build/src/cython/doctest"
30: Test timeout computed to be: 10000000
30: Traceback (most recent call last):
30:   File "/Users/travis/build/GUDHI/gudhi-devel/src/cython/doc/python3-sphinx-build.py", line 8, in <module>
30:     from sphinx import main
30: ImportError: cannot import name 'main' from 'sphinx' (/Users/travis/Library/Python/3.7/lib/python/site-packages/sphinx/__init__.py)
1/1 Test #30: sphinx_py_test ...................***Failed    0.20 sec
0% tests passed, 1 tests failed out of 1

Remove references to gitlab

Since the gitlab thing was closed, those are dead links.
Do we get reports about dead links on the gudhi website?

[data] Make COPYRIGHT clearer

The following files were deleted from the upstream sources in order to comply with Debian policy.

  • GudhUI/utils/homsimpl : precompiled binary
  • data/filtered_simplicial_complex/bunny_5000_complex.fsc : unclear license
  • data/points/COIL_database/* : unclear license
  • data/points/SO3* : unclear license
  • data/points/bunny* : restrictive license (free for research use only)
  • data/points/human.off : unclear license

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.