flagserpy 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. flagserpy-0.1.0/.github/workflows/ci.yml +76 -0
  2. flagserpy-0.1.0/.github/workflows/wheels.yml +174 -0
  3. flagserpy-0.1.0/.gitignore +129 -0
  4. flagserpy-0.1.0/.gitmodules +3 -0
  5. flagserpy-0.1.0/.tools/git-pre-commit +8 -0
  6. flagserpy-0.1.0/CMakeLists.txt +71 -0
  7. flagserpy-0.1.0/CODE_AUTHORS +7 -0
  8. flagserpy-0.1.0/CODE_OF_CONDUCT.rst +55 -0
  9. flagserpy-0.1.0/CONTRIBUTING.rst +123 -0
  10. flagserpy-0.1.0/DEED_OF_CONTRIBUTION.rst +57 -0
  11. flagserpy-0.1.0/GOVERNANCE.rst +19 -0
  12. flagserpy-0.1.0/ISSUE_TEMPLATE.md +27 -0
  13. flagserpy-0.1.0/LICENSE +672 -0
  14. flagserpy-0.1.0/PKG-INFO +812 -0
  15. flagserpy-0.1.0/PULL_REQUEST_TEMPLATE.md +28 -0
  16. flagserpy-0.1.0/README.rst +93 -0
  17. flagserpy-0.1.0/RELEASE.rst +366 -0
  18. flagserpy-0.1.0/doc/Makefile +20 -0
  19. flagserpy-0.1.0/doc/conf.py +111 -0
  20. flagserpy-0.1.0/doc/images/Giotto_logo_RGB.svg +76 -0
  21. flagserpy-0.1.0/doc/index.rst +32 -0
  22. flagserpy-0.1.0/doc/make.bat +35 -0
  23. flagserpy-0.1.0/doc/requirements.txt +4 -0
  24. flagserpy-0.1.0/doc/source/_static/style.css +4 -0
  25. flagserpy-0.1.0/doc/templates/class.rst +18 -0
  26. flagserpy-0.1.0/doc/templates/class_with_call.rst +17 -0
  27. flagserpy-0.1.0/doc/templates/class_without_init.rst +12 -0
  28. flagserpy-0.1.0/doc/templates/deprecated_class.rst +23 -0
  29. flagserpy-0.1.0/doc/templates/deprecated_class_with_call.rst +24 -0
  30. flagserpy-0.1.0/doc/templates/deprecated_class_without_init.rst +19 -0
  31. flagserpy-0.1.0/doc/templates/deprecated_function.rst +19 -0
  32. flagserpy-0.1.0/doc/templates/function.rst +14 -0
  33. flagserpy-0.1.0/doc/templates/generate_deprecated.sh +8 -0
  34. flagserpy-0.1.0/doc/templates/numpydoc_docstring.rst +16 -0
  35. flagserpy-0.1.0/flagser/.clang-format +12 -0
  36. flagserpy-0.1.0/flagser/.github/workflows/build.yml +48 -0
  37. flagserpy-0.1.0/flagser/.gitignore +22 -0
  38. flagserpy-0.1.0/flagser/.install-consent +1 -0
  39. flagserpy-0.1.0/flagser/CMakeLists.txt +152 -0
  40. flagserpy-0.1.0/flagser/CONTRIBUTING.txt +9 -0
  41. flagserpy-0.1.0/flagser/COPYING.txt +21 -0
  42. flagserpy-0.1.0/flagser/README.md +52 -0
  43. flagserpy-0.1.0/flagser/algorithms.math +26 -0
  44. flagserpy-0.1.0/flagser/build_custom_algorithms.sh +8 -0
  45. flagserpy-0.1.0/flagser/include/algorithms.h +152 -0
  46. flagserpy-0.1.0/flagser/include/argparser.h +67 -0
  47. flagserpy-0.1.0/flagser/include/complex/directed_flag_complex.h +259 -0
  48. flagserpy-0.1.0/flagser/include/complex/directed_flag_complex_computer.h +604 -0
  49. flagserpy-0.1.0/flagser/include/complex/directed_flag_complex_in_memory.h +248 -0
  50. flagserpy-0.1.0/flagser/include/complex/directed_flag_complex_in_memory_computer.h +398 -0
  51. flagserpy-0.1.0/flagser/include/definitions.h +69 -0
  52. flagserpy-0.1.0/flagser/include/directed_graph.h +197 -0
  53. flagserpy-0.1.0/flagser/include/filtration_algorithms.h +72 -0
  54. flagserpy-0.1.0/flagser/include/input/base.h +23 -0
  55. flagserpy-0.1.0/flagser/include/input/flagser.h +84 -0
  56. flagserpy-0.1.0/flagser/include/input/h5.h +262 -0
  57. flagserpy-0.1.0/flagser/include/input/input_classes.h +35 -0
  58. flagserpy-0.1.0/flagser/include/output/barcode.h +85 -0
  59. flagserpy-0.1.0/flagser/include/output/barcode_hdf5.h +285 -0
  60. flagserpy-0.1.0/flagser/include/output/base.h +49 -0
  61. flagserpy-0.1.0/flagser/include/output/betti.h +121 -0
  62. flagserpy-0.1.0/flagser/include/output/hdf5.h +93 -0
  63. flagserpy-0.1.0/flagser/include/output/hdf5_helper.h +70 -0
  64. flagserpy-0.1.0/flagser/include/output/output_classes.h +54 -0
  65. flagserpy-0.1.0/flagser/include/output/trivial.h +55 -0
  66. flagserpy-0.1.0/flagser/include/parameters.h +79 -0
  67. flagserpy-0.1.0/flagser/include/persistence.h +967 -0
  68. flagserpy-0.1.0/flagser/include/usage/cell-output.h +9 -0
  69. flagserpy-0.1.0/flagser/include/usage/flagser-count.h +20 -0
  70. flagserpy-0.1.0/flagser/include/usage/flagser.h +32 -0
  71. flagserpy-0.1.0/flagser/include/usage/help.h +5 -0
  72. flagserpy-0.1.0/flagser/include/usage/homology.h +26 -0
  73. flagserpy-0.1.0/flagser/include/usage/input.h +30 -0
  74. flagserpy-0.1.0/flagser/include/usage/output.h +13 -0
  75. flagserpy-0.1.0/flagser/include/usage/ripser.h +39 -0
  76. flagserpy-0.1.0/flagser/parser/math_parser.py +376 -0
  77. flagserpy-0.1.0/flagser/requirements.txt +4 -0
  78. flagserpy-0.1.0/flagser/src/er.cpp +91 -0
  79. flagserpy-0.1.0/flagser/src/flagser-count.cpp +177 -0
  80. flagserpy-0.1.0/flagser/src/flagser.cpp +110 -0
  81. flagserpy-0.1.0/flagser/src/ripser.cpp +572 -0
  82. flagserpy-0.1.0/flagser/test/CMakeLists.txt +15 -0
  83. flagserpy-0.1.0/flagser/test/a.flag +10 -0
  84. flagserpy-0.1.0/flagser/test/b.flag +9 -0
  85. flagserpy-0.1.0/flagser/test/base.h +104 -0
  86. flagserpy-0.1.0/flagser/test/c.flag +15 -0
  87. flagserpy-0.1.0/flagser/test/d.flag +12 -0
  88. flagserpy-0.1.0/flagser/test/d10.flag +93 -0
  89. flagserpy-0.1.0/flagser/test/d2.flag +5 -0
  90. flagserpy-0.1.0/flagser/test/d3-allzero.flag +9 -0
  91. flagserpy-0.1.0/flagser/test/d3.flag +9 -0
  92. flagserpy-0.1.0/flagser/test/d4-allzero.flag +15 -0
  93. flagserpy-0.1.0/flagser/test/d4.flag +15 -0
  94. flagserpy-0.1.0/flagser/test/d5.flag +23 -0
  95. flagserpy-0.1.0/flagser/test/d7.flag +45 -0
  96. flagserpy-0.1.0/flagser/test/double-d3-allzero.flag +13 -0
  97. flagserpy-0.1.0/flagser/test/double-d3.flag +13 -0
  98. flagserpy-0.1.0/flagser/test/e.flag +12 -0
  99. flagserpy-0.1.0/flagser/test/f.flag +8 -0
  100. flagserpy-0.1.0/flagser/test/medium-test-data.flag +68655 -0
  101. flagserpy-0.1.0/flagser/test/run +77 -0
  102. flagserpy-0.1.0/flagser/test/run3 +82 -0
  103. flagserpy-0.1.0/flagser/test/test_flagser.cpp +19 -0
  104. flagserpy-0.1.0/flagser/test/test_flagser_coefficients.cpp +19 -0
  105. flagserpy-0.1.0/flagser/test/test_flagser_coefficients_memory.cpp +19 -0
  106. flagserpy-0.1.0/flagser/test/test_flagser_memory.cpp +19 -0
  107. flagserpy-0.1.0/flagser/tools/h5toflagser +71 -0
  108. flagserpy-0.1.0/flagserpy/__init__.py +17 -0
  109. flagserpy-0.1.0/flagserpy/_utils.py +84 -0
  110. flagserpy-0.1.0/flagserpy/flagio.py +245 -0
  111. flagserpy-0.1.0/flagserpy/flagser.py +260 -0
  112. flagserpy-0.1.0/flagserpy/flagser_count.py +127 -0
  113. flagserpy-0.1.0/flagserpy/tests/__init__.py +0 -0
  114. flagserpy-0.1.0/flagserpy/tests/__main__.py +9 -0
  115. flagserpy-0.1.0/flagserpy/tests/conftest.py +66 -0
  116. flagserpy-0.1.0/flagserpy/tests/test_flagio.py +48 -0
  117. flagserpy-0.1.0/flagserpy/tests/test_flagser.py +255 -0
  118. flagserpy-0.1.0/flagserpy/tests/test_flagser_count.py +44 -0
  119. flagserpy-0.1.0/pyproject.toml +100 -0
  120. flagserpy-0.1.0/src/.clang-format +8 -0
  121. flagserpy-0.1.0/src/flagser_bindings.cpp +129 -0
  122. flagserpy-0.1.0/src/flagser_count_bindings.cpp +69 -0
