Code Monkey home page Code Monkey logo

dionysus's People

Contributors

dependabot[bot] avatar dlm avatar jvuillamy avatar mrzv avatar olgabot avatar stefanv avatar tarjebargheer 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

dionysus's Issues

Dionysus does not installs into NVIDIA-supplied containers

I'm using the latest NVIDIA-supplied container based on Ubuntu 22.04, Python 3.10, G++ 11.4.0, CMake 3.22.1, and is unable to install GUDHI via pip, getting the following message

pip install dionysus
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting dionysus
  Downloading dionysus-2.0.10.tar.gz (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 5.2 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: dionysus
  Building wheel for dionysus (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [103 lines of output]
      /usr/local/lib/python3.10/dist-packages/setuptools/dist.py:745: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!

              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.

              By 2023-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        opt = self.warn_dash_deprecation(opt, section)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.10
      creating build/lib.linux-aarch64-3.10/dionysus
      copying bindings/python/dionysus/_version.py -> build/lib.linux-aarch64-3.10/dionysus
      copying bindings/python/dionysus/plot.py -> build/lib.linux-aarch64-3.10/dionysus
      copying bindings/python/dionysus/__init__.py -> build/lib.linux-aarch64-3.10/dionysus
      running build_ext
      -- The C compiler identification is GNU 11.4.0
      -- The CXX compiler identification is GNU 11.4.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Could NOT find Boost (missing: Boost_INCLUDE_DIR)
      -- pybind11 v2.11.0 dev1
      -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.10.12", minimum required is "3.6")
      -- Found PythonLibs: /usr/lib/aarch64-linux-gnu/libpython3.10.so
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Configuring done
      CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
      Please set them or make sure they are set and tested correctly in the CMake files:
      Boost_INCLUDE_DIR (ADVANCED)
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/bindings/python
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/bindings/python
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/bindings/python
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/bindings/python
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/bindings/python/pybind11
         used as include directory in directory /tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/bindings/python/pybind11

      CMake Error in bindings/python/CMakeLists.txt:
        Found relative path while evaluating include directories of "_dionysus":

          "Boost_INCLUDE_DIR-NOTFOUND"



      -- Generating done
      CMake Generate step failed.  Build files cannot be regenerated correctly.
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/setup.py", line 67, in <module>
          setup(
        File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/usr/local/lib/python3.10/dist-packages/wheel/bdist_wheel.py", line 349, in run
          self.run_command("build")
        File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
        File "/tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/setup.py", line 39, in run
          self.build_extension(ext)
        File "/tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/setup.py", line 64, in build_extension
          subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
        File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-e_c0rjw3/dionysus_2f990050e1ee45e987e1db6dd3981f14/build/lib.linux-aarch64-3.10', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-Dbuild_examples=OFF', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dionysus
  Running setup.py clean for dionysus
Failed to build dionysus
ERROR: Could not build wheels for dionysus, which is required to install pyproject.toml-based projects

Building problem on Windows 10

After newly installing boost, cmake and pip with conda I cannot get rid of
`...

copying bindings\python\dionysus\__init__.py -> build\lib.win-amd64-3.6\dionysus

running build_ext

-- Building for: NMake Makefiles

CMake Error at CMakeLists.txt:1 (project):

  Generator
    NMake Makefiles
  does not support platform specification, but platform
    x64
  was specified.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred! ... `

when using pip install dionysus. Any help is greatly appreciated.

Possible bug in computing diagrams for rips filtration

I am just getting started with using the dionysus on some toy data.

Below i tried to sample n points from a circle perturbed by gaussian noise of a specified scale

import numpy as np

num_pts = 500
r = 10
noise_sigma = 0.05 * r

theta = np.random.rand(num_pts, 1) * 2 * np.pi

pts = r * np.hstack((np.cos(theta), np.sin(theta))) 
pts = pts + np.random.randn(num_pts, 2) * noise_sigma

plt.figure(figsize=(8, 8))
_ = plt.plot(pts[:, 0], pts[:, 1], 'k+')

image

Then i tried to compute persistence diagrams upto dimension 1 using rips filtration using the code below:

import dionysus as d

f = d.fill_rips(pts, 1, 3*r)
m = d.homology_persistence(f)
dgms = d.init_diagrams(m, f)
print dgms

Output:

Took 1.673817 seconds for 500 points
[Diagram with 500 points, Diagram with 124251 points]

Then i tried to plot the diagrams of dimension 0 and 1 using the following code:

import matplotlib.pyplot as plt

plt.figure(figsize=(8,8))
d.plot.plot_diagram(dgms[0], show=False)

plt.figure(figsize=(8,8))
d.plot.plot_diagram(dgms[1], show=False)

The diagram of dimension 0 looks as expected:

image

However the plot of diagram of dimension 1 produced the following error

ValueError                                Traceback (most recent call last)
<ipython-input-88-65ea1b07beec> in <module>()
      1 plt.figure(figsize=(8,8))
----> 2 d.plot.plot_diagram(dgms[1], show=False)

/home/cdeepakroy/work/Libs/dionysus/build/bindings/python/dionysus/plot.pyc in plot_diagram(dgm, show)
      7     min_birth = min(p.birth for p in dgm if p.birth != inf)
      8     max_birth = max(p.birth for p in dgm if p.birth != inf)
----> 9     min_death = min(p.death for p in dgm if p.death != inf)
     10     max_death = max(p.death for p in dgm if p.death != inf)
     11 

ValueError: min() arg is an empty sequence

<matplotlib.figure.Figure at 0x7f78f7e35c10>

The reason is the death value of all birth-death pairs in diagram of dimension 1 is infinity.

This seems to be a bug or did i misinterpret any of the parameters of the rips filtration.

Zigzag persistence calculation hangs in Python 3.7

When I try to calculate zigzag persistence, as in the example in the documentation, Python 3.7 hangs:

`Python 3.7.0 (default, Jul 9 2018, 16:42:22)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import dionysus as d
f = d.Filtration([[0], [1], [0,1], [2], [0,2], [1,2]])
times = [[.4, .6, .7], [.1], [.9], [.9], [.9], [.9]]
zz, dgms, cells = d.zigzag_homology_persistence(f, times)`
(nothing happens, Python no longer responds)

I've tried installing the PyPI version as well as the current development version on the repository via pip; I've also cloned and built the repository on my own. This does not occur in Python 3.6.

cycle position

Hi,
I tried to write down a code in python to extract cycle position based on "d.zigzag_homology_persistence" and observing intermediate steps using "callback = detail". The code works as expected but the performance is about 5 to 10 times slower than what is provided through the "TDA R package" for the Dionysus toolbox. I only wonder if there is clear documentation on how to extract cycle position using python and Dionysus2. Or is there a faster code somewhere to do this job?
Thanks in advance for your answer,
I can also share my code if needed.

cmake does not create makefile

I am running on Windows 10 and finally made it through the cmake process (after installing CMake, Visual C++, and Boost). It seems like it completes properly. But when I then run make I get:
make: *** No targets specified and no makefile found. Stop.

My output from running cmake .. from the build subdirectory is here:
cmake_output.txt

The contents of the build directory populate through the cmake as:

/build
/CMakeFiles
/examples
ALL_BUILD.vcxproj
ALL_BUILD.vcsproj.filters
cmake_install.cmake
CMakeCache.txt
Dionysus.sh
ZERO_CHECK.vcxproj
ZERO_CHECK.vcxproj.filters

There is no Makefile created.

Some compile errors and their solutions

Hi,

First I must say I was very happy to find out about this subject, I had struggled with using dionysus in python in its previous iteration and it seems to be working like a charm now.

When I tried to compile on my machine I ran into two errors, I'm sharing them here with the solution for your information. If you want I can do a pull request.

  • dionysus/ext/hera/wasserstein/src/basic_defs.cpp:101:74: error: ‘pow’ is not a member of ‘std’

    • Solution: I added #include <cmath> in basic_defs.cpp
  • An converting to [...] from initializer list would use explicit constructor [...] error at dionysus/bindings/python/zigzag-persistence.cpp:141:58

    • Solution: change the faulty line to return std::tuple<PyZigzagPersistence, std::vector<PyDiagram>> { std::move(persistence), std::move(diagrams) };

Hope that helps, and thanks for developping this library!

error: --single-version-externally-managed --compile" failed with error code 1

Hi, I get an installation error when trying to install "dionysus 2" under Windows 10 x64. python 3.6
when I do pip install --verbose dionysus, the error shows below (I have the updated pip, setuptools and wheel )
please tell me if need any more information

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/Users/HL~~~/AppData/Local/Temp/pip-build-bh2npfav/dionysus/bindings/python
used as include directory in directory C:/Users/HL~~~/AppData/Local/Temp/pip-build-bh2npfav/dionysus/bindings/python

-- Configuring incomplete, errors occurred!
See also "C:/Users/HL~~~/AppData/Local/Temp/pip-build-bh2npfav/dionysus/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus\setup.py", line 97, in <module>
    zip_safe=False,
  File "E:\PYTHON\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "E:\PYTHON\lib\distutils\dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "E:\PYTHON\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "E:\PYTHON\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "E:\PYTHON\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "E:\PYTHON\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "E:\PYTHON\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "E:\PYTHON\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "E:\PYTHON\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "E:\PYTHON\lib\distutils\dist.py", line 974, in run_command
    cmd_obj.run()
  File "C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus\setup.py", line 39, in run
    self.build_extension(ext)
  File "C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus\setup.py", line 64, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "E:\PYTHON\lib\subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\HL~~~\\AppData\\Local\\Temp\\pip-build-bh2npfav\\dionysus', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\HL~~~\\AppData\\Local\\Temp\\pip-build-bh2npfav\\dionysus\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=E:\\PYTHON\\python.exe', '-Dbuild_examples=OFF', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\HL~~~\\AppData\\Local\\Temp\\pip-build-bh2npfav\\dionysus\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.
Running setup.py install for dionysus: finished with status 'error'

Cleaning up...
Removing source in C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus
Command "E:\PYTHON\python.exe -u -c "import setuptools, tokenize;file='C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\HL~~~\AppData\Local\Temp\pip-_2fd0ic-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus
Exception information:
Traceback (most recent call last):
File "E:\PYTHON\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "E:\PYTHON\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "E:\PYTHON\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "E:\PYTHON\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "E:\PYTHON\lib\site-packages\pip\utils_init
.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "E:\PYTHON\python.exe -u -c "import setuptools, tokenize;file='C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\HL~~~\AppData\Local\Temp\pip-__2fd0ic-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\HL~~~\AppData\Local\Temp\pip-build-bh2npfav\dionysus\

Saving output of filtration and reuploading to compute cohomology

I have been able to save the outputs of filtration and diagrams into xarray.Dataset. This is very nice as it allows one to preserve all the data in the outputs in a transparent way.
I now face the challenge of how to reconvert these saved data into forms that are recognizable to Dionysus 2. I want to save into the disk so that I do not have to recalculate everything every time (it takes many hours on a fast M1 max Mac). Any suggestions?

Vines question

This is actually a question regarding the source in Dionysus 1.

Around Line ~120 of dynamic-persistence.hpp looks like:

rLog(rlTranspositions, "l cycle: %s", l->cycle.tostring(outmap).c_str());
        if (!(l->cycle.contains(index(i_prev))))
        {
            // Case 1.2
            rLog(rlTranspositions, "k is in l: %d", (bool) l->trail.contains(index(k)));       // if true, a special update would be needed to maintain lazy decomposition
            swap(i_prev, i);
            rLog(rlTranspositions, "Case 1.2");
            Count(cTranspositionCase12);
            return false;
        }

This is part of the updating the vineyard for Case 1.

I was wondering what the comment "if true, a special update would be needed to maintain lazy decomposition" meant?

The plot_bars function's question

Hi Dimitriy,

I'm new to Dionysus (and to studying homology persistence),when I try to use Dionysus2 to achieve the learning-demo(from http://outlace.com/TDApart5.html),I got a problem which the plot_bars missing the longest bar in Betti 0,but the plot_bars work in Betti 1 is right.

My achieve GitHub Logo
should be GitHub Logo

this is my code:

import numpy as np
import dionysus as d
from __future__ import print_function

data = np.array([[1,4],[1,1],[6,1],[6,4]],dtype='double')
f = d.fill_rips(data, 2, 8.0)
p = d.homology_persistence(f)
dgms = d.init_diagrams(p, f)

d.plot.plot_bars(dgms[0],order='birth')

when I want to print the p,I got these message:

<0> 0:
<1> 0:
<2> 0:
<3> 0:
<0,1> 3:1 * <0> 0+1 * <1> 0
<2,3> 3:1 * <2> 0+1 * <3> 0
<0,3> 5:1 * <0> 0+1 * <2> 0
<1,2> 5:
<0,2> 5.83095:
<1,3> 5.83095:
<0,1,2> 5.83095:1 * <0,1> 3+1 * <1,2> 5+1 * <0,2> 5.83095
<0,1,3> 5.83095:1 * <0,1> 3+1 * <0,3> 5+1 * <1,3> 5.83095
<0,2,3> 5.83095:1 * <0,1> 3+1 * <2,3> 3+1 * <0,3> 5+1 * <1,2> 5
<1,2,3> 5.83095:

Thank you very much!

Best,
Jay

Simplex() does not work on fresh install

I am really having problem to follow installation instructions. I have a new machine where I never used Dionysus before.

Just now, I did (following instructions):

  1. pip install --verbose dionysus
  2. pip install --verbose --upgrade dionysus

Output of 2 was:

Installed version (2.0.4) is most up-to-date (past versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4) Requirement already up-to-date: dionysus in .local/lib/python2.7/site-packages

  1. I created a minimal py file to test some commands from http://mrzv.org/software/dionysus2/tutorial/basics.html
import dionysus as d
s = d.Simplex([0,1,2])

and when compiled with Python 2.7:

Traceback (most recent call last):
  File "dionysus.py", line 1, in <module>
    import dionysus as d
  File "/home/thiago/Dropbox/Programacao/dionysus/dionysus.py", line 2, in <module>
    s = d.Simplex([0,1,2])
AttributeError: 'module' object has no attribute 'Simplex'

I tried also other examples from the documentation, but no success (for example, d.Filtration() also does not work).

I appreciate any help how to install (using pip or from git, or anything else). I really would like to test Dionysus2.

Thanks in advance.

Installation failed on Windows 10

Hi,
I'm using Anaconda with Python 3.7 on Windows 10.
conda install -c conda-forge dionysus doesn't work and conda search dionysus --channel conda-forge doesn't find anything, so I tried pip install dionysus, which found the package, but failed to install it. Please find the log attached.

Cheers,
Niklas
dionysus_log.txt

Bottleneck Distances

I am having an issue when computing the bottleneck distance between two diagrams. When both persistence diagrams have a point that has inf as its death time, the bottleneck distance seems to hang and not return a value.

As a simple example, consider:
import dionysus as d
dgm1 = d.Diagram([(1,2), (3,4), (1., float('inf'))])
dgm2 = d.Diagram([(0,2), (3,5), (2., float('inf'))])
d.bottleneck_distance(dgm1,dgm2)

How to interpret homology_persistence output

The output of homology_persistence is not quite self explanatory. It would be nice to have a mre informative message for example, stating the birth and death of the homology class.
In my example, I use a filtration starting with 4 disconnected nodes, ending up forming a tetrahedron. What the output means?

simplices = [([0],1), ([1],2),([2],3),([3],4),([0,1],5),([2,3],6), ([1,2],7),([1,3],8), ([0,2],9), ([0,3],10)]
f =d.Filtration()
m = d.homology_persistence(f)
for c,i in enumerate(m):
   print(c,i)

(0, )
(1, )
(2, )
(3, )
(4, 10 + 11)
(5, 12 + 13)
(6, 11 + 12)
(7, )
(8, )
(9, )

No module named _dionysus

Hello, I have just installed following procedures from here: http://mrzv.org/software/dionysus2/.

But I am not able to load it. See below what happens. Any help, please.

thiago@chumbinho ~ $ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import dionysus
Traceback (most recent call last):
File "", line 1, in
File "/home/thiago/dionysus/build/bindings/python/dionysus/init.py", line 2, in
from ._dionysus import *
ImportError: No module named _dionysus

python bindings for ZigzagPersistence aren't letting me add to the persistence class

Greetings,

I wanted to run the sample triangle code and after a bit of troubleshooting, I realized that the ZigzagPersistence class does not have any of its internal functions visible, crucially the add() function. See the code below:

`
from dionysus import Simplex, ZigzagPersistence, Zp
complex = {Simplex((0,), 0): None, # A
Simplex((1,), 1): None, # B
Simplex((2,), 2): None, # C
Simplex((0,1), 2.5): None, # AB
Simplex((1,2), 2.9): None, # BC
Simplex((0,2), 3.5): None, # CA
Simplex((0,1,2), 5): None} # ABC

print ("Complex:")
for s in sorted(complex.keys()):
print(s)
prime_field = Zp(2)
zz = ZigzagPersistence(prime_field)
b = 1
for s in sorted(complex.keys()):
print("%d: Adding %s" % (b, s))
i,d = zz.add([complex[ss] for ss in s.boundary], b)
complex[s] = i
if d:
print("Interval (%d, %d)" % (d, b-1))
b += 1
`

Here I get the error:

`
AttributeError Traceback (most recent call last)
Cell In[5], line 9
7 for s in sorted(complex.keys()):
8 print("%d: Adding %s" % (b, s))
----> 9 i,d = zz.add([complex[ss] for ss in s.boundary], b)
10 complex[s] = i
11 if d:

AttributeError: 'dionysus._dionysus.ZigzagPersistence' object has no attribute 'add'
`

Additionally, when I call help() on the class, I see no visible functions other than the hidden ones:
image

Any help would be much appreciated.

-Marco

test_issue47.py::test_issue47 fails:

========================================================================================= FAILURES ==========================================================================================
_______________________________________________________________________________________ test_issue47 ________________________________________________________________________________________

    def test_issue47():
        # init the complex/filtration
        # any filtration that produces a diagram of only infinite points will work
        simplicies = [
            ([0], 0),
            ([1], 1),
        ]
    
        # create the filtration
        filtr = d.Filtration()
        for verts, idx in simplicies:
            simplex = d.Simplex(verts, idx)
            filtr.append(simplex)
        filtr.sort()
    
        # create the diagram
        m = d.homology_persistence(filtr)
        dgm = d.init_diagrams(m, filtr)
    
>       d.plot.plot_diagram(dgm[0])

test_issue47.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../stage/usr/local/lib/python3.9/site-packages/dionysus/plot.py:38: in plot_diagram
    ax = plt.axes()
/usr/local/lib/python3.9/site-packages/matplotlib/pyplot.py:1217: in axes
    fig = gcf()
/usr/local/lib/python3.9/site-packages/matplotlib/pyplot.py:1000: in gcf
    return figure()
/usr/local/lib/python3.9/site-packages/matplotlib/pyplot.py:934: in figure
    manager = new_figure_manager(
/usr/local/lib/python3.9/site-packages/matplotlib/pyplot.py:465: in new_figure_manager
    return _get_backend_mod().new_figure_manager(*args, **kwargs)
/usr/local/lib/python3.9/site-packages/matplotlib/backend_bases.py:3396: in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
/usr/local/lib/python3.9/site-packages/matplotlib/backend_bases.py:3401: in new_figure_manager_given_figure
    return cls.FigureCanvas.new_manager(figure, num)
/usr/local/lib/python3.9/site-packages/matplotlib/backend_bases.py:1785: in new_manager
    return cls.manager_class.create_with_canvas(cls, figure, num)
/usr/local/lib/python3.9/site-packages/matplotlib/backends/_backend_tk.py:486: in create_with_canvas
    window = tk.Tk(className="matplotlib")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tkinter.Tk object .>, screenName = None, baseName = '__main__', className = 'matplotlib', useTk = True, sync = False, use = None

    def __init__(self, screenName=None, baseName=None, className='Tk',
                 useTk=True, sync=False, use=None):
        """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will
        be created. BASENAME will be used for the identification of the profile file (see
        readprofile).
        It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
        is the name of the widget class."""
        self.master = None
        self.children = {}
        self._tkloaded = False
        # to avoid recursions in the getattr code in case of failure, we
        # ensure that self.tk is always _something_.
        self.tk = None
        if baseName is None:
            import os
            baseName = os.path.basename(sys.argv[0])
            baseName, ext = os.path.splitext(baseName)
            if ext not in ('.py', '.pyc'):
                baseName = baseName + ext
        interactive = False
>       self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
E       _tkinter.TclError: no display name and no $DISPLAY environment variable

/usr/local/lib/python3.9/tkinter/__init__.py:2270: TclError
================================================================================ 1 failed, 1 passed in 2.94s ================================================================================

Python-3.9
FreeBSD 14.0

Incorrect Homologies with Lower-star filtration

Hi!

It looks like there is a bug in the pybind code that implements "fill_freudenthal" method. Here's an example:

import dionysus as d
import numpy as np
import matplotlib.pyplot as plt

ex_arr = np.array([
       [5 , 4, 0],
       [3, 6, 7],
       [1, 8, 2]
]).astype('float')

plt.matshow(ex_arr)
plt.show()

f_lower_star = d.fill_freudenthal(ex_arr)

homology_persistence = d.homology_persistence(f_lower_star)
dgms = d.init_diagrams(homology_persistence, f_lower_star)

d.plot.plot_diagram(dgms[0])
plt.show()

print("Answer:", [d for d in dgms[0]])

Returns persistence features [(0,inf), (1,5), (2,6)], while the correct answer is [(0,inf), (1,4), (2,6)] (this is given by ripser as well).

It seems that for some reason f_lower_star doesn't contain the edge <1,3> in it's filtration sequence, which should appear at step 4, hence reduction gives wrong answer...

How to know which points form some bar code

Hi,

For a bar code, is it possible to know which points form this bar code? For example, if I use a distance matrix to create a filtration and then a reduced matrix, then I generate the bar code graph for the first dimension. If I have a bar code that lasts for an interval [a, b) in the first dimension, could I know which data points form this loop (a 1-dimensional bar code represents a loop)?

Thanks,

Hongyuan

segmentation fault when the filtration is not valid

It may be helpful to print out an error message when calling homology_persistence(f) with a filtration that is not correctly input.
For example,

simplices = [([1,2], 1), ([2,3],2)]
f = d.Filtration()
for vertices, time in simplices:
      f.append(d.Simplex(vertices, time))
m = d.homology_persistence(f)

Segmentation fault: 11

Trivial cycles

Hi, I was wondering if there is a simple way of checking if a cycle is trivial or not.
I have been trying to use m.homologous(c,z) where c is a chain that contains the cycle I want to check (a simple closed curve) is trivial and z is simply d.Chain([]).
For some reason the process seems to hang there indefinitely when I try to do this.

Another thing that I was wondering is what coefficient field is being used by default, because I need to know if I need to
take orientation into account when creating a chain.

fill_rips() works strange when using condensed distance matrices

I am testing my code using a toy data looks like below:
C{ W`%(C6}ZQR7_P T~9$T4
Its adjacency matrix is:
,1,,1,,,,,,,,,
1,,1,,1,,,,,,,,
,1,,,,1,,,,,,,
1,,,,1,,1,1,,,,,
,1,,1,,1,,,,,,,
,,1,,1,,,,2,,,,
,,,1,,,,1,,,,,
,,,1,,,1,,1,1,1,,1
,,,,,2,,1,,1,1,1,
,,,,,,,1,1,,,1,1
,,,,,,,1,1,,,3,1
,,,,,,,,1,1,3,,1
,,,,,,,1,,1,1,1,
then I take its reciprocal as distance matrix.
Then I transformed it to a condensed distance matrix and if use fill_rips(cdmat, 3, 1.1) obviously it will have 9 2-simplexes, but actually it returns only 7, which means that the topology of the network have changed, so strange.
Can I know if I did something wrong?

Installing problem on CentOS

After installing boost and typing command pip install --verbose dionysus, it get error when compile .cpp file in example

Installing collected packages: dionysus
Created temporary directory: /tmp/pip-record-dy70s7dj
Running command /share/home/yjiang/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/tmp/pip-install-4dgxrjal/dionysus/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-dy70s7dj/install-record.txt --single-version-externally-managed --compile
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/dionysus
copying bindings/python/dionysus/plot.py -> build/lib.linux-x86_64-3.7/dionysus
copying bindings/python/dionysus/version.py -> build/lib.linux-x86_64-3.7/dionysus
copying bindings/python/dionysus/init.py -> build/lib.linux-x86_64-3.7/dionysus
running build_ext
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost 1.70.0 at /share/home/yjiang/boost/lib/cmake/Boost-1.70.0
-- Requested configuration: QUIET
-- Found boost_headers 1.70.0 at /share/home/yjiang/boost/lib/cmake/boost_headers-1.70.0
-- Boost found.
-- Found PythonInterp: /share/home/yjiang/anaconda3/bin/python (found version "3.7")
-- Found PythonLibs: /share/home/yjiang/anaconda3/lib/libpython3.7m.so
-- Performing Test HAS_CPP14_FLAG
-- Performing Test HAS_CPP14_FLAG - Failed
-- Performing Test HAS_CPP11_FLAG
-- Performing Test HAS_CPP11_FLAG - Success
-- pybind11 v2.3.dev0
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pip-install-4dgxrjal/dionysus/build/temp.linux-x86_64-3.7
Scanning dependencies of target dionysus
[ 0%] Built target dionysus
Scanning dependencies of target dionysus
[ 7%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/filtration.cpp.o
[ 14%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/dionysus.cpp.o
[ 21%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/simplex.cpp.o
[ 28%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/field.cpp.o
[ 35%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/rips.cpp.o
[ 42%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/freudenthal.cpp.o
[ 50%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/persistence.cpp.o
In file included from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/row-reduction.h:4:0,
from /tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:6:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:109:63: error: template argument 1 is invalid
typename std::enable_if<I == sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:109:64: error: expected identifier before ‘::’ token
typename std::enable_if<I == sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:110:33: error: expected initializer before ‘visitors_chain_initialized’
visitors_chain_initialized(Chain& c) {}
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:113:62: error: template argument 1 is invalid
typename std::enable_if<I < sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:113:63: error: expected identifier before ‘::’ token
typename std::enable_if<I < sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:114:33: error: expected initializer before ‘visitors_chain_initialized’
visitors_chain_initialized(Chain& c) { std::get(visitors
).chain_initialized(this, c); visitors_chain_initialized<Chain, I+1>(c); }
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:118:63: error: template argument 1 is invalid
typename std::enable_if<I == sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:118:64: error: expected identifier before ‘::’ token
typename std::enable_if<I == sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:119:33: error: expected initializer before ‘visitors_addto’
visitors_addto(FieldElement m, Index cl) {}
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:122:62: error: template argument 1 is invalid
typename std::enable_if<I < sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:122:63: error: expected identifier before ‘::’ token
typename std::enable_if<I < sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:123:33: error: expected initializer before ‘visitors_addto’
visitors_addto(FieldElement m, Index cl) { std::get(visitors
).addto(this, m, cl); visitors_addto<I+1>(m, cl); }
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:127:63: error: template argument 1 is invalid
typename std::enable_if<I == sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:127:64: error: expected identifier before ‘::’ token
typename std::enable_if<I == sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:128:33: error: expected initializer before ‘visitors_reduction_finished’
visitors_reduction_finished() {}
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:131:62: error: template argument 1 is invalid
typename std::enable_if<I < sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:131:63: error: expected identifier before ‘::’ token
typename std::enable_if<I < sizeof...(Visitors), void>::type
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:132:33: error: expected initializer before ‘visitors_reduction_finished’
visitors_reduction_finished() { std::get(visitors
).reduction_finished(this); visitors_reduction_finished<I+1>(); }
^
In file included from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:164:0,
from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/row-reduction.h:4,
from /tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:6:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In member function ‘dionysus::ReducedMatrix<Field, Index, Comparison, Visitors>::Index dionysus::ReducedMatrix<Field, Index, Comparison, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index)’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:59:5: error: ‘visitors_reduction_finished’ was not declared in this scope
visitors_reduction_finished<>();
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:59:33: error: expected primary-expression before ‘>’ token
visitors_reduction_finished<>();
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:59:35: error: expected primary-expression before ‘)’ token
visitors_reduction_finished<>();
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In lambda function:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:76:60: error: expected primary-expression before ‘>’ token
{ this->visitors_addto<>(m, cl); },
^
[ 57%] Building CXX object bindings/python/CMakeFiles/dionysus.dir/diagram.cpp.o
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In instantiation of ‘void dionysus::ReducedMatrix<Field
, Index_, Comparison_, Visitors>::set(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index, dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:65:138: required from ‘void dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::set(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index, const ChainRange&) [with ChainRange = boost::range_detail::transformed_range<dionysus::ClearingReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField >]::lambda85, const boost::range_detail::filtered_range<dionysus::ClearingReduction<Persistence>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField >]::lambda84, const boost::iterator_range<dionysus::Simplex<int, float>::BoundaryChainIterator<dionysus::ZpField > > > >; Field = dionysus::ZpField; Index = unsigned int; Comparison = std::less; Visitors = {}; dionysus::ReducedMatrix<Field, Index, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/clearing-reduction.hpp:50:9: required from ‘void dionysus::ClearingReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField >]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:51:74: required from ‘PyReducedMatrix compute_homology_persistence(const PyFiltration&, const Relative&, dionysus::ZpField::Element, std::string, const Progress&) [with Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; Progress = ShowProgress; PyReducedMatrix = dionysus::ReducedMatrix<dionysus::ZpField >; PyFiltration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; dionysus::ZpField::Element = long int; std::string = std::basic_string]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:85:138: required from here
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:43:33: error: ‘visitors_chain_initialized’ was not declared in this scope
visitors_chain_initialized(c);
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In instantiation of ‘dionysus::ReducedMatrix<Field
, Index
, Comparison
, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:75:38: required from ‘struct dionysus::ReducedMatrix<Field
, Index
, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: required from ‘dionysus::ReducedMatrix<Field
, Index
, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:69:100: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:53:27: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/clearing-reduction.hpp:55:43: required from ‘void dionysus::ClearingReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField >]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:51:74: required from ‘PyReducedMatrix compute_homology_persistence(const PyFiltration&, const Relative&, dionysus::ZpField::Element, std::string, const Progress&) [with Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; Progress = ShowProgress; PyReducedMatrix = dionysus::ReducedMatrix<dionysus::ZpField >; PyFiltration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; dionysus::ZpField::Element = long int; std::string = std::basic_string]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:85:138: required from here
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:76:59: error: ‘class dionysus::ReducedMatrix<dionysus::ZpField >’ has no member named ‘visitors_addto’
{ this->visitors_addto<>(m, cl); },
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In instantiation of ‘dionysus::ReducedMatrix<Field
, Index
, Comparison
, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:69:100: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:53:27: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/clearing-reduction.hpp:55:43: required from ‘void dionysus::ClearingReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField >]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:51:74: required from ‘PyReducedMatrix compute_homology_persistence(const PyFiltration&, const Relative&, dionysus::ZpField::Element, std::string, const Progress&) [with Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; Progress = ShowProgress; PyReducedMatrix = dionysus::ReducedMatrix<dionysus::ZpField >; PyFiltration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; dionysus::ZpField::Element = long int; std::string = std::basic_string]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:85:138: required from here
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: error: no matching function for call to ‘dionysus::Reduction::reduce(dionysus::ReducedMatrix<dionysus::ZpField >::Chain&, const std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >&, const std::vector&, dionysus::ReducedMatrix<dionysus::ZpField >::Field&, dionysus::ReducedMatrix<Field
, Index
, Comparison
, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74, dionysus::ReducedMatrix<Field, Index, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda73&)’
entry_cmp);
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: note: candidates are:
In file included from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:8:0,
from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/row-reduction.h:4,
from /tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:6:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduction.h:40:11: note: template<class Chain1, class ChainsLookup, class LowLookup, class Field, class Comparison> static dionysus::Reduction<Index
>::Index dionysus::Reduction<Index
>::reduce(Chain1&, const ChainsLookup&, const LowLookup&, const Field&, dionysus::Reduction<Index_>::AddtoVisitor&, const Comparison&) [with Chain1 = Chain1; ChainsLookup = ChainsLookup; LowLookup = LowLookup; Field = Field; Comparison = Comparison; Index_ = unsigned int]
Index reduce(Chain1& c,
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduction.h:40:11: note: template argument deduction/substitution failed:
In file included from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:164:0,
from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/row-reduction.h:4,
from /tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:6:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: note: ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74’ is not derived from ‘dionysus::Reduction::AddtoVisitor’
entry_cmp);
^
In file included from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:8:0,
from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/row-reduction.h:4,
from /tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:6:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduction.h:76:11: note: template<class Chain1, class Chain2, class Field, class Comparison> static dionysus::Reduction<Index
>::Index dionysus::Reduction<Index
>::reduce(Chain1&, const std::vector&, const std::vector&, const Field&, dionysus::Reduction<Index_>::AddtoVisitor&, const Comparison&) [with Chain1 = Chain1; Chain2 = Chain2; Field = Field; Comparison = Comparison; Index_ = unsigned int]
Index reduce(Chain1& c,
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduction.h:76:11: note: template argument deduction/substitution failed:
In file included from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:164:0,
from /tmp/pip-install-4dgxrjal/dionysus/include/dionysus/row-reduction.h:4,
from /tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:6:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: note: ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74’ is not derived from ‘dionysus::Reduction::AddtoVisitor’
entry_cmp);
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In instantiation of ‘void dionysus::ReducedMatrix<Field
, Index
, Comparison_, Visitors>::set(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index, dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:22:28: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::add(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:61:135: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::add(const ChainRange&) [with ChainRange = boost::range_detail::transformed_range<dionysus::StandardReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]::lambda81, const boost::range_detail::filtered_range<dionysus::StandardReduction<Persistence>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]::lambda80, const boost::iterator_range<dionysus::Simplex<int, float>::BoundaryChainIterator<dionysus::ZpField > > > >; Field = dionysus::ZpField; Index = unsigned int; Comparison = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field, Index, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/standard-reduction.hpp:42:115: required from ‘void dionysus::StandardReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:74:74: required from ‘PyReducedMatrix compute_homology_persistence(const PyFiltration&, const Relative&, dionysus::ZpField::Element, std::string, const Progress&) [with Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; Progress = ShowProgress; PyReducedMatrix = dionysus::ReducedMatrix<dionysus::ZpField >; PyFiltration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; dionysus::ZpField::Element = long int; std::string = std::basic_string]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:85:138: required from here
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:43:33: error: ‘visitors_chain_initialized’ was not declared in this scope
visitors_chain_initialized(c);
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In instantiation of ‘dionysus::ReducedMatrix<Field
, Index
, Comparison
, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:75:38: required from ‘struct dionysus::ReducedMatrix<Field
, Index
, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]::lambda74’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: required from ‘dionysus::ReducedMatrix<Field
, Index
, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:69:100: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:53:27: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:24:20: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::add(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:61:135: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::add(const ChainRange&) [with ChainRange = boost::range_detail::transformed_range<dionysus::StandardReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]::lambda81, const boost::range_detail::filtered_range<dionysus::StandardReduction<Persistence>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]::lambda80, const boost::iterator_range<dionysus::Simplex<int, float>::BoundaryChainIterator<dionysus::ZpField > > > >; Field = dionysus::ZpField; Index = unsigned int; Comparison = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field, Index, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/standard-reduction.hpp:42:115: required from ‘void dionysus::StandardReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:74:74: required from ‘PyReducedMatrix compute_homology_persistence(const PyFiltration&, const Relative&, dionysus::ZpField::Element, std::string, const Progress&) [with Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; Progress = ShowProgress; PyReducedMatrix = dionysus::ReducedMatrix<dionysus::ZpField >; PyFiltration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; dionysus::ZpField::Element = long int; std::string = std::basic_string]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:85:138: required from here
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:76:59: error: ‘class dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>’ has no member named ‘visitors_addto’
{ this->visitors_addto<>(m, cl); },
^
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp: In instantiation of ‘dionysus::ReducedMatrix<Field
, Index
, Comparison
, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&, const ChainsLookup&, const LowLookup&) [with ChainsLookup = std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > > > >; LowLookup = std::vector; Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’:
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:69:100: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:53:27: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::reduce(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:24:20: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::add(dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain&&) [with Field_ = dionysus::ZpField; Index_ = unsigned int; Comparison_ = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index = unsigned int; dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Chain = std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.h:61:135: required from ‘dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::Index dionysus::ReducedMatrix<Field_, Index_, Comparison_, Visitors>::add(const ChainRange&) [with ChainRange = boost::range_detail::transformed_range<dionysus::StandardReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]::lambda81, const boost::range_detail::filtered_range<dionysus::StandardReduction<Persistence>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]::lambda80, const boost::iterator_range<dionysus::Simplex<int, float>::BoundaryChainIterator<dionysus::ZpField > > > >; Field = dionysus::ZpField; Index = unsigned int; Comparison = std::less; Visitors = {dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor}; dionysus::ReducedMatrix<Field, Index, Comparison_, Visitors>::Index = unsigned int]’
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/standard-reduction.hpp:42:115: required from ‘void dionysus::StandardReduction<Persistence_>::operator()(const Filtration&, const Relative&, const ReportPair&, const Progress&) [with Filtration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; ReportPair = void (*)(int, unsigned int, unsigned int); Progress = ShowProgress; Persistence = dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:74:74: required from ‘PyReducedMatrix compute_homology_persistence(const PyFiltration&, const Relative&, dionysus::ZpField::Element, std::string, const Progress&) [with Relative = homology_persistence(const PyFiltration&, dionysus::ZpField::Element, std::string, bool)::lambda92; Progress = ShowProgress; PyReducedMatrix = dionysus::ReducedMatrix<dionysus::ZpField >; PyFiltration = dionysus::Filtration<dionysus::Simplex<int, float>, boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> > >, true>; dionysus::ZpField::Element = long int; std::string = std::basic_string]’
/tmp/pip-install-4dgxrjal/dionysus/bindings/python/persistence.cpp:85:138: required from here
/tmp/pip-install-4dgxrjal/dionysus/include/dionysus/reduced-matrix.hpp:77:46: error: no matching function for call to ‘dionysus::Reduction::reduce(dionysus::ReducedMatrix<dionysus::ZpField, unsigned int, std::less, dionysus::NoNegative<dionysus::ZpField, unsigned int, std::less >::Visitor>::Chain&, const std::vector<std::vector<dionysus::ChainEntry<dionysus::ZpField, unsigned int>, std::allocator<dionysus::ChainEntry<dionysus::ZpField, unsigned int> > >, std::allocator<std::vector<dionysus::ChainEntry<dionysus::ZpField

Pickle persistence diagrams

run the following code in python3 result in a error

def computePD(i):
    import dionysus as d
    import numpy as np
    np.random.seed(42)
    f1 = d.fill_rips(np.random.random((i+10, 2)), 2, 1)
    m1 = d.homology_persistence(f1)
    dgms1 = d.init_diagrams(m1, f1)
    return dgms1[1]
def get_dgms(n_jobs=1):
    from joblib import delayed, Parallel
    return Parallel(n_jobs=n_jobs)(delayed(computePD)(i) for i in range(10))
result = get_dgms(2)
TypeError: can't pickle dionysus._dionysus.Diagram objects

Hopefully it is not too much work to make persistence diagram pickleable.

When you construct a filtration from a list of simplices it sets all their data to 0

Like the title says. The "bad" lines are 52 and 53. I am guessing this is a bug and not a feature.

In [48]: simplices_tups = [([2], 4), ([1,2], 5), ([0,2], 6),
    ...:               ([0], 1),   ([1], 2), ([0,1], 3)]

In [49]: simplices = [dion.Simplex(vertices, data) for vertices, data in simplices_tups]

In [50]: simplices[0]
Out[50]: <2> 4

In [51]: filtration_cons_tups = dion.Filtration(simplices_tups)

In [52]: filtration_cons_tups[0]
Out[52]: <2> 4

In [53]: filtration_cons_simplices = dion.Filtration(simplices)

In [54]: filtration_cons_simplices[0]
Out[54]: <2> 0

In [55]: filtration_append_simplex = dion.Filtration()
    ...: for vertices, data in simplices_tups:
    ...:     filtration_append_simplex.append(dion.Simplex(vertices, data))
    ...:     

In [56]: filtration_append_simplex[0]
Out[56]: <2> 4

Make fails:

Following

mkdir build
cd build
cmake ..
make

I obtain the following error:

error: ‘numeric_limits’ is not a member of ‘std’

which i fixed locally by adding #Include <limits> to dionysus/include/dionysus/reduction.h and dionysus/include/dionysus/diagram.h

Occurs on both Linux (Ubuntu 22.04) and MacOS (Ventura).

pip install failure

Hi,

I am trying to pip install within my virtualenv, but it failed to build with the following error:

[IDH] [ddkim1@q1prphtcs18 TDA_analysis]$ pip install --verbose dionysus
Collecting dionysus
  1 location(s) to search for versions of dionysus:
  * https://pypi.python.org/simple/dionysus/
  Getting page https://pypi.python.org/simple/dionysus/
  Looking up "https://pypi.python.org/simple/dionysus/" in the cache
  Returning cached "301 Moved Permanently" response (ignoring date and etag information)
  Looking up "https://pypi.org/simple/dionysus/" in the cache
  Current age based on date: 667
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  Starting new HTTPS connection (1): pypi.org
  "GET /simple/dionysus/ HTTP/1.1" 304 0
  Analyzing links from page https://pypi.org/simple/dionysus/
    Found link https://files.pythonhosted.org/packages/cf/58/4f56cbc4125ae89f69b2862107014e06fc6a12a36b7fb6e94ad95eab36c3/dionysus-2.0.1.tar.gz#sha256=040e45d9bd415dfdc02dd9bf257affe9e865c029dbfef9d703144e6cf7311fcf (from https://pypi.org/simple/dionysus/), version: 2.0.1
    Found link https://files.pythonhosted.org/packages/47/5f/fdff2b2868de745a07614077f303bb45316644bc032ebfaca1436d728440/dionysus-2.0.2.tar.gz#sha256=78c24da06fd273f0103ad4cb86331f5f4518d7f0445e2cecd0e325ca1a2d011f (from https://pypi.org/simple/dionysus/), version: 2.0.2
    Found link https://files.pythonhosted.org/packages/20/77/e6395687eb442e7dcb37ceb3ad5646f222ac74739b0aa186189a22085ee7/dionysus-2.0.3.tar.gz#sha256=cdd44b3dfd7199290f28af1b6d3fdd61167db231601330a9b73cad083a86366d (from https://pypi.org/simple/dionysus/), version: 2.0.3
    Found link https://files.pythonhosted.org/packages/e7/7c/9e5f6911dfac70ac62a544155f9e3b4436f20a8c4e8559aeb492381549c1/dionysus-2.0.4.tar.gz#sha256=e411396c63aa6838e414c18979d4d90a28fcc60ae1660389e6b777a43479bf40 (from https://pypi.org/simple/dionysus/), version: 2.0.4
  Using version 2.0.4 (newest of versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4)
  Looking up "https://files.pythonhosted.org/packages/e7/7c/9e5f6911dfac70ac62a544155f9e3b4436f20a8c4e8559aeb492381549c1/dionysus-2.0.4.tar.gz" in the cache
  Current age based on date: 667
  Freshness lifetime from max-age: 365000000
  The response is "fresh", returning cached response
  365000000 > 667
  Using cached https://files.pythonhosted.org/packages/e7/7c/9e5f6911dfac70ac62a544155f9e3b4436f20a8c4e8559aeb492381549c1/dionysus-2.0.4.tar.gz
  Downloading from URL https://files.pythonhosted.org/packages/e7/7c/9e5f6911dfac70ac62a544155f9e3b4436f20a8c4e8559aeb492381549c1/dionysus-2.0.4.tar.gz#sha256=e411396c63aa6838e414c18979d4d90a28fcc60ae1660389e6b777a43479bf40 (from https://pypi.org/simple/dionysus/)
  Running setup.py (path:/tmp/pip-build-Cy8XoO/dionysus/setup.py) egg_info for package dionysus
    Running command python setup.py egg_info
    running egg_info
    creating pip-egg-info/dionysus.egg-info
    writing pip-egg-info/dionysus.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/dionysus.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/dionysus.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/dionysus.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/dionysus.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*' found under directory './.hg'
    warning: no previously-included files matching '*' found under directory './doc/_build'
    warning: no previously-included files matching '*' found under directory './dist'
    warning: no previously-included files found matching '.hgignore'
    warning: no previously-included files found matching '.hgsubtree'
    warning: no previously-included files found matching 'tags'
    warning: no previously-included files matching '*.orig' found under directory '.'
    writing manifest file 'pip-egg-info/dionysus.egg-info/SOURCES.txt'
  Source in /tmp/pip-build-Cy8XoO/dionysus has version 2.0.4, which satisfies requirement dionysus from https://files.pythonhosted.org/packages/e7/7c/9e5f6911dfac70ac62a544155f9e3b4436f20a8c4e8559aeb492381549c1/dionysus-2.0.4.tar.gz#sha256=e411396c63aa6838e414c18979d4d90a28fcc60ae1660389e6b777a43479bf40
Building wheels for collected packages: dionysus
  Running setup.py bdist_wheel for dionysus ...   Destination directory: /tmp/tmpssbuGmpip-wheel-
  Running command /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cy8XoO/dionysus/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpssbuGmpip-wheel- --python-tag cp27
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/dionysus
  copying bindings/python/dionysus/plot.py -> build/lib.linux-x86_64-2.7/dionysus
  copying bindings/python/dionysus/_version.py -> build/lib.linux-x86_64-2.7/dionysus
  copying bindings/python/dionysus/__init__.py -> build/lib.linux-x86_64-2.7/dionysus
  running build_ext
  -- The C compiler identification is GNU 4.8.5
  -- The CXX compiler identification is GNU 4.8.5
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Could NOT find Boost
  -- Found PythonInterp: /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 (found version "2.7.13")
  -- Found PythonLibs: /software/x86_64/python/2.7.13/lib/libpython2.7.so
  -- Performing Test HAS_CPP14_FLAG
  **-- Performing Test HAS_CPP14_FLAG - Failed**
  -- Performing Test HAS_CPP11_FLAG
  -- Performing Test HAS_CPP11_FLAG - Success
  -- pybind11 v2.2.0
  -- Performing Test HAS_FLTO
  -- Performing Test HAS_FLTO - Success
  -- LTO enabled
  **CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  Boost_INCLUDE_DIR (ADVANCED)
     used as include directory in directory /tmp/pip-build-Cy8XoO/dionysus/bindings/python
     used as include directory in directory /tmp/pip-build-Cy8XoO/dionysus/bindings/python**

  **-- Configuring incomplete, errors occurred!**
  See also "/tmp/pip-build-Cy8XoO/dionysus/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log".
  See also "/tmp/pip-build-Cy8XoO/dionysus/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeError.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-Cy8XoO/dionysus/setup.py", line 97, in <module>
      zip_safe=False,
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 204, in run
      self.run_command('build')
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/command/build.py", line 127, in run
      self.run_command(cmd_name)
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-Cy8XoO/dionysus/setup.py", line 39, in run
      self.build_extension(ext)
    File "/tmp/pip-build-Cy8XoO/dionysus/setup.py", line 64, in build_extension
      subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
    File "/software/x86_64/python/2.7.13/lib/python2.7/subprocess.py", line 186, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-build-Cy8XoO/dionysus', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-Cy8XoO/dionysus/build/lib.linux-x86_64-2.7', '-DPYTHON_EXECUTABLE=/rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7', '-Dbuild_examples=OFF', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1
error
  **Failed building wheel for dionysus**
  Running setup.py clean for dionysus
  Running command /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cy8XoO/dionysus/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all
  running clean
  removing 'build/temp.linux-x86_64-2.7' (and everything under it)
  removing 'build/lib.linux-x86_64-2.7' (and everything under it)
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-2.7' does not exist -- can't clean it
  removing 'build'
**Failed to build dionysus**
Installing collected packages: dionysus
  Running setup.py install for dionysus ...     Running command /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cy8XoO/dionysus/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-283Fmb-record/install-record.txt --single-version-externally-managed --compile --install-headers /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/include/site/python2.7/dionysus
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/dionysus
    copying bindings/python/dionysus/plot.py -> build/lib.linux-x86_64-2.7/dionysus
    copying bindings/python/dionysus/_version.py -> build/lib.linux-x86_64-2.7/dionysus
    copying bindings/python/dionysus/__init__.py -> build/lib.linux-x86_64-2.7/dionysus
    running build_ext
    -- The C compiler identification is GNU 4.8.5
    -- The CXX compiler identification is GNU 4.8.5
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Could NOT find Boost
    -- Found PythonInterp: /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 (found version "2.7.13")
    -- Found PythonLibs: /software/x86_64/python/2.7.13/lib/libpython2.7.so
    -- Performing Test HAS_CPP14_FLAG
    **-- Performing Test HAS_CPP14_FLAG - Failed**
    -- Performing Test HAS_CPP11_FLAG
    -- Performing Test HAS_CPP11_FLAG - Success
    -- pybind11 v2.2.0
    -- Performing Test HAS_FLTO
    -- Performing Test HAS_FLTO - Success
    -- LTO enabled
    **CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    Boost_INCLUDE_DIR (ADVANCED)
       used as include directory in directory /tmp/pip-build-Cy8XoO/dionysus/bindings/python
       used as include directory in directory /tmp/pip-build-Cy8XoO/dionysus/bindings/python**

    **-- Configuring incomplete, errors occurred!**
    See also "/tmp/pip-build-Cy8XoO/dionysus/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log".
    See also "/tmp/pip-build-Cy8XoO/dionysus/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-Cy8XoO/dionysus/setup.py", line 97, in <module>
        zip_safe=False,
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/software/x86_64/python/2.7.13/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/command/install.py", line 563, in run
        self.run_command('build')
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/software/x86_64/python/2.7.13/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-Cy8XoO/dionysus/setup.py", line 39, in run
        self.build_extension(ext)
      File "/tmp/pip-build-Cy8XoO/dionysus/setup.py", line 64, in build_extension
        subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
      File "/software/x86_64/python/2.7.13/lib/python2.7/subprocess.py", line 186, in check_call
        raise CalledProcessError(retcode, cmd)
    **subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-build-Cy8XoO/dionysus', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-Cy8XoO/dionysus/build/lib.linux-x86_64-2.7', '-DPYTHON_EXECUTABLE=/rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7', '-Dbuild_examples=OFF', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1
error**
Cleaning up...
  Removing source in /tmp/pip-build-Cy8XoO/dionysus
Command "/rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cy8XoO/dionysus/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-283Fmb-record/install-record.txt --single-version-externally-managed --compile --install-headers /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/include/site/python2.7/dionysus" failed with error code 1 in /tmp/pip-build-Cy8XoO/dionysus/
Exception information:
Traceback (most recent call last):
  File "/software/x86_64/python/2.7.13/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/software/x86_64/python/2.7.13/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/software/x86_64/python/2.7.13/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/software/x86_64/python/2.7.13/lib/python2.7/site-packages/pip/req/req_install.py", line 878, in install
    spinner=spinner,
  File "/software/x86_64/python/2.7.13/lib/python2.7/site-packages/pip/utils/__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "/rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cy8XoO/dionysus/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-283Fmb-record/install-record.txt --single-version-externally-managed --compile --install-headers /rsrch1/bcb/Imaging-Genomics_SIBL/DONNIE_KIM/Brachy_deep_learning/IDH_Prediction/IDH/include/site/python2.7/dionysus" failed with error code 1 in /tmp/pip-build-Cy8XoO/dionysus/
`

I think the issue is that when building, it is using certain variables in the project, but somehow they are not connected correctly...? as below?

**CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  Boost_INCLUDE_DIR (ADVANCED)
     used as include directory in directory /tmp/pip-build-Cy8XoO/dionysus/bindings/python
     used as include directory in directory /tmp/pip-build-Cy8XoO/dionysus/bindings/python**

Any suggestions to solve this issue?

Print progress

Is it possible to track how long the computations will take and intermittently print information about progress?

For example, Keras will print progress information during the fitting process.

Epoch 1/100
0s - loss: 0.2506 - acc: 0.5750 - val_loss: 0.2501 - val_acc: 0.3750
Epoch 2/100
0s - loss: 0.2487 - acc: 0.6250 - val_loss: 0.2498 - val_acc: 0.6250
Epoch 3/100
0s - loss: 0.2495 - acc: 0.5750 - val_loss: 0.2496 - val_acc: 0.6250

This would be very helpful, as it is currently not clear how long computations will take.

Representative cycles in zigzag persistence homology for all cycles

Hi @mrzv

In the documentation for zigzag persistence homology, it is shown how to extract the representation of the alive cycles -

for z in zz:
    print(' + '.join("%d * (%s)" % (x.element, f[cells[x.index]]) for x in z))

Is there a way to find the representative cycles of all the cycles in the persistence diagram? A possibility is to use
zz, dgms, cells = d.zigzag_homology_persistence(f, times, callback = detail) as in the documentation, but I was wondering if there was a utility that gives (birth, death, representative cycle) for the zigzag persistence homology.

Thank you in advance!

Failing to build-Cygwin

Hello! I'm new to much of this, but I've tried many ways to get Dionysus 2 installed on my Windows 10 PC in Python2, Python3, Visual Studio 2017, and now Cygwin. Focusing just on Cygwin, CMake appears to successfully create the build files. But when I run Make, in the build directory, what I get is below. Cygwin has gcc 6.4.0 installed, along with Boost 1.66. Any insight at all would be helpful, even though I've read from your previous posts that you're not a Windows user. Thanks.

$ make
Scanning dependencies of target zigzag-filtration-persistence
[ 2%] Building CXX object examples/filtration/CMakeFiles/zigzag-filtration-persistence.dir/zigzag-filtration-persistence.cpp.o
In file included from /home/dionysus-master/examples/include/format/format.h:2543:0,
from /home/dionysus-master/examples/include/format.h:6,
from /home/dionysus-master/examples/filtration/zigzag-filtration-persistence.cpp:15:
/home/dionysus-master/examples/include/format/format.cc: In function ‘int {anonymous}::safe_strerror(int, char*&, std::size_t)’:
/home/dionysus-master/examples/include/format/format.cc:162:54: error: ‘strerror_r’ was not declared in this scope
result = strerror_r(error_code, buffer, buffer_size);
^
make[2]: *** [examples/filtration/CMakeFiles/zigzag-filtration-persistence.dir/build.make:63: examples/filtration/CMakeFiles/zigzag-filtration-persistence.dir/zigzag-filtration-persistence.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: examples/filtration/CMakeFiles/zigzag-filtration-persistence.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Plotting fails on diagram with no finite points

One of my students ran into a bug with plotting a diagram with no finite points. Here is a minimal example that produces the error. I am putting together a PR with a proposed solution and will send it over in a few min.

import dionysus

# init the complex/filtration
# any filtration that produces a diagram of only infinite points will work
simplicies = [
    ([0], 0),
    ([1], 1),
]

# create the filtration
filtr = dionysus.Filtration()
for verts, idx in simplicies:
    simplex = dionysus.Simplex(verts, idx)
    filtr.append(simplex)
filtr.sort()

# create the diagram
m = dionysus.homology_persistence(filtr)
dgm = dionysus.init_diagrams(m, filtr)
dgm0 = dgm[0]
for pt in dgm0:
    print(pt.birth, pt.death)

# trigger error
dionysus.plot.plot_diagram(dgm0)

Wasserstein Distance for Diagrams Seems to Hang

I'm trying to compute the Wasserstein distance between two persistence diagrams computed using the Dionysus library. I realize that the Wasserstein computation is actually part of the hera library, but I know @mrzv worked on that code as well, so hopefully this is an acceptable place to post this issue.

When computing the Wasserstein distance, I find that the computation hangs during the auction phase. I dug into the hera code a bit, and it looks like runAuctionPhase() (line here) never empties its unassignedBidders object. Experimenting with different parameter configurations (delta, epsilon, etc.) I've found that I can get unassignedBidders.size() to 2, but no lower. I would think it has something to do with the replacement of unassignedBidders but I'm struggling to understand the auction algorithm enough to diagnose the problem completely. Any thoughts on this?

My diagrams look something like this, so their unusual structure may be causing problems:

image

I generate the diagrams via:

Fltr ff;
...
Field q;
Persistence persistence(q);
StandardReduction<Persistence> reduce(persistence);
reduce(ff);

auto dgmsf = init_diagrams(persistence, ff, [&](const Smplx& s) -> float {  return s.data(); },
                    [](Persistence::Index i) { return i; });

where Fltr is a Filtration<Simplex> type and Field is of Q<float>. I then compare the diagrams like:

double wasserstein = geom_ws::wassersteinDist(dgmsf[0], dgmss[0], 2.0);

but I've also tried different configurations of epsilon, delta, etc. and find the hanging persists. Any ideas you have on this issues would be greatly appreciated.

Also, thanks for the excellent rewrite. I've found it pretty easy to migrate to this second version from Dionysus 1. As well, computing Wasserstein distances in Dionysus 1 was not fun performance-wise, so I look forward to using this version.

Cannot Load submodules in python

Hi

I have tried both installing dionysus via pip install in an anaconda environment and using git clone, building myself as per instructions in:

https://mrzv.org/software/dionysus2/

Things like
import dionysus as d s = d.Simplex([0,1,2]) f = d.Filtration()

Work fine but when I run

from dionysus import RipsI get this error

`
Python 3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.

from dionysus import Rips
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'Rips' from 'dionysus' (/home/harryem/dionysus/build/bindings/python/dionysus/init.py)
`

This is the output of sys.path:

`

import sys
print(sys.path)
['', '/home/harryem/dionysus/build/bindings/python', '/home/harryem/dionysus/.../build/bindings/python', '/home/harryem/anaconda3/envs/py37/lib/python37.zip', '/home/harryem/anaconda3/envs/py37/lib/python3.7', '/home/harryem/anaconda3/envs/py37/lib/python3.7/lib-dynload', '/home/harryem/.local/lib/python3.7/site-packages', '/home/harryem/anaconda3/envs/py37/lib/python3.7/site-packages']
`

Please let me know if I can provide any other information?

Thanks,
Harry

Add Filtration.permute()

Add permute or rearrange method to Filtration. See email exchange with Primoz for motivation.

issue with installing on windows

I getting an error when I am trying to install dionysus on my windows machine (I know linux is better). The issue seems to be related to setuptools. Is there any workaround for this. I have python 3.10.7 and pip 22.2.2 and setuptools seems to be installed.
thank you

× Running setup.py install for dionysus did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: 'C:\Users\pkudela1\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' -u -c '
exec(compile('"'"''"'"''"'"'

This is -- a caller that pip uses to run setup.py

- It imports setuptools before invoking setup.py, to enable projects that directly

import from distutils.core to work with newer packaging standards.

- It provides a clear error message when setuptools is not installed.

- It sets sys.argv[0] to the underlying setup.py, when invoking setup.py so

setuptools doesn'"'"'t think the script is -c. This avoids the following warning:

manifest_maker: standard file '"'"'-c'"'"' not found".

- It generates a shim setup.py, for handling setup.cfg-only projects.

import os, sys, tokenize

try:
import setuptools
except ImportError as error:
print(
"ERROR: Can not execute setup.py since setuptools is not available in "
"the build environment.",
file=sys.stderr,
)
sys.exit(1)

file = %r
sys.argv[0] = file

if os.path.exists(file):
filename = file
with tokenize.open(file) as f:
setup_py_code = f.read()
else:
filename = ""
setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'C:\Users\pkudela1\AppData\Local\Temp\pip-req-build-twzf6oui\setup.py'"'"',), "", "exec"))' install --record 'C:\Users\pkudela1\AppData\Local\Temp\pip-record-mf61_egy\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\pkudela1\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Include\dionysus'
cwd: C:\Users\pkudela1\AppData\Local\Temp\pip-req-build-twzf6oui
Running setup.py install for dionysus ... error
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dionysus

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

ERROR: Could not build wheels for dionysus, which is required to install pyproject.toml-based projects

env

  • Win10
  • Python 3.10.0
  • pytorch torch1.11
  • CUDA Version: 12.3

When I install dionysus,met this error:
ERROR: Could not build wheels for dionysus, which is required to install pyproject.toml-based projects

the detail is below:

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting dionysus
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/5a/9f/dfc7c340a269cdbe686a605afbae5df9037006b2178c3d0a32e36ae854f7/dionysus-2.0.10.tar.gz (1.8 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: dionysus
  Building wheel for dionysus (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [76 lines of output]
      C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\dist.py:472: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!

              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.

              By 2024-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        opt = self.warn_dash_deprecation(opt, section)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\dionysus
      copying bindings\python\dionysus\plot.py -> build\lib.win-amd64-cpython-310\dionysus
      copying bindings\python\dionysus\_version.py -> build\lib.win-amd64-cpython-310\dionysus
      copying bindings\python\dionysus\__init__.py -> build\lib.win-amd64-cpython-310\dionysus
      running build_ext
      Traceback (most recent call last):
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-o25q5zo5\dionysus_155516ad4e9a49279c2a83a9eb6b1472\setup.py", line 28, in run
          out = subprocess.check_output(['cmake', '--version'])
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\subprocess.py", line 421, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\subprocess.py", line 503, in run
          with Popen(*popenargs, **kwargs) as process:
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\subprocess.py", line 971, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\subprocess.py", line 1456, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      FileNotFoundError: [WinError 2] 系统找不到指定的文件。

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-o25q5zo5\dionysus_155516ad4e9a49279c2a83a9eb6b1472\setup.py", line 67, in <module>
          setup(
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\wheel\bdist_wheel.py", line 364, in run
          self.run_command("build")
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\dist.py", line 963, in run_command
          super().run_command(command)
        File "C:\Users\Administrator\anaconda3\envs\py310\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-o25q5zo5\dionysus_155516ad4e9a49279c2a83a9eb6b1472\setup.py", line 30, in run
          raise RuntimeError("CMake must be installed to build the following extensions: " +
      RuntimeError: CMake must be installed to build the following extensions: dionysus
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dionysus
  Running setup.py clean for dionysus
Failed to build dionysus
ERROR: Could not build wheels for dionysus, which is required to install pyproject.toml-based projects

Expose cycle equivalence code to python

As mentioned on the mailing list: would it be possible to add the functionality of judging equivalence of two cycles (i.e., whether they are in the same homology class) to the python bindings?

clang-18 fails to compile dionysus: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'Index' (aka 'unsigned int') in initializer list

/wrkdirs/usr/ports/math/py-dionysus/work/dionysus-2.0.10/bindings/python/boundary.cpp:71:75: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'Index' (aka 'unsigned int') in initializer list [-Wc++11-narrowing-const-reference]
   71 |             m.column(n - 1 - x.index()).emplace_back(Entry { x.element(), n - 1 - i });
      |                                                                           ^~~~~~~~~
1 error generated.

log

Version: 2.0.10
FreeBSD 14.0

Build error on Ubuntu 14.04 and boost 1.54

I am getting the following error when i try to build dionysus on an Ubuntu 14.04 machine with the default boost 1.54 installed using apt-get

Scanning dependencies of target wasserstein
[  4%] Building CXX object ext_build/hera/wasserstein/CMakeFiles/wasserstein.dir/src/auction_oracle.cpp.o
[  9%] Building CXX object ext_build/hera/wasserstein/CMakeFiles/wasserstein.dir/src/auction_runner_gs.cpp.o
[ 14%] Building CXX object ext_build/hera/wasserstein/CMakeFiles/wasserstein.dir/src/auction_runner_jac.cpp.o
[ 19%] Building CXX object ext_build/hera/wasserstein/CMakeFiles/wasserstein.dir/src/basic_defs.cpp.o
[ 23%] Building CXX object ext_build/hera/wasserstein/CMakeFiles/wasserstein.dir/src/wasserstein.cpp.o
[ 28%] Linking CXX static library libwasserstein.a
[ 28%] Built target wasserstein
Scanning dependencies of target wasserstein_dist
[ 33%] Building CXX object ext_build/hera/wasserstein/CMakeFiles/wasserstein_dist.dir/example/wasserstein_dist.cpp.o
[ 38%] Linking CXX executable wasserstein_dist
[ 38%] Built target wasserstein_dist
Scanning dependencies of target _dionysus
[ 42%] Building CXX object bindings/python/CMakeFiles/_dionysus.dir/dionysus.cpp.o
[ 47%] Building CXX object bindings/python/CMakeFiles/_dionysus.dir/filtration.cpp.o
In file included from /home/cdeepakroy/work/Libs/dionysus/bindings/python/filtration.h:3:0,
                 from /home/cdeepakroy/work/Libs/dionysus/bindings/python/filtration.cpp:7:
/home/cdeepakroy/work/Libs/dionysus/include/dionysus/filtration.h: In instantiation of ‘void dionysus::Filtration<Cell_, CellLookupIndex_>::emplace_back(Args&& ...) [with Args = {const dionysus::Simplex<int, float>&}; Cell_ = dionysus::Simplex<int, float>; CellLookupIndex_ = boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> >, mpl_::na, mpl_::na, mpl_::na>]’:
/home/cdeepakroy/work/Libs/dionysus/include/dionysus/filtration.h:66:135:   required from ‘size_t dionysus::Filtration<Cell_, CellLookupIndex_>::add(const Cell&) [with Cell_ = dionysus::Simplex<int, float>; CellLookupIndex_ = boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> >, mpl_::na, mpl_::na, mpl_::na>; size_t = long unsigned int; dionysus::Filtration<Cell_, CellLookupIndex_>::Cell = dionysus::Simplex<int, float>]’
/home/cdeepakroy/work/Libs/dionysus/bindings/python/filtration.cpp:18:90:   required from here
/home/cdeepakroy/work/Libs/dionysus/include/dionysus/filtration.h:71:83: error: ‘boost::multi_index::multi_index_container<dionysus::Simplex<int, float>, boost::multi_index::indexed_by<boost::multi_index::hashed_unique<boost::multi_index::identity<dionysus::Simplex<int, float> >, mpl_::na, mpl_::na, mpl_::na>, boost::multi_index::random_access<boost::multi_index::tag<dionysus::Filtration<dionysus::Simplex<int, float> >::order, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na> >, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, std::allocator<dionysus::Simplex<int, float> > >::index<dionysus::Filtration<dionysus::Simplex<int, float> >::order>::type’ has no member named ‘emplace_back’
         void                emplace_back(Args&&... args)                        { cells_.template get<order>().emplace_back(std::forward<Args>(args)...); }
                                                                                   ^
make[2]: *** [bindings/python/CMakeFiles/_dionysus.dir/filtration.cpp.o] Error 1
make[1]: *** [bindings/python/CMakeFiles/_dionysus.dir/all] Error 2
make: *** [all] Error 2

Any ideas to fix this?

What is the minimum version of boost for dionysus?

Failed assertion when calling dionysus.wasserstein_distance for largish diagrams

I'm attempting to use dionysus.wasserstein_distance to compare a bunch of diagrams but have run into a crash due to a failed assertion in the C++ code.

My Python code looks a bit like this (after I remove a bunch of control flow, etc):

filtration1 = dionysus.fill_rips(dist1, K, R)
filtration2 = dionysus.fill_rips(dist2, K, R)
homology1 = dionysus.homology_persistence(filtration1)
homology2 = dionysus.homology_persistence(filtration2)
data[i] = dionysus.init_diagrams(homology1, filtration1)
data[j] = dionysus.init_diagrams(homology2, filtration2)
x = data[i][dim]
y = data[j][dim]
print("k=%d, |V[%d]|=%d, |V[%d]|=%d" % (dim, i, len(x), j, len(y)))
d = dionysus.wasserstein_distance(x, y)
logging.debug("\t\t\t\td(%d, %d) = %s", i, j, d)
....
k=2, |V[1]|=2300, |V[0]|=5984
				d(1, 0) = inf
k=2, |V[2]|=1540, |V[0]|=5984
				d(2, 0) = inf
k=2, |V[2]|=1540, |V[1]|=2300
				d(2, 1) = inf
k=2, |V[3]|=5984, |V[0]|=5984
Assertion failed: (dnn_points_.size() < _items.size()), function AuctionOracleKDTreeRestricted, file /Users/thsutton/Documents/TDA/assignment/dionysus/ext/hera/wasserstein/include/auction_oracle_kdtree_restricted.hpp, line 114.

This is an assignment but I can make the code and data available by privately if required.

self loops in graphs

I worked on some graphs problems using persistence diagram as a feature. If the graph has self-loops, we will have simplices like [1,1] and [2,2]. This will cause some runtime error when calling d.homology_persistence(f). A small example is given. Running it on Linux throws RuntimeError: Trying to access non-existent cell: <313215472>. This is not very informative and takes me quite a while to figure out where the bug is.

If [1,1] and [2,2] are commented out, I can run the code without a problem.

def dionysus_test():
    import dionysus as d
    simplices = [([0, 6], 0.0035655512881059928),
                 ([0, 5], 0.004388370816130452),
                 ([0, 4], 0.024136039488717488),
                 ([0, 3], 0.035381239705051776),
                 ([3, 5], 0.035381239705051776),
                 ([0, 1], 0.9824465164612051),
                 ([1, 1], 0.9824465164612051),
                 ([1, 3], 0.9824465164612051),
                 ([1, 4], 0.9824465164612051),
                 ([1, 5], 0.9824465164612051),
                 ([1, 6], 0.9824465164612051),
                 ([0, 2], 0.9999999997257268),
                 ([1, 2], 0.9999999997257268),
                 ([2, 2], 0.9999999997257268),
                 ([2, 3], 0.9999999997257268),
                 ([2, 4], 0.9999999997257268),
                 ([2, 5], 0.9999999997257268),
                 ([2, 6], 0.9999999997257268),
                 ([0], 0.0016456390560489196),
                 ([6], 0.0035655512881059928),
                 ([5], 0.004388370816130452),
                 ([4], 0.024136039488717488),
                 ([3], 0.035381239705051776),
                 ([1], 0.9824465164612051),
                 ([2], 0.9999999997257268)]
    f = d.Filtration()
    for vertices, time in simplices:
        f.append(d.Simplex(vertices, time))
    f.sort()
    m = d.homology_persistence(f)
    for i, c in enumerate(m):
        print(i, c)
dionysus_test()

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.