Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
052bb2c
update files (but not the callers, so won't compile)
hschreiber Aug 14, 2025
29ac873
simplex_tree_multi cython module compiles
hschreiber Aug 15, 2025
13b0488
mid making mma compile
hschreiber Aug 19, 2025
7a0c00e
mma compiles
hschreiber Aug 20, 2025
a0408dd
everything compiles (but probably don't work)
hschreiber Aug 20, 2025
255ddff
first fixes
hschreiber Aug 22, 2025
95e80cc
upstream merge
hschreiber Aug 22, 2025
5a58d6f
some corrections
hschreiber Aug 22, 2025
66274e8
Merge branch 'DavidLapous:main' into update_from_gudhi
hschreiber Aug 25, 2025
826ebce
unitary tests pass
hschreiber Aug 27, 2025
067cecd
everything passes (except for notebooks also not working on main)
hschreiber Aug 28, 2025
c0b7144
adding insert_force for simplex tree
hschreiber Aug 28, 2025
4182911
upstream merge
hschreiber Aug 29, 2025
4ca9bfa
fix
hschreiber Aug 29, 2025
a4fc683
Merge branch 'DavidLapous:main' into update_from_gudhi
hschreiber Aug 29, 2025
6335045
fast fail to false for debug
hschreiber Aug 30, 2025
9fb9a6c
Merge branch 'DavidLapous:main' into update_from_gudhi
hschreiber Aug 30, 2025
41601a9
assert fix
hschreiber Aug 30, 2025
4e6bbea
Merge branch 'update_from_gudhi' of github.com:hschreiber/multipers i…
hschreiber Aug 30, 2025
5403553
windows fix?
hschreiber Aug 30, 2025
2f4df8a
Merge remote-tracking branch 'david' into update_from_gudhi
DavidLapous Sep 4, 2025
f57f99e
hotfix
DavidLapous Sep 4, 2025
e90008e
tests: add test hack
DavidLapous Sep 4, 2025
0146655
format
DavidLapous Sep 4, 2025
401ff24
.
DavidLapous Sep 4, 2025
4b6e035
bug fix
hschreiber Sep 5, 2025
aad5e72
review comments
hschreiber Sep 9, 2025
9ed9345
gudhi merge
hschreiber Sep 11, 2025
2c72e93
compiles with Multi_parameter_filtration
hschreiber Sep 11, 2025
2a45007
test contiguous slicer
DavidLapous Sep 12, 2025
31a9cde
fix shuffled vertices when constructing slicer from simplex tree + ge…
hschreiber Sep 15, 2025
dd8f4a5
Merge branch 'update_from_gudhi' of github.com:hschreiber/multipers i…
hschreiber Sep 15, 2025
f886df9
re-enable cython fast fail
DavidLapous Sep 25, 2025
9b743e6
first (working?) templated small version
DavidLapous Sep 25, 2025
8143e1b
test with everything ?
DavidLapous Sep 25, 2025
8265ea4
added filtration container python choice
DavidLapous Sep 26, 2025
0da52e1
fix
DavidLapous Sep 26, 2025
cf146a1
little fix
DavidLapous Sep 26, 2025
16bd4eb
clean
DavidLapous Sep 26, 2025
8a1656a
little fix
DavidLapous Sep 30, 2025
dc39ed0
little fix
DavidLapous Sep 30, 2025
a3ebb6b
some fixes
DavidLapous Oct 2, 2025
57e391b
std excepts
DavidLapous Oct 3, 2025
98a0cdc
bug fix
hschreiber Oct 5, 2025
a6e4439
feat: yet another template (TODO: fix it)
DavidLapous Oct 31, 2025
3b7ed96
little fix
DavidLapous Oct 31, 2025
e1b5ddd
Merge branch 'main' into update_from_gudhi
DavidLapous Oct 31, 2025
b64d31a
github weird merge
DavidLapous Oct 31, 2025
4039aa3
removed a copy
DavidLapous Nov 1, 2025
3ab354b
add: test for tbb
DavidLapous Nov 1, 2025
432e0c1
test without tbb
DavidLapous Nov 1, 2025
8c2677f
re-enable tbb
DavidLapous Nov 1, 2025
8d69c04
simplify
DavidLapous Nov 1, 2025
186533c
.
DavidLapous Nov 1, 2025
ce05585
.
DavidLapous Nov 1, 2025
64cc067
fix: parallel stuff
DavidLapous Nov 4, 2025
a3edbe6
.
DavidLapous Nov 4, 2025
b037b9a
.
DavidLapous Nov 4, 2025
79c7d42
.
DavidLapous Nov 4, 2025
396f196
fix windows ?
DavidLapous Nov 4, 2025
bada8fd
.
DavidLapous Nov 4, 2025
4207508
feat: added an interface to AIDA
DavidLapous Nov 9, 2025
5b9c1c8
feat: aida as submodule, fixes, tests
DavidLapous Nov 9, 2025
292a7c5
fix: aida path
DavidLapous Nov 9, 2025
ac39734
workflow: submodules
DavidLapous Nov 9, 2025
ee68bd8
workflow: add aida to sources
DavidLapous Nov 10, 2025
37d8a3a
fix:workflow
DavidLapous Nov 10, 2025
0be7fda
feat: progress aida flag
DavidLapous Nov 11, 2025
e975f18
fix: align with current aida commit
DavidLapous Nov 12, 2025
10c373b
bump: aida
DavidLapous Nov 12, 2025
0916e4b
windows: tree not available there...
DavidLapous Nov 12, 2025
666c0c5
fix: only blacklist cpp files from multipers
DavidLapous Nov 12, 2025
234b348
fix:typo
DavidLapous Nov 12, 2025
7d4f799
test: no need for mpfree here
DavidLapous Nov 12, 2025
cd675e1
bump: aida
DavidLapous Nov 12, 2025
ecb64f9
bump: aida
DavidLapous Nov 12, 2025
a602930
suppress some false positive maybe-uninitialized warnings
hschreiber Nov 13, 2025
2ee9e39
Merge branch 'update_from_gudhi' of github.com:hschreiber/multipers i…
hschreiber Nov 13, 2025
f79dfbf
fix: added PersistenceAlgebra as submodule
DavidLapous Nov 13, 2025
c7f2316
fix: link to boost missing
DavidLapous Nov 13, 2025
49ae9f2
workflow
DavidLapous Nov 13, 2025
90cc9a6
bump: AIDA
DavidLapous Nov 13, 2025
8e2a94b
format
DavidLapous Nov 13, 2025
6b71ce4
fix: forgot an include
DavidLapous Nov 13, 2025
fc302a2
Merge branch 'main' into update_from_gudhi
DavidLapous Nov 13, 2025
1b172bf
format
DavidLapous Nov 17, 2025
252f82f
Merge remote-tracking branch 'refs/remotes/origin/update_from_gudhi' …
DavidLapous Nov 17, 2025
8406dce
inverse first and second parameter of Degree_rips_filtration + better…
hschreiber Nov 19, 2025
e715f39
Merge branch 'update_from_gudhi' of github.com:hschreiber/multipers i…
hschreiber Nov 19, 2025
061de6f
few corrections for Degree_rips_filtration
hschreiber Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/python_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: mamba-org/setup-micromamba@v2
with:
micromamba-version: 'latest'
Expand Down Expand Up @@ -76,11 +78,18 @@ jobs:
micromamba create -n build python=${{matrix.python-version}} pip wheel -c conda-forge
micromamba activate build

micromamba install 'gudhi>=3.11' 'numpy>=2' pot 'cython>=3' pytest scikit-learn matplotlib joblib tqdm scipy tbb tbb-devel libboost-devel python-build llvm-openmp -c conda-forge
micromamba install 'gudhi>=3.11' 'numpy>=2' pot 'cython>=3' pytest scikit-learn matplotlib joblib tqdm scipy tbb tbb-devel libboost libboost-devel python-build llvm-openmp -c conda-forge
pip install pykeops filtration-domination --upgrade

micromamba install c-compiler cxx-compiler -c conda-forge

- name: tree
if: ${{ matrix.os != 'windows-latest' }}
shell: bash -el {0}
run: |
micromamba activate build
micromamba install tree -c conda-forge
tree
- name: (windows) add dlls
if: ${{ matrix.os == 'windows-latest' }}
shell: pwsh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ multipers/slicer.pxd
multipers/simplex_tree_multi.pyx
multipers/mma_structures.pyx
multipers/filtration_conversions.pxd
multipers/filtrations.pxd

## Hidden files
.*
Expand Down
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[submodule "AIDA"]
path = AIDA
url = https://github.com/JanJend/AIDA
branch = hn_computation
[submodule "Persistence-Algebra"]
path = Persistence-Algebra
url = https://github.com/JanJend/Persistence-Algebra
branch = aida-changes
1 change: 1 addition & 0 deletions AIDA
Submodule AIDA added at 9f892f
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
recursive-include multipers *.py *.so *.tp *.pxd *.h *.pyx *.dll *.dylib *.lib *.pyd
recursive-include AIDA *.hpp *.cpp
recursive-include Persistence-Algebra/include *.hpp
include _tempita_grid_gen.py
global-exclude *.cpp
global-exclude multipers/*.cpp
1 change: 1 addition & 0 deletions Persistence-Algebra
Submodule Persistence-Algebra added at d29a61
209 changes: 165 additions & 44 deletions _tempita_grid_gen.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pickle
from itertools import product

Expand All @@ -6,13 +7,13 @@
## Columns of the matrix backend.
# with ordered by their performance on some synthetic benchmarks.
columns_name = [ # only one column is necessary
"Available_columns::" + stuff
"multipers::tmp_interface::Available_columns::" + stuff
for stuff in (
"INTRUSIVE_SET", # At least one of these is necessary. This one is the default
"INTRUSIVE_SET", # At least one of these is necessary. This one is the default
# "SET",
# "HEAP",
# "UNORDERED_SET",
"NAIVE_VECTOR",
# "NAIVE_VECTOR",
# "VECTOR",
# "INTRUSIVE_LIST",
# "LIST",
Expand All @@ -22,11 +23,14 @@

## Value types : CTYPE, PYTHON_TYPE, short
value_types = [
("int32_t", "np.int32", "i32"), # necessary
("int64_t", "np.int64", "i64"),
("float", "np.float32", "f32"),
("double", "np.float64", "f64"), # necessary
("int32_t", "np.int32", "i32"), # necessary
# ("int64_t", "np.int64", "i64"),
# ("float", "np.float32", "f32"),
("double", "np.float64", "f64"), # necessary
]
COARSENNED_VALUE_TYPE = ("int32_t", "np.int32", "i32")
REAL_VALUE_TYPE = ("double", "np.float64", "f64")


## True needed for MMA, and False is default value
vineyards_values = [
Expand All @@ -39,21 +43,42 @@
kcritical_options = [
#
True,
False, # necessary
False, # necessary
]

##
matrix_types = [
#
"Matrix", # necessary
"Matrix", # necessary
# "Graph",
# "Clement",
"GudhiCohomology",
# "GudhiCohomology",
]

filtration_containers = [
# "Dynamic_multi_parameter_filtration",
# "Degree_rips_bifiltration",
"Multi_parameter_filtration",
]
short_filtration_container = {
"Dynamic_multi_parameter_filtration": "Dynamic",
"Degree_rips_bifiltration": "Flat",
"Multi_parameter_filtration": "Contiguous",
}


def get_cfiltration_type(container, dtype, is_kcritical, co=False):
return f"Gudhi::multi_filtration::{container}<{dtype[0]},false,!{str(is_kcritical).lower()}>"


def get_python_filtration_type(container, dtype, is_kcritical, co=False):
return f"{'K' if is_kcritical else ''}{short_filtration_container[container]}_{dtype[2]}"


# Removes some impossible / unnecessary combinations
def check_combination(backend_type, is_vine, is_kcritical, value_type, column_type):
def check_combination(
backend_type, is_vine, is_kcritical, value_type, column_type, filtration_container
):
if backend_type in ["Clement", "Graph"]:
if not is_vine:
return False
Expand All @@ -63,23 +88,33 @@ def check_combination(backend_type, is_vine, is_kcritical, value_type, column_ty
if backend_type in ["Graph", "GudhiCohomology"]:
if column_type[0] != 0:
return False
if filtration_container == "flat":
if not is_kcritical:
return False
if value_type[0] == "f":
return False
return True


def get_slicer(backend_type, is_vine, is_kcritical, value_type, column_type):
def get_slicer(
backend_type, is_vine, is_kcritical, value_type, column_type, filtration_container
):
stuff = locals()
ctype, pytype, short_type = value_type
col_idx, col = column_type
PYTHON_TYPE = f"_{'K' if is_kcritical else ''}Slicer_{backend_type}{col_idx}{'_vine' if is_vine else ''}_{short_type}"
CTYPE = f"TrucPythonInterface<BackendsEnum::{backend_type},{'true' if is_vine else 'false'},{'true' if is_kcritical else 'false'},{ctype},{col}>"
PYTHON_TYPE = f"_{'K' if is_kcritical else ''}{short_filtration_container[filtration_container]}Slicer_{backend_type}{col_idx}{'_vine' if is_vine else ''}_{short_type}"
CTYPE = f"multipers::tmp_interface::TrucPythonInterface<multipers::tmp_interface::BackendsEnum::{backend_type},{'true' if is_vine else 'false'},{'true' if is_kcritical else 'false'},{ctype},{col},multipers::tmp_interface::Filtration_containers_strs::{filtration_container}>"
IS_SIMPLICIAL = False
IS_VINE = is_vine
IS_KCRITICAL = is_kcritical
FILTRATION_TYPE = (
("Multi_critical_filtration" if is_kcritical else "One_critical_filtration")
+ "["
+ ctype
+ "]"
# FILTRATION_TYPE = (
# ("Multi_critical_filtration" if is_kcritical else "One_critical_filtration")
# + "["
# + ctype
# + "]"
# )
FILTRATION_TYPE = get_python_filtration_type(
filtration_container, value_type, is_kcritical
)
return {
"TRUC_TYPE": CTYPE,
Expand All @@ -90,9 +125,11 @@ def get_slicer(backend_type, is_vine, is_kcritical, value_type, column_type):
"IS_KCRITICAL": IS_KCRITICAL,
"C_VALUE_TYPE": ctype,
"PY_VALUE_TYPE": pytype,
"COLUMN_TYPE": col.split("::")[1],
"COLUMN_TYPE": col.split("::")[3],
"SHORT_VALUE_TYPE": short_type,
"SHORT_FILTRATION_TYPE": short_filtration_container[filtration_container],
"FILTRATION_TYPE": FILTRATION_TYPE,
"FILTRATION_CONTAINER_STR": filtration_container,
"PERS_BACKEND_TYPE": backend_type,
"IS_FLOAT": short_type[0] == "f",
}
Expand All @@ -101,12 +138,13 @@ def get_slicer(backend_type, is_vine, is_kcritical, value_type, column_type):
# {{for CTYPE_H, CTYPE,PYTHON_TYPE, IS_SIMPLICIAL, IS_VINE, IS_KCRITICAL, C_VALUE_TYPE, PY_VALUE_TYPE, COL, SHORT,FILTRATION_TYPE in slicers}}
slicers = [
get_slicer(**kwargs)
for backend_type, is_vine, is_kcritical, value_type, column_type in product(
for backend_type, is_vine, is_kcritical, value_type, column_type, filtration_container in product(
matrix_types,
vineyards_values,
kcritical_options,
value_types,
enumerate(columns_name),
filtration_containers,
)
if check_combination(
**(
Expand All @@ -116,44 +154,127 @@ def get_slicer(backend_type, is_vine, is_kcritical, value_type, column_type):
"is_kcritical": is_kcritical,
"value_type": value_type,
"column_type": column_type,
"filtration_container": filtration_container,
}
)
)
]

for D in slicers:
print(D)

os.makedirs("build/tmp", exist_ok=True)


print("#----------------------")
print("#----------------------")
print("Value_types")
print("#----------------------")
print("#----------------------")
print(*value_types, sep="\n")
with open("build/tmp/_value_types.pkl", "wb") as f:
pickle.dump(value_types, f)

print("#----------------------")
print("#----------------------")
print("Filtrations")
print("#----------------------")
print("#----------------------")
Filtrations = [
{
"python": get_python_filtration_type(F, T, K),
"c": get_cfiltration_type(F, T, K),
"c_value_type": T[0],
"py_value_type": T[1],
"short_value_type": T[2],
"container": F,
"multicritical": K,
}
for F, T, K in product(filtration_containers, value_types, kcritical_options)
]
print(*Filtrations, sep="\n")
with open("build/tmp/_filtration_names.pkl", "wb") as f:
pickle.dump(Filtrations, f)


print("#----------------------")
print("#----------------------")
print("Slicers")
print("#----------------------")
print("#----------------------")
print(*slicers, sep="\n")
with open("build/tmp/_slicer_names.pkl", "wb") as f:
pickle.dump(slicers, f)

## Simplextree

Filtrations_types = [
(
("Multi_critical_filtration", True)
if kcritical
else ("One_critical_filtration", False)
print("#----------------------")
print("#----------------------")
print("SimplexTrees")
print("#----------------------")
print("#----------------------")


def get_simplextree_class_name(is_kcritical, value_type, filtration_container):
ctype, pytype, short_type = value_type
python_filtration = get_python_filtration_type(
filtration_container, value_type, is_kcritical
)
for kcritical in kcritical_options
]
python_class_name = (
"_SimplexTreeMulti_"
+ short_filtration_container[filtration_container]
+ "_"
+ ("K" if is_kcritical else "")
+ short_type
)
return python_class_name


## CTYPE, PYTYPE, SHORT, FILTRATION
to_iter = [
(
CTYPE,
PYTYPE,
SHORT,
Filtration + "[" + CTYPE + "]",
is_kcritical,
("K" if is_kcritical else "") + "F" + SHORT,
def get_simplextree(is_kcritical, value_type, filtration_container):
ctype, pytype, short_type = value_type
IS_KCRITICAL = is_kcritical
python_filtration = get_python_filtration_type(
filtration_container, value_type, is_kcritical
)
for (CTYPE, PYTYPE, SHORT), (Filtration, is_kcritical) in product(
value_types, Filtrations_types
OneKpython_filtration = get_python_filtration_type(
filtration_container, value_type, False
)
]
python_class_name = get_simplextree_class_name(
is_kcritical, value_type, filtration_container
)
coarsenned_class_name = get_simplextree_class_name(
is_kcritical, COARSENNED_VALUE_TYPE, filtration_container
)
real_class_name = get_simplextree_class_name(
is_kcritical, REAL_VALUE_TYPE, filtration_container
)
return {
"IS_KCRITICAL": IS_KCRITICAL,
"CTYPE": ctype,
"PY_VALUE_TYPE": pytype,
"PYTYPE": pytype,
"SHORT_VALUE_TYPE": short_type,
"SHORT_FILTRATION_TYPE": short_filtration_container[filtration_container],
"PyFil": python_filtration,
"CFil": get_cfiltration_type(filtration_container, value_type, is_kcritical),
"FILTRATION_CONTAINER_STR": filtration_container,
"IS_FLOAT": short_type[0] == "f",
"PY_CLASS_NAME": python_class_name,
"COARSENNED_PY_CLASS_NAME": coarsenned_class_name,
"REAL_PY_CLASS_NAME": real_class_name,
"ST_INTERFACE": (
"Simplex_tree_multi_interface[" + python_filtration + ", " + ctype + "]"
),
"C2P_Fil": f"{python_filtration}_2_python",
"P2C_Fil": f"python_2_{python_filtration}",
"P2C_1KFil": f"python_2_{OneKpython_filtration}",
"C2P_vFil": f"vect_{python_filtration}_2_python",
"OneCriticalFil": OneKpython_filtration,
}


st_list = [
get_simplextree(*args)
for args in product(kcritical_options, value_types, filtration_containers)
]
print(*st_list, sep="\n")

with open("build/tmp/_simplextrees_.pkl", "wb") as f:
pickle.dump(to_iter, f)
pickle.dump(st_list, f)
Loading
Loading