@@ -0,0 +1,76 @@
1
+ name: Build package on different OSs and Python versions
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs:
6
+
7
+ build_package:
8
+ name: Build ${{ github.event.repository.name }} on ${{ matrix.os }} for Python-${{ matrix.python-version }}
9
+ runs-on: ${{ matrix.os }}
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ os: [ubuntu-latest, windows-latest, macos-latest]
14
+ python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
15
+ include:
16
+ - os: ubuntu-latest
17
+ path: ~/.cache/pip
18
+ - os: macos-latest
19
+ path: ~/Library/Caches/pip
20
+ - os: windows-latest
21
+ path: ~\AppData\Local\pip\Cache
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ submodules: true
27
+
28
+ - uses: actions/setup-python@v5
29
+ name: Install Python-${{ matrix.python-version }}
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+
33
+ - name: Activating Python cache
34
+ uses: actions/cache@v4
35
+ id: cache_python
36
+ continue-on-error: true
37
+ with:
38
+ path: ${{ matrix.path }}
39
+ key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
40
+
41
+ - name: Build ${{ github.event.repository.name }}
42
+ run: |
43
+ python -m pip install --upgrade pip
44
+ python -m pip install -e ".[doc,tests]"
45
+
46
+ - name: Install and run flake8 on Mac
47
+ if: ${{ runner.os == 'macOS' }}
48
+ run: |
49
+ flake8
50
+
51
+ - name: Run test on Mac with coverage generated
52
+ if: ${{ runner.os == 'macOS' }}
53
+ run: |
54
+ pytest flagserpy/tests --cov flagserpy --cov-report xml
55
+
56
+ - name: Run test on Linux and Windows with no coverage generated
57
+ if: ${{ runner.os != 'macOS' }}
58
+ run: |
59
+ python -m pytest flagserpy/tests --no-cov --no-coverage-upload
60
+
61
+ - name: Build sphinx doc on Linux
62
+ if: ${{ runner.os == 'Linux' }}
63
+ run: |
64
+ cd doc
65
+ python -m pip install -r requirements.txt
66
+ sphinx-build -b html . build
67
+
68
+ - name: Upload built documentation and coverage as artifacts
69
+ uses: actions/upload-artifact@v4
70
+ with:
71
+ name: ArtifactsCI-${{ matrix.os }}-${{ matrix.python-version }}
72
+ if-no-files-found: ignore
73
+ path: |
74
+ doc/build
75
+ coverage.xml
76
+ htmlcov
@@ -0,0 +1,174 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ concurrency:
10
+ group: build-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+
15
+ build_wheels:
16
+ name: Build wheels on ${{ matrix.os }}
17
+ runs-on: ${{ matrix.os }}
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ os: [ubuntu-latest, windows-latest, macos-latest]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ submodules: true
27
+
28
+ - name: Build wheels
29
+ uses: pypa/cibuildwheel@v3.1.0
30
+ env:
31
+ # Most cibuildwheel options (build, skip, macos archs) live in
32
+ # [tool.cibuildwheel] in pyproject.toml. Only platform-specific
33
+ # bits that don't fit cleanly there are set here.
34
+ CIBW_BEFORE_BUILD_WINDOWS: sed -i $'s/\r$//' README.rst && python -m pip install delvewheel
35
+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv -w {dest_dir} {wheel}"
36
+ CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
37
+
38
+ - name: Upload wheel artifacts
39
+ uses: actions/upload-artifact@v4
40
+ with:
41
+ name: wheels-${{ matrix.os }}
42
+ path: ./wheelhouse/*.whl
43
+
44
+ build_sdist:
45
+ name: Build source distribution
46
+ runs-on: ubuntu-latest
47
+
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ with:
51
+ submodules: true
52
+
53
+ - name: Build sdist
54
+ run: pipx run build --sdist
55
+
56
+ - name: Upload sdist artifact
57
+ uses: actions/upload-artifact@v4
58
+ with:
59
+ name: sdist
60
+ path: ./dist/*.tar.gz
61
+
62
+ publish-to-testpypi:
63
+ name: Publish to TestPyPI
64
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
65
+ needs:
66
+ - build_wheels
67
+ - build_sdist
68
+ runs-on: ubuntu-latest
69
+
70
+ environment:
71
+ name: testpypi
72
+ url: https://test.pypi.org/p/flagserpy
73
+
74
+ permissions:
75
+ id-token: write
76
+
77
+ steps:
78
+ - name: Download all wheel artifacts
79
+ uses: actions/download-artifact@v4
80
+ with:
81
+ pattern: wheels-*
82
+ path: dist
83
+ merge-multiple: true
84
+
85
+ - name: Download sdist artifact
86
+ uses: actions/download-artifact@v4
87
+ with:
88
+ name: sdist
89
+ path: dist
90
+
91
+ - name: Publish distributions to TestPyPI
92
+ uses: pypa/gh-action-pypi-publish@release/v1
93
+ with:
94
+ repository-url: https://test.pypi.org/legacy/
95
+
96
+ publish-to-pypi:
97
+ name: Publish to PyPI
98
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
99
+ needs:
100
+ - publish-to-testpypi
101
+ runs-on: ubuntu-latest
102
+
103
+ environment:
104
+ name: pypi
105
+ url: https://pypi.org/p/flagserpy
106
+
107
+ permissions:
108
+ id-token: write
109
+
110
+ steps:
111
+ - name: Download all wheel artifacts
112
+ uses: actions/download-artifact@v4
113
+ with:
114
+ pattern: wheels-*
115
+ path: dist
116
+ merge-multiple: true
117
+
118
+ - name: Download sdist artifact
119
+ uses: actions/download-artifact@v4
120
+ with:
121
+ name: sdist
122
+ path: dist
123
+
124
+ - name: Publish distributions to PyPI
125
+ uses: pypa/gh-action-pypi-publish@release/v1
126
+
127
+ github-release:
128
+ name: Sign and publish GitHub Release
129
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
130
+ needs:
131
+ - publish-to-pypi
132
+ runs-on: ubuntu-latest
133
+
134
+ permissions:
135
+ contents: write
136
+ id-token: write
137
+
138
+ steps:
139
+ - name: Download all wheel artifacts
140
+ uses: actions/download-artifact@v4
141
+ with:
142
+ pattern: wheels-*
143
+ path: dist
144
+ merge-multiple: true
145
+
146
+ - name: Download sdist artifact
147
+ uses: actions/download-artifact@v4
148
+ with:
149
+ name: sdist
150
+ path: dist
151
+
152
+ - name: Sign distributions with Sigstore
153
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
154
+ with:
155
+ inputs: >-
156
+ ./dist/*.tar.gz
157
+ ./dist/*.whl
158
+
159
+ - name: Create GitHub Release
160
+ env:
161
+ GITHUB_TOKEN: ${{ github.token }}
162
+ run: >-
163
+ gh release create
164
+ '${{ github.ref_name }}'
165
+ --repo '${{ github.repository }}'
166
+ --notes ""
167
+
168
+ - name: Upload distributions and signatures to GitHub Release
169
+ env:
170
+ GITHUB_TOKEN: ${{ github.token }}
171
+ run: >-
172
+ gh release upload
173
+ '${{ github.ref_name }}' dist/**
174
+ --repo '${{ github.repository }}'
@@ -0,0 +1,129 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ docs/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+ test-output.xml
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+
61
+ # Flask stuff:
62
+ instance/
63
+ .webassets-cache
64
+
65
+ # Scrapy stuff:
66
+ .scrapy
67
+
68
+ # Sphinx documentation
69
+ doc/build/
70
+ doc/generated/
71
+
72
+ # PyBuilder
73
+ target/
74
+
75
+ # Jupyter Notebook
76
+ .ipynb_checkpoints
77
+
78
+ # pyenv
79
+ .python-version
80
+
81
+ # celery beat schedule file
82
+ celerybeat-schedule
83
+
84
+ # SageMath parsed files
85
+ *.sage.py
86
+
87
+ # Environments
88
+ .env
89
+ .venv
90
+ env/
91
+ venv/
92
+ ENV/
93
+ env.bak/
94
+ venv.bak/
95
+
96
+ # Spyder project settings
97
+ .spyderproject
98
+ .spyproject
99
+
100
+ # Rope project settings
101
+ .ropeproject
102
+
103
+ # mkdocs documentation
104
+ /site
105
+
106
+ # mypy
107
+ .mypy_cache/
108
+
109
+ # Emacs
110
+ *~
111
+
112
+ # macOS
113
+ *.DS_Store
114
+
115
+ # IDEs
116
+ .idea/*
117
+ .vscode/*
118
+
119
+ # scikit-build-core editable.mode = "inplace" build artifacts
120
+ .cmake/
121
+ .ninja_deps
122
+ .ninja_log
123
+ .skbuild-info.json
124
+ CMakeCache.txt
125
+ CMakeFiles/
126
+ CMakeInit.txt
127
+ build.ninja
128
+ cmake_install.cmake
129
+ flagserpy/modules/
@@ -0,0 +1,3 @@
1
+ [submodule "flagser"]
2
+ path = flagser
3
+ url = https://github.com/luetge/flagser.git
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+
3
+ branch="$(git rev-parse --abbrev-ref HEAD)"
4
+
5
+ if [ "$branch" = "master" ]; then
6
+ echo "You can't commit directly to master branch"
7
+ exit 1
8
+ fi
@@ -0,0 +1,71 @@
1
+ cmake_minimum_required(VERSION 3.15)
2
+ project(flagser_pybind LANGUAGES CXX)
3
+
4
+ set(CMAKE_CXX_STANDARD 14)
5
+
6
+ find_package(pybind11 CONFIG REQUIRED)
7
+
8
+ set(BINDINGS_DIR "src")
9
+
10
+ # When scikit-build-core is invoked in editable.mode = "inplace" the source and
11
+ # binary directories coincide. In that case the compiled modules must land
12
+ # inside the Python package (flagserpy/modules) so that `from .modules.* import ...`
13
+ # works without any wheel-install step. For regular (out-of-tree) builds the
14
+ # normal install(TARGETS ... DESTINATION flagserpy/modules) rules below apply.
15
+ if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}"
16
+ AND DEFINED SKBUILD)
17
+ set(FLAGSERPY_INPLACE_OUTPUT_DIR
18
+ "${CMAKE_CURRENT_SOURCE_DIR}/flagserpy/modules")
19
+ file(MAKE_DIRECTORY "${FLAGSERPY_INPLACE_OUTPUT_DIR}")
20
+ endif()
21
+
22
+ # flagser
23
+ pybind11_add_module(flagser_pybind "${BINDINGS_DIR}/flagser_bindings.cpp")
24
+ target_compile_definitions(flagser_pybind PRIVATE RETRIEVE_PERSISTENCE=1 MANY_VERTICES=1)
25
+ target_include_directories(flagser_pybind PRIVATE .)
26
+ if(DEFINED FLAGSERPY_INPLACE_OUTPUT_DIR)
27
+ set_target_properties(flagser_pybind PROPERTIES
28
+ LIBRARY_OUTPUT_DIRECTORY "${FLAGSERPY_INPLACE_OUTPUT_DIR}$<0:>")
29
+ endif()
30
+ if(MSVC)
31
+ target_compile_options(flagser_pybind PUBLIC $<$<CONFIG:RELEASE>: /Wall /O2>)
32
+ target_compile_options(flagser_pybind PUBLIC $<$<CONFIG:DEBUG>:/O1 /DEBUG:FULL /Zi /Zo>)
33
+ else()
34
+ target_compile_options(flagser_pybind PUBLIC $<$<CONFIG:RELEASE>: -O3>)
35
+ target_compile_options(flagser_pybind PUBLIC $<$<CONFIG:DEBUG>: -O2 -ggdb -D_GLIBCXX_DEBUG>)
36
+ endif()
37
+ install(TARGETS flagser_pybind DESTINATION flagserpy/modules)
38
+
39
+ # flagser with USE_COEFFICIENTS
40
+ pybind11_add_module(flagser_coeff_pybind "${BINDINGS_DIR}/flagser_bindings.cpp")
41
+ target_compile_definitions(flagser_coeff_pybind PRIVATE RETRIEVE_PERSISTENCE=1 USE_COEFFICIENTS=1 MANY_VERTICES=1)
42
+ target_include_directories(flagser_coeff_pybind PRIVATE .)
43
+ if(DEFINED FLAGSERPY_INPLACE_OUTPUT_DIR)
44
+ set_target_properties(flagser_coeff_pybind PROPERTIES
45
+ LIBRARY_OUTPUT_DIRECTORY "${FLAGSERPY_INPLACE_OUTPUT_DIR}$<0:>")
46
+ endif()
47
+ if(MSVC)
48
+ target_compile_options(flagser_coeff_pybind PUBLIC $<$<CONFIG:RELEASE>: /Wall /O2>)
49
+ target_compile_options(flagser_coeff_pybind PUBLIC $<$<CONFIG:DEBUG>:/O1 /DEBUG:FULL /Zi /Zo>)
50
+ else()
51
+ target_compile_options(flagser_coeff_pybind PUBLIC $<$<CONFIG:RELEASE>: -O3>)
52
+ target_compile_options(flagser_coeff_pybind PUBLIC $<$<CONFIG:DEBUG>: -O2 -ggdb -D_GLIBCXX_DEBUG>)
53
+ endif()
54
+ install(TARGETS flagser_coeff_pybind DESTINATION flagserpy/modules)
55
+
56
+ # flagser-count
57
+ pybind11_add_module(flagser_count_pybind "${BINDINGS_DIR}/flagser_count_bindings.cpp")
58
+ target_compile_definitions(flagser_count_pybind PRIVATE MANY_VERTICES=1)
59
+ target_include_directories(flagser_count_pybind PRIVATE .)
60
+ if(DEFINED FLAGSERPY_INPLACE_OUTPUT_DIR)
61
+ set_target_properties(flagser_count_pybind PROPERTIES
62
+ LIBRARY_OUTPUT_DIRECTORY "${FLAGSERPY_INPLACE_OUTPUT_DIR}$<0:>")
63
+ endif()
64
+ if(MSVC)
65
+ target_compile_options(flagser_count_pybind PUBLIC $<$<CONFIG:RELEASE>: /Wall /O2>)
66
+ target_compile_options(flagser_count_pybind PUBLIC $<$<CONFIG:DEBUG>:/O1 /DEBUG:FULL /Zi /Zo>)
67
+ else()
68
+ target_compile_options(flagser_count_pybind PUBLIC $<$<CONFIG:RELEASE>: -O3>)
69
+ target_compile_options(flagser_count_pybind PUBLIC $<$<CONFIG:DEBUG>: -O2 -ggdb -D_GLIBCXX_DEBUG>)
70
+ endif()
71
+ install(TARGETS flagser_count_pybind DESTINATION flagserpy/modules)
@@ -0,0 +1,7 @@
1
+ # The following is the list of the code authors of the giotto-learn python
2
+ # package. Where component authors are known, add them here.
3
+
4
+ Guillaume Tauzin, guillaume.tauzin@epfl.ch
5
+ Julian Burella Pérez, julian.burellaperez@heig-vd.ch
6
+ Umberto Lupo, u.lupo@l2f.ch
7
+ Florian Unger, florian.unger@fau.de
@@ -0,0 +1,55 @@
1
+ CONTRIBUTOR CODE OF CONDUCT
2
+ ===========================
3
+ (Code of Conduct)
4
+ -----------------
5
+
6
+
7
+ Our Pledge
8
+ ----------
9
+
10
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
11
+
12
+ Our Standards
13
+ -------------
14
+
15
+ Examples of behavior that contributes to creating a positive environment include:
16
+
17
+ * Using welcoming and inclusive language;
18
+ * Being respectful of differing viewpoints and experiences;
19
+ * Gracefully accepting constructive criticism;
20
+ * Focusing on what is best for the community;
21
+ * Showing empathy towards other community members.
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances;
26
+ * Trolling, insulting/derogatory comments, and personal or political attacks;
27
+ * Public or private harassment;
28
+ * Publishing others’ private information, such as a physical or electronic address, without explicit permission;
29
+ * Other conduct which could reasonably be considered inappropriate in a professional setting.
30
+
31
+ Our Responsibilities
32
+ --------------------
33
+
34
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
35
+
36
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
37
+
38
+ Scope
39
+ -----
40
+
41
+ This Code of Conduct applies within all Giotto’s project spaces, to all content on <www.giotto.ai>, Giotto’s GitHub organization, or any other official Giotto web presence allowing for community interactions, and it also applies when an individual is representing the project or its community in public spaces.
42
+
43
+ Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
44
+
45
+ Enforcement
46
+ -----------
47
+
48
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at <maintainers@giotto.ai>. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances, Sanctions may include written warnings, expulsions from the project, project sponsored spaces, or project forums, or any other sanction which is deemed appropriate. [The project team] is obligated to maintain confidentiality with regard to the reporter of an incident. If the act is ongoing (such as someone engaging in harassment) or involves a threat to anyone's safety (e.g. threats of violence), the the project team may issue sanctions without notice. Further details of specific enforcement policies may be posted separately.
49
+
50
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by the project leader.
51
+
52
+ Attribution
53
+ -----------
54
+
55
+ This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>, and includes some aspects of the TensorFlow Code of Conduct, available at <https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md>
@@ -0,0 +1,123 @@
1
+ Contributing guidelines
2
+ =======================
3
+
4
+ Pull Request Checklist
5
+ ----------------------
6
+
7
+ Before sending your pull requests, make sure you followed this list.
8
+ - Read the `contributing guidelines <https://github.com/giotto-ai/pyflagser/blob/master/GOVERNANCE.rst>`_.
9
+ - Read the `code of conduct <https://github.com/giotto-ai/pyflagser/blob/master/CODE_OF_CONDUCT.rst>`_.
10
+ - Ensure you have signed the `contributor license agreement (CLA) <https://cla-assistant.io/giotto-ai/pyflagser>`_.
11
+ - Check if the changes are consistent with the guidelines.
12
+ - Changes are consistent with the Coding Style.
13
+ - Run Unit Tests.
14
+
15
+ How to become a contributor and submit your own code
16
+ ----------------------------------------------------
17
+
18
+ Contributor License Agreements
19
+ ------------------------------
20
+
21
+ In order to become a contributor of Giotto, the first step is to sign the
22
+ `contributor license agreement (CLA) <https://cla-assistant.io/giotto-ai/pyflagser>`_.
23
+ **NOTE**: Only original source code from you and other people that have signed
24
+ the CLA can be accepted into the main repository.
25
+
26
+ Contributing code
27
+ -----------------
28
+
29
+ If you have improvements to Giotto, do not hesitate to send us pull requests!
30
+ Please follow the Github how to (https://help.github.com/articles/using-pull-requests/).
31
+ The Giotto Team will review your pull requests. Once the pull requests are approved and pass continuous integration checks, the
32
+ Giotto team will work on getting your pull request submitted to our GitHub
33
+ repository. Eventually, your pull request will be merged automatically on GitHub.
34
+ If you want to contribute, start working through the Giotto codebase,
35
+ navigate to the `GitHub issue tab <https://github.com/giotto-ai/pyflagser/issues>`_
36
+ and start looking through interesting issues. These are issues that we believe
37
+ are particularly well suited for outside contributions, often because we
38
+ probably won't get to them right now. If you decide to start on an issue, leave
39
+ a comment so that other people know that you're working on it. If you want to
40
+ help out, but not alone, use the issue comment thread to coordinate.
41
+
42
+ Contribution guidelines and standards
43
+ -------------------------------------
44
+
45
+ Before sending your pull request for review, make sure your changes are
46
+ consistent with the guidelines and follow the coding style below.
47
+
48
+ General guidelines and philosophy for contribution
49
+ --------------------------------------------------
50
+
51
+ * Include unit tests when you contribute new features, as they help to
52
+ a) prove that your code works correctly, and
53
+ b) guard against future breaking changes to lower the maintenance cost.
54
+ * Bug fixes also generally require unit tests, because the presence of bugs
55
+ usually indicates insufficient test coverage.
56
+ * Keep API compatibility in mind when you change code in core Giotto.
57
+ * Clearly define your exceptions using the utils functions and test the exceptions.
58
+ * When you contribute a new feature to Giotto, the maintenance burden is   
59
+ (by default) transferred to the Giotto team. This means that the benefit   
60
+ of the contribution must be compared against the cost of maintaining the   
61
+ feature.
62
+
63
+ C++ coding style
64
+ ----------------
65
+
66
+ Changes to Giotto C/C++ code should conform to `Google C++ Style Guide <https://google.github.io/styleguide/cppguide.html>`_.
67
+ Use `clang-tidy` to check your C/C++ changes. To install `clang-tidy` on
68
+ ubuntu:16.04, do:
69
+
70
+
71
+ .. code-block:: bash
72
+
73
+ apt-get install -y clang-tidy
74
+
75
+ You can check a C/C++ file by doing:
76
+
77
+ .. code-block:: bash
78
+
79
+ clang-format <my_cc_file> --style=google > /tmp/my_cc_file.ccdiff <my_cc_file> /tmp/my_cc_file.cc
80
+
81
+ Python coding style
82
+ -------------------
83
+
84
+ Changes to Giotto Python code should conform to PEP8 directives.
85
+ Use `flake8` to check your Python changes. To install `flake8` just do
86
+
87
+ .. code-block:: python
88
+
89
+ pip install flake8
90
+
91
+ You can use `flake8` on your python code via the following instructions:
92
+
93
+ .. code-block:: python
94
+
95
+ flake8 name_of_your_script.py
96
+
97
+ Git pre-commit hook
98
+ -------------------
99
+ We provide a pre-commit git hook to prevent accidental commits to the master branch. To activate, run
100
+
101
+ .. code-block:: bash
102
+
103
+ cd .git/hooks
104
+ ln -s ../../.tools/git-pre-commit pre-commit
105
+
106
+ Running unit tests
107
+ ------------------
108
+
109
+ There are two ways to run Giotto unit tests.
110
+
111
+ 1. Using tools and libraries installed directly on your system. The election tool is `pytest`. To install `pytest` just do
112
+
113
+ .. code-block:: python
114
+
115
+ pip install pytest
116
+
117
+ You can use `pytest` on your python code via the following instructions:
118
+
119
+ .. code-block:: python
120
+
121
+ pytest name_of_your_script.py
122
+
123
+ 2. Using Azure (azure-pipelines.yml) and Giotto's CI scripts.