khoca 0.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 (73) hide show
  1. khoca-0.0/.github/workflows/build_wheels.yml +52 -0
  2. khoca-0.0/.github/workflows/build_wheels_linux.yml +23 -0
  3. khoca-0.0/.github/workflows/build_wheels_macos.yml +41 -0
  4. khoca-0.0/.github/workflows/build_wheels_windows.yml +58 -0
  5. khoca-0.0/.github/workflows/publish_pypi.yml +25 -0
  6. khoca-0.0/.github/workflows/publish_source_pypi.yml +25 -0
  7. khoca-0.0/.github/workflows/push_docker.yml +20 -0
  8. khoca-0.0/.github/workflows/run_tests.yml +37 -0
  9. khoca-0.0/.gitignore +11 -0
  10. khoca-0.0/COPYING +674 -0
  11. khoca-0.0/Dockerfile +29 -0
  12. khoca-0.0/INSTALL +36 -0
  13. khoca-0.0/MANIFEST.in +1 -0
  14. khoca-0.0/Makefile +83 -0
  15. khoca-0.0/PKG-INFO +218 -0
  16. khoca-0.0/README.md +191 -0
  17. khoca-0.0/__init__.py +317 -0
  18. khoca-0.0/analyse.sh +28 -0
  19. khoca-0.0/before-all.sh +53 -0
  20. khoca-0.0/before-build.sh +34 -0
  21. khoca-0.0/bin/BraidToMyPD.py +51 -0
  22. khoca-0.0/bin/KrasnerGaussToMyPD.py +43 -0
  23. khoca-0.0/bin/KrasnerGaussToMyPDLib.py +122 -0
  24. khoca-0.0/bin/__init__.py +0 -0
  25. khoca-0.0/bin/pseudoBraidToKrasnerGauss.py +41 -0
  26. khoca-0.0/bin/pseudoBraidToKrasnerGaussLib.py +46 -0
  27. khoca-0.0/converters/binToHuman.py +116 -0
  28. khoca-0.0/converters/humanToBin.py +131 -0
  29. khoca-0.0/converters/montesinos.py +143 -0
  30. khoca-0.0/data/KhovanovMinus +11 -0
  31. khoca-0.0/data/KhovanovMinus.bin +0 -0
  32. khoca-0.0/data/KhovanovPlus +11 -0
  33. khoca-0.0/data/KhovanovPlus.bin +0 -0
  34. khoca-0.0/data/KrasnerMinus +20 -0
  35. khoca-0.0/data/KrasnerMinus.bin +0 -0
  36. khoca-0.0/data/KrasnerPlus +20 -0
  37. khoca-0.0/data/KrasnerPlus.bin +0 -0
  38. khoca-0.0/docker/entrypoint.sh +4 -0
  39. khoca-0.0/install-pari-msys2.sh +142 -0
  40. khoca-0.0/install-pari.sh +27 -0
  41. khoca-0.0/khoca.egg-info/PKG-INFO +218 -0
  42. khoca-0.0/khoca.egg-info/SOURCES.txt +82 -0
  43. khoca-0.0/khoca.egg-info/dependency_links.txt +1 -0
  44. khoca-0.0/khoca.egg-info/not-zip-safe +1 -0
  45. khoca-0.0/khoca.egg-info/top_level.txt +5 -0
  46. khoca-0.0/khoca.py +446 -0
  47. khoca-0.0/pyproject.toml +21 -0
  48. khoca-0.0/pytest.ini +4 -0
  49. khoca-0.0/setup.cfg +7 -0
  50. khoca-0.0/setup.py +165 -0
  51. khoca-0.0/src/compilerFlagsInfo.cpp +1 -0
  52. khoca-0.0/src/krasner/krasner.cpp +821 -0
  53. khoca-0.0/src/krasner/krasner.h +494 -0
  54. khoca-0.0/src/krasner/krasnerExplicitTemplates.cpp +72 -0
  55. khoca-0.0/src/planar_algebra/coefficient_rings.cpp +457 -0
  56. khoca-0.0/src/planar_algebra/coefficient_rings.h +304 -0
  57. khoca-0.0/src/planar_algebra/coefficient_rings_explicitTemplates.cpp +38 -0
  58. khoca-0.0/src/planar_algebra/explicitTemplates.cpp +87 -0
  59. khoca-0.0/src/planar_algebra/planar_algebra.cpp +1159 -0
  60. khoca-0.0/src/planar_algebra/planar_algebra.h +729 -0
  61. khoca-0.0/src/planar_algebra/smith.cpp +217 -0
  62. khoca-0.0/src/planar_algebra/smith.h +22 -0
  63. khoca-0.0/src/planar_algebra/sparsemat.cpp +715 -0
  64. khoca-0.0/src/planar_algebra/sparsemat.h +288 -0
  65. khoca-0.0/src/planar_algebra/sparsematExplicitTemplates.cpp +125 -0
  66. khoca-0.0/src/python_interface/pui.cpp +18863 -0
  67. khoca-0.0/src/python_interface/pui.pyx +288 -0
  68. khoca-0.0/src/python_interface/pythonInterface.cpp +476 -0
  69. khoca-0.0/src/python_interface/pythonInterface.h +71 -0
  70. khoca-0.0/src/shared.cpp +71 -0
  71. khoca-0.0/src/shared.h +104 -0
  72. khoca-0.0/test-command.sh +41 -0
  73. khoca-0.0/tests/test.py +123 -0
