kalign-python 3.4.8__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 (178) hide show
  1. kalign_python-3.4.8/.github/workflows/benchmark.yml +124 -0
  2. kalign_python-3.4.8/.github/workflows/cmake.yml +96 -0
  3. kalign_python-3.4.8/.github/workflows/codeql-analysis.yml +62 -0
  4. kalign_python-3.4.8/.github/workflows/python.yml +152 -0
  5. kalign_python-3.4.8/.github/workflows/wheels.yml +304 -0
  6. kalign_python-3.4.8/.gitignore +419 -0
  7. kalign_python-3.4.8/.gitmodules +0 -0
  8. kalign_python-3.4.8/AUTHORS +1 -0
  9. kalign_python-3.4.8/CITATION.cff +39 -0
  10. kalign_python-3.4.8/CLAUDE.md +190 -0
  11. kalign_python-3.4.8/CMakeLists.txt +322 -0
  12. kalign_python-3.4.8/CONTRIBUTING.md +236 -0
  13. kalign_python-3.4.8/COPYING +674 -0
  14. kalign_python-3.4.8/ChangeLog +141 -0
  15. kalign_python-3.4.8/PKG-INFO +273 -0
  16. kalign_python-3.4.8/README-python.md +200 -0
  17. kalign_python-3.4.8/README.md +389 -0
  18. kalign_python-3.4.8/benchmarks/__init__.py +1 -0
  19. kalign_python-3.4.8/benchmarks/__main__.py +5 -0
  20. kalign_python-3.4.8/benchmarks/app.py +371 -0
  21. kalign_python-3.4.8/benchmarks/datasets.py +277 -0
  22. kalign_python-3.4.8/benchmarks/runner.py +186 -0
  23. kalign_python-3.4.8/benchmarks/scoring.py +111 -0
  24. kalign_python-3.4.8/build.zig +113 -0
  25. kalign_python-3.4.8/doc/images/Balibase_scores.jpeg +0 -0
  26. kalign_python-3.4.8/doc/images/Balibase_scores.png +0 -0
  27. kalign_python-3.4.8/doc/images/Bralibase_scores.jpeg +0 -0
  28. kalign_python-3.4.8/doc/images/Homfam_scores.jpeg +0 -0
  29. kalign_python-3.4.8/doc/images/Quantest2_scores.jpeg +0 -0
  30. kalign_python-3.4.8/doc/paper/kalign3.bib +185 -0
  31. kalign_python-3.4.8/doc/paper/kalign3.org +96 -0
  32. kalign_python-3.4.8/doc/paper/revision/main.tex +112 -0
  33. kalign_python-3.4.8/lib/CMakeLists.txt +281 -0
  34. kalign_python-3.4.8/lib/include/kalign/kalign.h +52 -0
  35. kalign_python-3.4.8/lib/kalignConfig.cmake.in +5 -0
  36. kalign_python-3.4.8/lib/src/aln_controller.c +436 -0
  37. kalign_python-3.4.8/lib/src/aln_controller.h +22 -0
  38. kalign_python-3.4.8/lib/src/aln_mem.c +94 -0
  39. kalign_python-3.4.8/lib/src/aln_mem.h +22 -0
  40. kalign_python-3.4.8/lib/src/aln_param.c +269 -0
  41. kalign_python-3.4.8/lib/src/aln_param.h +37 -0
  42. kalign_python-3.4.8/lib/src/aln_profileprofile.c +410 -0
  43. kalign_python-3.4.8/lib/src/aln_profileprofile.h +22 -0
  44. kalign_python-3.4.8/lib/src/aln_run.c +276 -0
  45. kalign_python-3.4.8/lib/src/aln_run.h +32 -0
  46. kalign_python-3.4.8/lib/src/aln_seqprofile.c +339 -0
  47. kalign_python-3.4.8/lib/src/aln_seqprofile.h +26 -0
  48. kalign_python-3.4.8/lib/src/aln_seqseq.c +341 -0
  49. kalign_python-3.4.8/lib/src/aln_seqseq.h +24 -0
  50. kalign_python-3.4.8/lib/src/aln_setup.c +400 -0
  51. kalign_python-3.4.8/lib/src/aln_setup.h +30 -0
  52. kalign_python-3.4.8/lib/src/aln_struct.h +44 -0
  53. kalign_python-3.4.8/lib/src/aln_wrap.c +144 -0
  54. kalign_python-3.4.8/lib/src/aln_wrap.h +24 -0
  55. kalign_python-3.4.8/lib/src/alphabet.c +459 -0
  56. kalign_python-3.4.8/lib/src/alphabet.h +63 -0
  57. kalign_python-3.4.8/lib/src/bisectingKmeans.c +1052 -0
  58. kalign_python-3.4.8/lib/src/bisectingKmeans.h +52 -0
  59. kalign_python-3.4.8/lib/src/bpm.c +604 -0
  60. kalign_python-3.4.8/lib/src/bpm.h +60 -0
  61. kalign_python-3.4.8/lib/src/bpm_test.c +607 -0
  62. kalign_python-3.4.8/lib/src/core.h +52 -0
  63. kalign_python-3.4.8/lib/src/coretralign.c +244 -0
  64. kalign_python-3.4.8/lib/src/coretralign.h +71 -0
  65. kalign_python-3.4.8/lib/src/esl_stopwatch.c +445 -0
  66. kalign_python-3.4.8/lib/src/esl_stopwatch.h +81 -0
  67. kalign_python-3.4.8/lib/src/euclidean_dist.c +230 -0
  68. kalign_python-3.4.8/lib/src/euclidean_dist.h +44 -0
  69. kalign_python-3.4.8/lib/src/io.h +18 -0
  70. kalign_python-3.4.8/lib/src/mod_tldevel.h +10 -0
  71. kalign_python-3.4.8/lib/src/msa_alloc.c +156 -0
  72. kalign_python-3.4.8/lib/src/msa_alloc.h +27 -0
  73. kalign_python-3.4.8/lib/src/msa_check.c +310 -0
  74. kalign_python-3.4.8/lib/src/msa_check.h +23 -0
  75. kalign_python-3.4.8/lib/src/msa_cmp.c +250 -0
  76. kalign_python-3.4.8/lib/src/msa_cmp.h +21 -0
  77. kalign_python-3.4.8/lib/src/msa_io.c +1309 -0
  78. kalign_python-3.4.8/lib/src/msa_io.h +27 -0
  79. kalign_python-3.4.8/lib/src/msa_misc.c +33 -0
  80. kalign_python-3.4.8/lib/src/msa_misc.h +18 -0
  81. kalign_python-3.4.8/lib/src/msa_op.c +585 -0
  82. kalign_python-3.4.8/lib/src/msa_op.h +39 -0
  83. kalign_python-3.4.8/lib/src/msa_sort.c +92 -0
  84. kalign_python-3.4.8/lib/src/msa_sort.h +20 -0
  85. kalign_python-3.4.8/lib/src/msa_struct.h +53 -0
  86. kalign_python-3.4.8/lib/src/pick_anchor.c +106 -0
  87. kalign_python-3.4.8/lib/src/pick_anchor.h +22 -0
  88. kalign_python-3.4.8/lib/src/sequence_distance.c +405 -0
  89. kalign_python-3.4.8/lib/src/sequence_distance.h +52 -0
  90. kalign_python-3.4.8/lib/src/task.c +215 -0
  91. kalign_python-3.4.8/lib/src/task.h +47 -0
  92. kalign_python-3.4.8/lib/src/test.c +16 -0
  93. kalign_python-3.4.8/lib/src/test.h +5 -0
  94. kalign_python-3.4.8/lib/src/tldevel.c +368 -0
  95. kalign_python-3.4.8/lib/src/tldevel.h +291 -0
  96. kalign_python-3.4.8/lib/src/tlmisc.c +230 -0
  97. kalign_python-3.4.8/lib/src/tlmisc.h +26 -0
  98. kalign_python-3.4.8/lib/src/tlrng.c +437 -0
  99. kalign_python-3.4.8/lib/src/tlrng.h +34 -0
  100. kalign_python-3.4.8/lib/src/version.h.in +2 -0
  101. kalign_python-3.4.8/lib/src/weave_alignment.c +133 -0
  102. kalign_python-3.4.8/lib/src/weave_alignment.h +44 -0
  103. kalign_python-3.4.8/pyproject.toml +235 -0
  104. kalign_python-3.4.8/pytest.ini +19 -0
  105. kalign_python-3.4.8/python-docs/python-api.md +526 -0
  106. kalign_python-3.4.8/python-docs/python-ecosystem.md +1454 -0
  107. kalign_python-3.4.8/python-docs/python-performance.md +1049 -0
  108. kalign_python-3.4.8/python-docs/python-quickstart.md +632 -0
  109. kalign_python-3.4.8/python-docs/python-troubleshooting.md +1083 -0
  110. kalign_python-3.4.8/python-examples/README.md +290 -0
  111. kalign_python-3.4.8/python-examples/basic_usage.py +226 -0
  112. kalign_python-3.4.8/python-examples/ecosystem_integration.py +474 -0
  113. kalign_python-3.4.8/python-examples/performance_benchmarks.py +467 -0
  114. kalign_python-3.4.8/python-examples/sample_sequences.fasta +6 -0
  115. kalign_python-3.4.8/python-kalign/__init__.py +758 -0
  116. kalign_python-3.4.8/python-kalign/_core.cpp +404 -0
  117. kalign_python-3.4.8/python-kalign/cli.py +177 -0
  118. kalign_python-3.4.8/python-kalign/io.py +351 -0
  119. kalign_python-3.4.8/python-kalign/py.typed +0 -0
  120. kalign_python-3.4.8/python-kalign/utils.py +327 -0
  121. kalign_python-3.4.8/scripts/balibase_test.org +1308 -0
  122. kalign_python-3.4.8/scripts/benchmark.org +804 -0
  123. kalign_python-3.4.8/scripts/bralibase.org +241 -0
  124. kalign_python-3.4.8/src/CMakeLists.txt +60 -0
  125. kalign_python-3.4.8/src/parameters.c +126 -0
  126. kalign_python-3.4.8/src/parameters.h +76 -0
  127. kalign_python-3.4.8/src/run_kalign.c +400 -0
  128. kalign_python-3.4.8/src/run_reformat.c +347 -0
  129. kalign_python-3.4.8/src/version.h.in +2 -0
  130. kalign_python-3.4.8/test_thresholds.py +423 -0
  131. kalign_python-3.4.8/tests/CMakeLists.txt +103 -0
  132. kalign_python-3.4.8/tests/data/BB11001.msf +26 -0
  133. kalign_python-3.4.8/tests/data/BB11001.tfa +12 -0
  134. kalign_python-3.4.8/tests/data/BB11001_EOF.msf +25 -0
  135. kalign_python-3.4.8/tests/data/BB12006.msf +44 -0
  136. kalign_python-3.4.8/tests/data/BB12006.tfa +24 -0
  137. kalign_python-3.4.8/tests/data/BB30014.msf +376 -0
  138. kalign_python-3.4.8/tests/data/BB30014.tfa +264 -0
  139. kalign_python-3.4.8/tests/data/README +5 -0
  140. kalign_python-3.4.8/tests/data/a2m.good.1 +16 -0
  141. kalign_python-3.4.8/tests/data/a2m.good.2 +15 -0
  142. kalign_python-3.4.8/tests/data/afa.good.1 +16 -0
  143. kalign_python-3.4.8/tests/data/afa.good.2 +15 -0
  144. kalign_python-3.4.8/tests/data/afa.good.3 +24 -0
  145. kalign_python-3.4.8/tests/data/clustal.good.1 +20 -0
  146. kalign_python-3.4.8/tests/data/clustal.good.2 +15 -0
  147. kalign_python-3.4.8/tests/data/small.fa +34 -0
  148. kalign_python-3.4.8/tests/data/tiny.fa +4 -0
  149. kalign_python-3.4.8/tests/data/tiny_internal.fa +4 -0
  150. kalign_python-3.4.8/tests/dssim.c +608 -0
  151. kalign_python-3.4.8/tests/dssim.h +19 -0
  152. kalign_python-3.4.8/tests/dssim_test.c +137 -0
  153. kalign_python-3.4.8/tests/kalign_cmp_test.c +23 -0
  154. kalign_python-3.4.8/tests/kalign_io_test.c +21 -0
  155. kalign_python-3.4.8/tests/kalign_lib_test.c +74 -0
  156. kalign_python-3.4.8/tests/kalign_lib_testCXX.cpp +40 -0
  157. kalign_python-3.4.8/tests/large_benchmark.c +472 -0
  158. kalign_python-3.4.8/tests/python/conftest.py +282 -0
  159. kalign_python-3.4.8/tests/python/pytest.ini +19 -0
  160. kalign_python-3.4.8/tests/python/test_basic_alignment.py +68 -0
  161. kalign_python-3.4.8/tests/python/test_cli.py +54 -0
  162. kalign_python-3.4.8/tests/python/test_compare.py +83 -0
  163. kalign_python-3.4.8/tests/python/test_data/dna_sequences.fasta +6 -0
  164. kalign_python-3.4.8/tests/python/test_data/invalid_sequences.fasta +4 -0
  165. kalign_python-3.4.8/tests/python/test_data/protein_sequences.fasta +6 -0
  166. kalign_python-3.4.8/tests/python/test_data/rna_sequences.fasta +6 -0
  167. kalign_python-3.4.8/tests/python/test_ecosystem_integration.py +324 -0
  168. kalign_python-3.4.8/tests/python/test_ecosystem_real.py +260 -0
  169. kalign_python-3.4.8/tests/python/test_edge_cases.py +82 -0
  170. kalign_python-3.4.8/tests/python/test_error_handling.py +56 -0
  171. kalign_python-3.4.8/tests/python/test_file_operations.py +75 -0
  172. kalign_python-3.4.8/tests/python/test_input_validation.py +72 -0
  173. kalign_python-3.4.8/tests/python/test_integration.py +103 -0
  174. kalign_python-3.4.8/tests/python/test_parameters.py +47 -0
  175. kalign_python-3.4.8/tests/python/test_performance.py +129 -0
  176. kalign_python-3.4.8/tests/python/test_sequence_types.py +96 -0
  177. kalign_python-3.4.8/tests/zig_test.c +20 -0
  178. kalign_python-3.4.8/uv.lock +4462 -0
