pyseqalignment 0.1.2__tar.gz → 0.1.3__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 (55) hide show
  1. {pyseqalignment-0.1.2/src/pyseqalignment.egg-info → pyseqalignment-0.1.3}/PKG-INFO +20 -4
  2. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/README.md +19 -3
  3. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/pyproject.toml +4 -2
  4. pyseqalignment-0.1.3/setup.py +58 -0
  5. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/__init__.py +1 -1
  6. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3/src/pyseqalignment.egg-info}/PKG-INFO +20 -4
  7. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalignment.egg-info/SOURCES.txt +1 -0
  8. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/LICENSE +0 -0
  9. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/setup.cfg +0 -0
  10. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/accel.py +0 -0
  11. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/core/__init__.py +0 -0
  12. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/core/alignment.py +0 -0
  13. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/core/needleman_wunsch.py +0 -0
  14. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/core/smith_waterman.py +0 -0
  15. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/cpp/build_cpp_aligner.sh +0 -0
  16. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/cpp/cpp_aligner.cpp +0 -0
  17. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/__init__.py +0 -0
  18. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/aleph.py +0 -0
  19. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/aleph_files/__init__.py +0 -0
  20. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/aleph_files/aleph_swi_ak.pl +0 -0
  21. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/base.py +0 -0
  22. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/popper.py +0 -0
  23. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/learning/task_builder.py +0 -0
  24. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/__init__.py +0 -0
  25. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/engine.py +0 -0
  26. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/knowledge/__init__.py +0 -0
  27. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/knowledge/amino_acids.pl +0 -0
  28. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/knowledge/blosum50.pl +0 -0
  29. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/knowledge/defaults.pl +0 -0
  30. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/prolog/knowledge/distances.pl +0 -0
  31. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/__init__.py +0 -0
  32. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/distance.py +0 -0
  33. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrices.py +0 -0
  34. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM100 +0 -0
  35. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM50 +0 -0
  36. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM60 +0 -0
  37. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM62 +0 -0
  38. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM70 +0 -0
  39. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM80 +0 -0
  40. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/BLOSUM90 +0 -0
  41. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/PAM150 +0 -0
  42. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/PAM200 +0 -0
  43. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/PAM250 +0 -0
  44. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/PAM50 +0 -0
  45. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/scoring/matrix_data/__init__.py +0 -0
  46. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/utils/__init__.py +0 -0
  47. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalign/utils/helpers.py +0 -0
  48. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalignment.egg-info/dependency_links.txt +0 -0
  49. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalignment.egg-info/requires.txt +0 -0
  50. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/src/pyseqalignment.egg-info/top_level.txt +0 -0
  51. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/tests/test_learning.py +0 -0
  52. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/tests/test_needleman_wunsch.py +0 -0
  53. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/tests/test_scoring.py +0 -0
  54. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/tests/test_smith_waterman.py +0 -0
  55. {pyseqalignment-0.1.2 → pyseqalignment-0.1.3}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyseqalignment
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: pySeqAlign -- sequence alignment with Prolog-style distance functions and ILP learning
5
5
  Author-email: Andreas Karwath <a.karwath@bham.ac.uk>
6
6
  License-Expression: MIT
@@ -313,15 +313,31 @@ For reference, other notable systems in the field include:
313
313
 
314
314
  The pure-Python aligners are fine for typical use. For heavy workloads (e.g.
315
315
  boosting that re-aligns thousands of sequence pairs per iteration), an optional
316
- **C++ affine-gap Needleman-Wunsch** kernel is provided. It is NOT built by default
317
- (the core stays pure Python); build it once with a C++ compiler + pybind11:
316
+ **C++ affine-gap Needleman-Wunsch** kernel is provided.
317
+
318
+ **It is compiled automatically at install time** (best effort). The package is
319
+ distributed as an sdist, so `pip install pyseqalignment` builds from source and
320
+ tries to compile the accelerator for your Python/ABI/platform using a C++
321
+ compiler + pybind11 (pulled in as a build dependency). On macOS/Linux with a
322
+ compiler present this "just works"; if no compiler is available the install
323
+ still succeeds and the library falls back to the pure-Python aligner. Check with:
324
+
325
+ ```python
326
+ from pyseqalign.accel import cpp_available
327
+ print(cpp_available()) # True if the accelerator compiled at install
328
+ ```
329
+
330
+ If you installed without a compiler and later want the accelerator, install one
331
+ (Xcode Command Line Tools on macOS, `build-essential` on Debian/Ubuntu) and
332
+ either reinstall (`pip install --force-reinstall --no-binary :all: pyseqalignment`)
333
+ or build it in place once:
318
334
 