@@ -0,0 +1,52 @@
1
+ name: Reusable workflow for cibuildwheel
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ operating-systems:
7
+ default: >-
8
+ ["ubuntu"]
9
+ type: string
10
+ required: true
11
+ system-versions:
12
+ default: >-
13
+ ["latest"]
14
+ type: string
15
+ required: true
16
+ jobs:
17
+ build_wheels:
18
+ name: Build wheels on ${{ matrix.os }}-${{ matrix.version }}
19
+ runs-on: ${{ matrix.os }}-${{ matrix.version }}
20
+ strategy:
21
+ matrix:
22
+ os: ${{ fromJson(inputs.operating-systems) }}
23
+ version: ${{ fromJson(inputs.system-versions) }}
24
+ env:
25
+ CIBW_REPAIR_WHEEL_COMMAND_MACOS: "export MACOSX_DEPLOYMENT_TARGET=${{ matrix.version }}.0; delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
26
+
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ # Used to host cibuildwheel
31
+ - uses: actions/setup-python@v5
32
+
33
+ - name: Install cibuildwheel
34
+ run: python -m pip install cibuildwheel==2.22.0
35
+
36
+ - name: Build wheels
37
+ run: python -m cibuildwheel --output-dir wheelhouse
38
+
39
+ - name: Analyse
40
+ if: always()
41
+ run: sh analyse.sh
42
+
43
+ - uses: actions/upload-artifact@v4
44
+ with:
45
+ name: khoca.tar
46
+ path: /Users/runner/work/khoca/khoca.tar
47
+ if: always()
48
+
49
+ - uses: actions/upload-artifact@v4
50
+ with:
51
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
52
+ path: ./wheelhouse/*.whl
@@ -0,0 +1,23 @@
1
+ name: Build wheels Linux
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*" # Push events of new tags
7
+ workflow_dispatch:
8
+ # Allow to run manually
9
+
10
+ jobs:
11
+ build_wheels:
12
+ uses: ./.github/workflows/build_wheels.yml
13
+ with:
14
+ operating-systems: >-
15
+ ["ubuntu"]
16
+ system-versions: >-
17
+ ["latest"]
18
+
19
+ pypi-publish:
20
+ name: Upload wheels to PyPI
21
+ needs: build_wheels
22
+ uses: ./.github/workflows/publish_pypi.yml
23
+ secrets: inherit
@@ -0,0 +1,41 @@
1
+ name: Build wheels MacOS
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*" # Push events of new tags
7
+ workflow_dispatch:
8
+ # Allow to run manually
9
+
10
+ jobs:
11
+ build_wheels:
12
+ uses: ./.github/workflows/build_wheels.yml
13
+ with:
14
+ operating-systems: >-
15
+ ["macos"]
16
+ system-versions: >-
17
+ ["14"]
18
+
19
+ pypi-publish:
20
+ # https://github.com/pypa/gh-action-pypi-publish
21
+ name: Upload wheels to PyPI
22
+ needs: build_wheels
23
+ runs-on: ubuntu-latest
24
+ env:
25
+ CAN_DEPLOY: ${{ secrets.PYPI_TOCKEN_KHOCA != '' }}
26
+ steps:
27
+
28
+ - uses: actions/download-artifact@v4
29
+ with:
30
+ pattern: cibw-wheels*
31
+ path: wheelhouse
32
+ merge-multiple: true
33
+
34
+ - name: Publish package distributions to PyPI
35
+ uses: pypa/gh-action-pypi-publish@release/v1
36
+ with:
37
+ user: __token__
38
+ password: ${{ secrets.PYPI_TOKEN_KHOCA }}
39
+ packages_dir: wheelhouse/
40
+ skip_existing: true
41
+ verbose: true
@@ -0,0 +1,58 @@
1
+ name: Build wheels Windows
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*" # Push events of new tags
7
+ workflow_dispatch:
8
+ # Allow to run manually
9
+
10
+ jobs:
11
+ build_wheels:
12
+ name: Build Windows wheels for 64 bit Python
13
+ runs-on: windows-latest
14
+ defaults:
15
+ run:
16
+ shell: msys2 {0}
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - uses: actions/setup-python@v5
22
+ name: Install a Python to use for building
23
+ with:
24
+ python-version: '3.12'
25
+
26
+ - uses: msys2/setup-msys2@v2
27
+ name: Setup an msys2 environment
28
+ with:
29
+ msystem: UCRT64
30
+ release: false
31
+ install: >-
32
+ base-devel
33
+ m4
34
+ bison
35
+ make
36
+ patch
37
+ sed
38
+ mingw-w64-x86_64-toolchain
39
+ mingw-w64-x86_64-gmp
40
+ pacboy: gcc:p
41
+ path-type: inherit
42
+
43
+ - name: Install cibuildwheel
44
+ run: |
45
+ python -m pip install cibuildwheel==2.20.0
46
+
47
+ - name: Build many wheels
48
+ run: |
49
+ python -m cibuildwheel --output-dir wheelhouse
50
+
51
+ - name: Analyse
52
+ if: always()
53
+ run: sh analyse.sh
54
+
55
+ - uses: actions/upload-artifact@v4
56
+ name: Save the wheels as artifacts
57
+ with:
58
+ path: ./wheelhouse/*.whl
@@ -0,0 +1,25 @@
1
+ name: Reusable workflow to publish to PyPI
2
+
3
+ on:
4
+ workflow_call:
5
+
6
+ jobs:
7
+ pypi-publish:
8
+ # https://github.com/pypa/gh-action-pypi-publish
9
+ name: Upload wheels to PyPI
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/download-artifact@v4
13
+ with:
14
+ pattern: cibw-wheels*
15
+ path: wheelhouse
16
+ merge-multiple: true
17
+
18
+ - name: Publish package distributions to PyPI
19
+ uses: pypa/gh-action-pypi-publish@release/v1
20
+ with:
21
+ user: __token__
22
+ password: ${{ secrets.PYPI_TOKEN_KHOCA }}
23
+ packages_dir: wheelhouse/
24
+ skip_existing: true
25
+ verbose: true
@@ -0,0 +1,25 @@
1
+ name: Publish sources to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ publish-sources:
8
+ name: Upload source distro to PyPI
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: actions/setup-python@v5
13
+ - name: Prepare
14
+ run: |
15
+ python -m pip install --upgrade pip
16
+ pip install cython setuptools
17
+ - name: Create distribution
18
+ run: python3 setup.py sdist
19
+ - name: Publish distro to PyPI
20
+ uses: pypa/gh-action-pypi-publish@release/v1
21
+ with:
22
+ user: __token__
23
+ password: ${{ secrets.PYPI_TOKEN_KHOCA }}
24
+ packages_dir: dist/
25
+ verbose: true
@@ -0,0 +1,20 @@
1
+ name: Publish Docker
2
+
3
+ on:
4
+ create:
5
+ tag:
6
+ - '*'
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@master
14
+ - name: Publish to Registry
15
+ uses: elgohr/Publish-Docker-Github-Action@master
16
+ with:
17
+ name: soehms/khoca
18
+ username: ${{ secrets.DOCKER_USER }}
19
+ password: ${{ secrets.DOCKER_API_TOKEN }}
20
+ tag_names: true
@@ -0,0 +1,37 @@
1
+ # This workflow runs tests to build Khoca on verois systems
2
+
3
+ name: Run Tests
4
+
5
+ # Triggers the workflow on push or pull request events and manually
6
+ on: [push, pull_request, workflow_dispatch]
7
+
8
+ jobs:
9
+ # This workflow contains one job called build
10
+ build:
11
+ name: Build Khoca
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ # Checks-out the repository under $GITHUB_WORKSPACE, so our job can access it
16
+ - name: Checkout code
17
+ id: checkout_code
18
+ uses: actions/checkout@v2
19
+
20
+ # Installs dependencies
21
+ - name: Install Dependencies
22
+ id: dependencies
23
+ run: |
24
+ sudo apt-get update -y
25
+ sudo apt-get install -y make g++ python3 python3-pip libgmp-dev pari-gp2c
26
+ pip3 install cython
27
+
28
+ # Building Khoca
29
+ - name: Make
30
+ id: make
31
+ run: make
32
+
33
+ # Run a Test (should result to 1)
34
+ - name: Run Test
35
+ id: run_test
36
+ run: |
37
+ ./khoca.py 0 0.0 0 braidaBaB calc0 | grep -c "t^-2q^4 + t^-1q^2 + t^0q^0 + t^1q^-2 + t^2q^-4"
khoca-0.0/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ bin/__pycache__/
2
+ bin/pui.so
3
+ src/krasner/krasner.o
4
+ src/planar_algebra/coefficient_rings.o
5
+ src/planar_algebra/planar_algebra.o
6
+ src/planar_algebra/smith.o
7
+ src/planar_algebra/sparsemat.o
8
+ src/python_interface/pui.cpp
9
+ src/python_interface/pui.o
10
+ src/python_interface/pythonInterface.o
11
+ src/shared.o