@@ -0,0 +1,124 @@
1
+ name: Benchmark
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'lib/**'
8
+ - 'python-kalign/**'
9
+ - 'benchmarks/**'
10
+ - 'CMakeLists.txt'
11
+ - '.github/workflows/benchmark.yml'
12
+ pull_request:
13
+ branches: [main]
14
+ paths:
15
+ - 'lib/**'
16
+ - 'python-kalign/**'
17
+ - 'benchmarks/**'
18
+ - 'CMakeLists.txt'
19
+ - '.github/workflows/benchmark.yml'
20
+ workflow_dispatch:
21
+
22
+ permissions:
23
+ contents: write
24
+ deployments: write
25
+
26
+ jobs:
27
+ benchmark:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+
32
+ - name: Set up Python
33
+ uses: actions/setup-python@v5
34
+ with:
35
+ python-version: '3.11'
36
+
37
+ - name: Install system dependencies
38
+ run: |
39
+ sudo apt-get update
40
+ sudo apt-get install -y libomp-dev cmake
41
+
42
+ - name: Build C binary
43
+ run: |
44
+ mkdir -p build
45
+ cd build
46
+ cmake ..
47
+ make -j$(nproc)
48
+
49
+ - name: Install Python package
50
+ run: |
51
+ python -m pip install --upgrade pip
52
+ python -m pip install -e .
53
+
54
+ - name: Cache BAliBASE dataset
55
+ uses: actions/cache@v4
56
+ with:
57
+ path: benchmarks/data/downloads
58
+ key: benchmark-datasets-balibase-v1
59
+
60
+ - name: Run benchmarks
61
+ run: |
62
+ python -m benchmarks \
63
+ --dataset balibase \
64
+ --method python_api cli \
65
+ --binary build/src/kalign \
66
+ --output benchmarks/results/latest.json \
67
+ -v
68
+
69
+ - name: Convert results for github-action-benchmark
70
+ run: |
71
+ python -c "
72
+ import json
73
+ with open('benchmarks/results/latest.json') as f:
74
+ data = json.load(f)
75
+ entries = []
76
+ for method, stats in data.get('summary', {}).items():
77
+ entries.append({
78
+ 'name': f'SP Score Mean ({method})',
79
+ 'unit': 'score',
80
+ 'value': round(stats['sp_mean'], 2),
81
+ 'range': f\"{stats['sp_min']:.1f}-{stats['sp_max']:.1f}\",
82
+ })
83
+ entries.append({
84
+ 'name': f'Total Time ({method})',
85
+ 'unit': 'seconds',
86
+ 'value': round(stats['total_time'], 2),
87
+ })
88
+ with open('benchmarks/results/benchmark_output.json', 'w') as f:
89
+ json.dump(entries, f, indent=2)
90
+ "
91
+
92
+ - name: Store benchmark result
93
+ if: github.ref == 'refs/heads/main'
94
+ uses: benchmark-action/github-action-benchmark@v1
95
+ with:
96
+ tool: 'customBiggerIsBetter'
97
+ output-file-path: benchmarks/results/benchmark_output.json
98
+ github-token: ${{ secrets.GITHUB_TOKEN }}
99
+ gh-pages-branch: gh-pages
100
+ benchmark-data-dir-path: dev/bench
101
+ auto-push: true
102
+ alert-threshold: '95%'
103
+ comment-on-alert: true
104
+ fail-on-alert: false
105
+
106
+ - name: Compare with baseline (PRs only)
107
+ if: github.event_name == 'pull_request'
108
+ uses: benchmark-action/github-action-benchmark@v1
109
+ with:
110
+ tool: 'customBiggerIsBetter'
111
+ output-file-path: benchmarks/results/benchmark_output.json
112
+ github-token: ${{ secrets.GITHUB_TOKEN }}
113
+ gh-pages-branch: gh-pages
114
+ benchmark-data-dir-path: dev/bench
115
+ auto-push: false
116
+ alert-threshold: '95%'
117
+ comment-on-alert: true
118
+ fail-on-alert: true
119
+
120
+ - name: Upload results artifact
121
+ uses: actions/upload-artifact@v4
122
+ with:
123
+ name: benchmark-results
124
+ path: benchmarks/results/
@@ -0,0 +1,96 @@
1
+ name: CMake
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main", "python" ]
6
+ paths:
7
+ - 'lib/**'
8
+ - 'src/**'
9
+ - 'tests/**'
10
+ - 'CMakeLists.txt'
11
+ - '.github/workflows/cmake.yml'
12
+ pull_request:
13
+ branches: [ "main" ]
14
+ paths:
15
+ - 'lib/**'
16
+ - 'src/**'
17
+ - 'tests/**'
18
+ - 'CMakeLists.txt'
19
+ - '.github/workflows/cmake.yml'
20
+
21
+ jobs:
22
+ build:
23
+ name: Build C/C++ on ${{ matrix.os }}
24
+ runs-on: ${{ matrix.os }}
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ os: [ubuntu-latest, macos-latest]
29
+ build_type: [Release, Debug]
30
+
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+
34
+ - name: Install dependencies (Ubuntu)
35
+ if: runner.os == 'Linux'
36
+ run: |
37
+ sudo apt-get update
38
+ sudo apt-get install -y libomp-dev cmake
39
+
40
+ - name: Install dependencies (macOS)
41
+ if: runner.os == 'macOS'
42
+ run: |
43
+ brew install --formula libomp cmake
44
+
45
+ - name: Configure CMake
46
+ run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
47
+
48
+ - name: Build
49
+ run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} --parallel 2
50
+
51
+ - name: Test
52
+ working-directory: ${{github.workspace}}/build
53
+ run: ctest -C ${{ matrix.build_type }} --output-on-failure
54
+
55
+ - name: Test kalign executable
56
+ run: |
57
+ # Create test input
58
+ echo ">seq1" > test.fasta
59
+ echo "ATCGATCGATCG" >> test.fasta
60
+ echo ">seq2" >> test.fasta
61
+ echo "ATCGTCGATCG" >> test.fasta
62
+ echo ">seq3" >> test.fasta
63
+ echo "ATCGATCATCG" >> test.fasta
64
+
65
+ # Test kalign executable
66
+ ./build/src/kalign -i test.fasta -o test_output.fasta
67
+
68
+ # Verify output exists and is not empty
69
+ if [ -f test_output.fasta ] && [ -s test_output.fasta ]; then
70
+ echo "✓ kalign executable test passed"
71
+ else
72
+ echo "✗ kalign executable test failed"
73
+ exit 1
74
+ fi
75
+
76
+ address-sanitizer:
77
+ name: Address Sanitizer
78
+ runs-on: ubuntu-latest
79
+
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+
83
+ - name: Install dependencies
84
+ run: |
85
+ sudo apt-get update
86
+ sudo apt-get install -y libomp-dev cmake
87
+
88
+ - name: Configure CMake with ASAN
89
+ run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=ASAN
90
+
91
+ - name: Build
92
+ run: cmake --build ${{github.workspace}}/build --config ASAN --parallel 2
93
+
94
+ - name: Test with ASAN
95
+ working-directory: ${{github.workspace}}/build
96
+ run: ctest -C ASAN --output-on-failure
@@ -0,0 +1,62 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [main, python]
6
+ pull_request:
7
+ # The branches below must be a subset of the branches above
8
+ branches: [main, python]
9
+ schedule:
10
+ - cron: '0 2 * * 4'
11
+
12
+ jobs:
13
+ analyze:
14
+ name: Analyze
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ actions: read
18
+ contents: read
19
+ security-events: write
20
+
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ # Override automatic language detection by changing the below list
25
+ # Supported options are ['c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift']
26
+ language: ['c-cpp']
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+
32
+ # Initializes the CodeQL tools for scanning.
33
+ - name: Initialize CodeQL
34
+ uses: github/codeql-action/init@v3
35
+ with:
36
+ languages: ${{ matrix.language }}
37
+ # If you wish to specify custom queries, you can do so here or in a config file.
38
+ # By default, queries listed here will override any specified in a config file.
39
+ # Prefix the list here with "+" to use these queries and those in the config file.
40
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
41
+
42
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
43
+ # If this step fails, then you should remove it and run the build manually (see below)
44
+ - name: Autobuild
45
+ uses: github/codeql-action/autobuild@v3
46
+
47
+ # ℹ️ Command-line programs to run using the OS shell.
48
+ # 📚 https://git.io/JvXDl
49
+
50
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
51
+ # and modify them (or add more) to build your code if your project
52
+ # uses a compiled language
53
+
54
+ #- run: |
55
+ # mkdir build && cd build
56
+ # cmake ..
57
+ # make
58
+
59
+ - name: Perform CodeQL Analysis
60
+ uses: github/codeql-action/analyze@v3
61
+ with:
62
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,152 @@
1
+ name: Python
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, python ]
6
+ paths:
7
+ - 'python-kalign/**'
8
+ - 'lib/**'
9
+ - 'CMakeLists.txt'
10
+ - 'pyproject.toml'
11
+ - '.github/workflows/python.yml'
12
+ pull_request:
13
+ branches: [ main ]
14
+ paths:
15
+ - 'python-kalign/**'
16
+ - 'lib/**'
17
+ - 'CMakeLists.txt'
18
+ - 'pyproject.toml'
19
+ - '.github/workflows/python.yml'
20
+ workflow_dispatch:
21
+
22
+ jobs:
23
+ lint:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: '3.11'
32
+
33
+ - name: Install dependencies
34
+ run: |
35
+ python -m pip install --upgrade pip
36
+ python -m pip install flake8 black isort mypy
37
+
38
+ - name: Lint with flake8
39
+ run: |
40
+ flake8 python-kalign --count --select=E9,F63,F7,F82 --show-source --statistics
41
+ flake8 python-kalign --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
42
+
43
+ - name: Check formatting with black
44
+ run: |
45
+ black --check --diff python-kalign/
46
+
47
+ - name: Check import sorting with isort
48
+ run: |
49
+ isort --check-only --diff python-kalign/
50
+
51
+ test:
52
+ runs-on: ${{ matrix.os }}
53
+ strategy:
54
+ fail-fast: false
55
+ matrix:
56
+ os: [ubuntu-latest, macos-latest]
57
+ python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
58
+
59
+ steps:
60
+ - uses: actions/checkout@v4
61
+
62
+ - name: Set up Python ${{ matrix.python-version }}
63
+ uses: actions/setup-python@v5
64
+ with:
65
+ python-version: ${{ matrix.python-version }}
66
+
67
+ - name: Install system dependencies (Ubuntu)
68
+ if: runner.os == 'Linux'
69
+ run: |
70
+ sudo apt-get update
71
+ sudo apt-get install -y libomp-dev cmake
72
+
73
+ - name: Install system dependencies (macOS)
74
+ if: runner.os == 'macOS'
75
+ run: |
76
+ brew install libomp cmake
77
+
78
+ - name: Install Python dependencies
79
+ run: |
80
+ python -m pip install --upgrade pip
81
+ python -m pip install pytest pytest-cov pytest-benchmark numpy
82
+
83
+ - name: Build and install package
84
+ run: |
85
+ python -m pip install -e .
86
+
87
+ - name: Test with pytest
88
+ run: |
89
+ pytest tests/python/ -v --cov=kalign --cov-report=xml --cov-report=term-missing
90
+
91
+ - name: Upload coverage to Codecov
92
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
93
+ uses: codecov/codecov-action@v4
94
+ with:
95
+ file: coverage.xml
96
+ flags: python
97
+ name: codecov-umbrella
98
+
99
+ build-test:
100
+ name: Build and test package
101
+ runs-on: ${{ matrix.os }}
102
+ strategy:
103
+ fail-fast: false
104
+ matrix:
105
+ os: [ubuntu-latest, macos-latest]
106
+
107
+ steps:
108
+ - uses: actions/checkout@v4
109
+
110
+ - name: Set up Python
111
+ uses: actions/setup-python@v5
112
+ with:
113
+ python-version: '3.11'
114
+
115
+ - name: Install system dependencies (Ubuntu)
116
+ if: runner.os == 'Linux'
117
+ run: |
118
+ sudo apt-get update
119
+ sudo apt-get install -y libomp-dev cmake
120
+
121
+ - name: Install system dependencies (macOS)
122
+ if: runner.os == 'macOS'
123
+ run: |
124
+ brew install libomp cmake
125
+
126
+ - name: Install build dependencies
127
+ run: |
128
+ python -m pip install --upgrade pip
129
+ python -m pip install build twine
130
+
131
+ - name: Build package
132
+ run: |
133
+ python -m build
134
+
135
+ - name: Check package
136
+ run: |
137
+ twine check dist/*
138
+
139
+ - name: Test installation from wheel
140
+ run: |
141
+ python -m pip install dist/*.whl
142
+ python -c "import kalign; print(f'kalign {kalign.__version__} installed successfully')"
143
+
144
+ - name: Test basic functionality
145
+ run: |
146
+ python -c "
147
+ import kalign
148
+ sequences = ['ATCGATCG', 'ATCGTCG', 'ATCGATCG']
149
+ aligned = kalign.align(sequences, seq_type='dna')
150
+ assert len(aligned) == 3
151
+ print('✓ Basic alignment test passed')
152
+ "