319
335
  ```bash
320
336
  pip install pybind11
321
337
  src/pyseqalign/cpp/build_cpp_aligner.sh # or: PY=$(which python) src/.../build_cpp_aligner.sh
322
338
  ```
323
339
 
324
- This compiles the extension into the `pyseqalign` package. Then:
340
+ Either way it compiles the extension into the `pyseqalign` package. Then:
325
341
 
326
342
  ```python
327
343
  from pyseqalign.accel import cpp_available, load
@@ -275,15 +275,31 @@ For reference, other notable systems in the field include:
275
275
 
276
276
  The pure-Python aligners are fine for typical use. For heavy workloads (e.g.
277
277
  boosting that re-aligns thousands of sequence pairs per iteration), an optional
278
- **C++ affine-gap Needleman-Wunsch** kernel is provided. It is NOT built by default
279
- (the core stays pure Python); build it once with a C++ compiler + pybind11:
278
+ **C++ affine-gap Needleman-Wunsch** kernel is provided.
279
+
280
+ **It is compiled automatically at install time** (best effort). The package is
281
+ distributed as an sdist, so `pip install pyseqalignment` builds from source and
282
+ tries to compile the accelerator for your Python/ABI/platform using a C++
283
+ compiler + pybind11 (pulled in as a build dependency). On macOS/Linux with a
284
+ compiler present this "just works"; if no compiler is available the install
285
+ still succeeds and the library falls back to the pure-Python aligner. Check with:
286
+
287
+ ```python
288
+ from pyseqalign.accel import cpp_available
289
+ print(cpp_available()) # True if the accelerator compiled at install
290
+ ```
291
+
292
+ If you installed without a compiler and later want the accelerator, install one
293
+ (Xcode Command Line Tools on macOS, `build-essential` on Debian/Ubuntu) and
294
+ either reinstall (`pip install --force-reinstall --no-binary :all: pyseqalignment`)
295
+ or build it in place once:
280
296
 
281
297
  ```bash
282
298
  pip install pybind11
283
299
  src/pyseqalign/cpp/build_cpp_aligner.sh # or: PY=$(which python) src/.../build_cpp_aligner.sh
284
300
  ```
285
301
 
286
- This compiles the extension into the `pyseqalign` package. Then:
302
+ Either way it compiles the extension into the `pyseqalign` package. Then:
287
303
 
288
304
  ```python
289
305
  from pyseqalign.accel import cpp_available, load
@@ -1,12 +1,14 @@
1
1
  [build-system]
2
- requires = ["setuptools>=68.0"]
2
+ # pybind11 is a build-time dep so the OPTIONAL C++ aligner can be compiled at
3
+ # install time (best-effort; see setup.py). It is not a runtime dependency.
4
+ requires = ["setuptools>=68.0", "pybind11>=2.10"]
3
5
  build-backend = "setuptools.build_meta"
4
6
 
5
7
  [project]
6
8
  # PyPI distribution name (the import package is `pyseqalign`; the name
7
9
  # `pyseqalign` was blocked by PyPI's similarity guard vs. an existing project).
8
10
  name = "pyseqalignment"
9
- version = "0.1.2"
11
+ version = "0.1.3"
10
12
  description = "pySeqAlign -- sequence alignment with Prolog-style distance functions and ILP learning"
11
13
  readme = "README.md"
12
14
  license = "MIT"
@@ -0,0 +1,58 @@
1
+ """Best-effort build of the optional C++ affine-gap aligner.
2
+
3
+ pySeqAlign's core is pure Python. The C++ aligner (``pyseqalign.cpp_aligner``)
4
+ is an OPTIONAL accelerator (~100-270x faster, identical results). We try to
5
+ compile it at install time on any platform that has a C++ compiler + pybind11;
6
+ if that fails (no compiler, no pybind11, unsupported platform, ...) the install
7
+ STILL SUCCEEDS and the library transparently falls back to the pure-Python
8
+ aligner -- see ``pyseqalign.accel``.
9
+
10
+ This is why the project publishes an sdist (not a pure-Python wheel): pip builds
11
+ from source on the target machine, giving every install a chance to compile the
12
+ accelerator locally for its own Python/ABI/platform.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import sys
18
+
19
+ from setuptools import Extension, setup
20
+ from setuptools.command.build_ext import build_ext
21
+
22
+ # Only build on POSIX (macOS/Linux); the hand-tuned flags below are GCC/Clang.
23
+ _CPP = 'src/pyseqalign/cpp/cpp_aligner.cpp'
24
+ ext_modules: list[Extension] = []
25
+ if sys.platform != 'win32':
26
+ try:
27
+ import pybind11
28
+ ext_modules = [
29
+ Extension(
30
+ 'pyseqalign.cpp_aligner',
31
+ [_CPP],
32
+ include_dirs=[pybind11.get_include()],
33
+ language='c++',
34
+ optional=True, # setuptools won't fail the build if this ext won't compile
35
+ extra_compile_args=['-O3', '-std=c++14'],
36
+ )
37
+ ]
38
+ except Exception as exc: # pybind11 missing -> skip the accelerator
39
+ print(f'pyseqalign: skipping optional C++ aligner ({exc}); pure-Python fallback.')
40
+
41
+
42
+ class BestEffortBuildExt(build_ext):
43
+ """Compile the accelerator if possible; never break the install if not."""
44
+
45
+ def run(self) -> None:
46
+ try:
47
+ super().run()
48
+ except Exception as exc: # pragma: no cover - depends on build env
49
+ print(f'pyseqalign: optional C++ aligner not built ({exc}); pure-Python fallback.')
50
+
51
+ def build_extension(self, ext) -> None:
52
+ try:
53
+ super().build_extension(ext)
54
+ except Exception as exc: # pragma: no cover - depends on build env
55
+ print(f'pyseqalign: optional C++ aligner not built ({exc}); pure-Python fallback.')
56
+
57
+
58
+ setup(ext_modules=ext_modules, cmdclass={'build_ext': BestEffortBuildExt})
@@ -4,7 +4,7 @@ from pyseqalign.core.alignment import AlignmentResult, LocalAlignmentResult
4
4
  from pyseqalign.core.needleman_wunsch import NeedlemanWunsch
5
5
  from pyseqalign.core.smith_waterman import SmithWaterman
6
6
 
7
- __version__ = "0.1.0"
7
+ __version__ = "0.1.3"
8
8
 
9
9
  __all__ = [
10
10
  "SmithWaterman",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyseqalignment
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: pySeqAlign -- sequence alignment with Prolog-style distance functions and ILP learning
5
5
  Author-email: Andreas Karwath <a.karwath@bham.ac.uk>
6
6
  License-Expression: MIT
@@ -313,15 +313,31 @@ For reference, other notable systems in the field include:
313
313
 
314
314
  The pure-Python aligners are fine for typical use. For heavy workloads (e.g.
315
315
  boosting that re-aligns thousands of sequence pairs per iteration), an optional
316
- **C++ affine-gap Needleman-Wunsch** kernel is provided. It is NOT built by default
317
- (the core stays pure Python); build it once with a C++ compiler + pybind11:
316
+ **C++ affine-gap Needleman-Wunsch** kernel is provided.
317
+
318
+ **It is compiled automatically at install time** (best effort). The package is
319
+ distributed as an sdist, so `pip install pyseqalignment` builds from source and
320
+ tries to compile the accelerator for your Python/ABI/platform using a C++
321
+ compiler + pybind11 (pulled in as a build dependency). On macOS/Linux with a
322
+ compiler present this "just works"; if no compiler is available the install
323
+ still succeeds and the library falls back to the pure-Python aligner. Check with:
324
+
325
+ ```python
326
+ from pyseqalign.accel import cpp_available
327
+ print(cpp_available()) # True if the accelerator compiled at install
328
+ ```
329
+
330
+ If you installed without a compiler and later want the accelerator, install one
331
+ (Xcode Command Line Tools on macOS, `build-essential` on Debian/Ubuntu) and
332
+ either reinstall (`pip install --force-reinstall --no-binary :all: pyseqalignment`)
333
+ or build it in place once:
318
334
 
319
335
  ```bash
320
336
  pip install pybind11
321
337
  src/pyseqalign/cpp/build_cpp_aligner.sh # or: PY=$(which python) src/.../build_cpp_aligner.sh
322
338
  ```
323
339
 
324
- This compiles the extension into the `pyseqalign` package. Then:
340
+ Either way it compiles the extension into the `pyseqalign` package. Then:
325
341
 
326
342
  ```python
327
343
  from pyseqalign.accel import cpp_available, load
@@ -1,6 +1,7 @@
1
1
  LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
+ setup.py
4
5
  src/pyseqalign/__init__.py
5
6
  src/pyseqalign/accel.py
6
7
  src/pyseqalign/core/__init__.py
File without changes
File without changes