scoring-matrices
Advanced tools
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
@@ -36,2 +36,5 @@ name: Test | ||
| python-impl: CPython | ||
| - python-version: 3.14 | ||
| python-release: v3.14 | ||
| python-impl: CPython | ||
| - python-version: pypy-3.9 | ||
@@ -96,2 +99,5 @@ python-release: v3.9 | ||
| python-impl: CPython | ||
| - python-version: '3.14' | ||
| python-release: v3.14 | ||
| python-impl: CPython | ||
| - python-version: pypy-3.9 | ||
@@ -156,2 +162,5 @@ python-release: v3.9 | ||
| python-impl: CPython | ||
| - python-version: '3.14' | ||
| python-release: v3.14 | ||
| python-impl: CPython | ||
| - python-version: pypy-3.9 | ||
@@ -158,0 +167,0 @@ python-release: v3.9 |
+17
-1
@@ -9,5 +9,21 @@ # Changelog | ||
| ## [Unreleased] | ||
| [Unreleased]: https://github.com/althonos/scoring-matrices/compare/v0.3.3...HEAD | ||
| [Unreleased]: https://github.com/althonos/scoring-matrices/compare/v0.3.4...HEAD | ||
| ## [v0.3.4] - 2026-01-18 | ||
| [v0.3.4]: https://github.com/althonos/scoring-matrices/compare/v0.3.3...v0.3.4 | ||
| ### Added | ||
| - New `buffer` attribute to `ScoringMatrix` exposing a unique read-only `memoryview`. | ||
| - `PFASUM31`, `PFAM43` and `PFASUM60` matrices ([#6](https://github.com/althonos/scoring-matrices/pull/6), by [@apcamargo](https://github.com/apcamargo)). | ||
| - `EDNAFULL` nucleotide matrix ([#7](https://github.com/althonos/scoring-matrices/pull/7), by [@apcamargo](https://github.com/apcamargo)). | ||
| ### Changed | ||
| - Compile wheel in Python Limited API mode for Python 3.11 and later. | ||
| ### Fixed | ||
| - Issue with `pickle` protocol 5 causing issues with `ScoringMatrix` pickling. | ||
| - Ensure documentation is built with extension in debug mode on ReadTheDocs. | ||
| ## [v0.3.3] - 2025-08-13 | ||
@@ -14,0 +30,0 @@ [v0.3.3]: https://github.com/althonos/scoring-matrices/compare/v0.3.2...v0.3.3 |
+1
-1
| MIT License | ||
| Copyright (c) 2024 Martin Larralde <martin.larralde@embl.de> | ||
| Copyright (c) 2024-2026 Martin Larralde <martin.larralde@embl.de> | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+3
-2
| Metadata-Version: 2.2 | ||
| Name: scoring-matrices | ||
| Version: 0.3.3 | ||
| Version: 0.3.4 | ||
| Summary: Dependency free, Cython-compatible scoring matrices to use with biological sequences. | ||
@@ -9,3 +9,3 @@ Keywords: bioinformatics,sequence,substitution,matrix,score | ||
| Copyright (c) 2024 Martin Larralde <martin.larralde@embl.de> | ||
| Copyright (c) 2024-2026 Martin Larralde <martin.larralde@embl.de> | ||
@@ -44,2 +44,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| Classifier: Programming Language :: Python :: 3.13 | ||
| Classifier: Programming Language :: Python :: 3.14 | ||
| Classifier: Programming Language :: Python :: Implementation :: CPython | ||
@@ -46,0 +47,0 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy |
+8
-1
@@ -7,3 +7,3 @@ [build-system] | ||
| name = "scoring-matrices" | ||
| version = "0.3.3" | ||
| version = "0.3.4" | ||
| description = "Dependency free, Cython-compatible scoring matrices to use with biological sequences." | ||
@@ -32,2 +32,3 @@ readme = "README.md" | ||
| "Programming Language :: Python :: 3.13", | ||
| "Programming Language :: Python :: 3.14", | ||
| "Programming Language :: Python :: Implementation :: CPython", | ||
@@ -53,2 +54,4 @@ "Programming Language :: Python :: Implementation :: PyPy", | ||
| build-dir = "build/{build_type}" | ||
| wheel.py-api = "cp311" | ||
| wheel.expand-macos-universal-tags = true | ||
| editable.rebuild = true | ||
@@ -65,2 +68,6 @@ editable.verbose = false | ||
| [[tool.scikit-build.overrides]] | ||
| if.env.READTHEDOCS = "True" | ||
| cmake.build-type = "Debug" | ||
| [[tool.scikit-build-overrides]] | ||
@@ -67,0 +74,0 @@ if.env.SCCACHE = true |
@@ -5,4 +5,4 @@ # distutils: language = c | ||
| cdef class ScoringMatrix: | ||
| cdef readonly str name | ||
| cdef readonly str alphabet | ||
| cdef readonly str name | ||
| cdef readonly str alphabet | ||
@@ -9,0 +9,0 @@ cdef size_t _size |
@@ -47,2 +47,4 @@ import typing | ||
| def name(self) -> Optional[str]: ... | ||
| @property | ||
| def buffer(self) -> Optional[memoryview]: ... | ||
| @typing.overload | ||
@@ -49,0 +51,0 @@ def __getitem__(self, item: int) -> List[float]: ... |
@@ -8,3 +8,4 @@ # distutils: language = c | ||
| from cpython.buffer cimport PyBUF_FORMAT, PyBUF_READ, PyBUF_WRITE | ||
| from cpython.memoryview cimport PyMemoryView_FromMemory | ||
| from cpython.memoryview cimport PyMemoryView_FromMemory, PyMemoryView_GET_BUFFER | ||
| from cpython.pycapsule cimport PyCapsule_New | ||
@@ -29,2 +30,7 @@ from libc.math cimport INFINITY, lrintf | ||
| """A scoring matrix to use for biological sequence alignments. | ||
| Attributes: | ||
| alphabet (`str`): The alphabet of the scoring matrix. | ||
| name (`str` or `None`): The name of the scoring matrix, if any. | ||
| """ | ||
@@ -43,3 +49,3 @@ | ||
| VTML or BENNER matrix series. See the :doc:`Matrices </guide/matrices>` | ||
| page of the documentation for a comprehensive list. | ||
| page of the documentation for a comprehensive list. | ||
@@ -58,3 +64,3 @@ Arguments: | ||
| The `ScoringMatrix.BUILTIN_MATRICES` frozenset contains the names | ||
| of every available matrix, which can be useful for checking | ||
| of every available matrix, which can be useful for checking | ||
| allowed matrix names:: | ||
@@ -65,3 +71,3 @@ | ||
| >>> arg = parser.add_argument( | ||
| ... "--matrix", | ||
| ... "--matrix", | ||
| ... choices=ScoringMatrix.BUILTIN_MATRICES, | ||
@@ -129,6 +135,6 @@ ... default="BLOSUM62" | ||
| def from_diagonal( | ||
| cls, | ||
| object diagonal, | ||
| float mismatch_score=0.0, | ||
| str alphabet not None = DEFAULT_ALPHABET, | ||
| cls, | ||
| object diagonal, | ||
| float mismatch_score=0.0, | ||
| str alphabet not None = DEFAULT_ALPHABET, | ||
| str name = None | ||
@@ -141,3 +147,3 @@ ): | ||
| matrix, used to score character matches. | ||
| mismatch_score (`float`): The mismatch score to use for | ||
| mismatch_score (`float`): The mismatch score to use for | ||
| every mismatches. | ||
@@ -174,3 +180,3 @@ alphabet (`str`): The alphabet to use with the scoring matrix. | ||
| cls, | ||
| float match_score = 1.0, | ||
| float match_score = 1.0, | ||
| float mismatch_score = -1.0, | ||
@@ -214,3 +220,3 @@ str alphabet not None = DEFAULT_ALPHABET, | ||
| """__init__(self, matrix, alphabet="ARNDCQEGHILKMFPSTWYVBZX", name=None)\n--\n | ||
| Create a new scoring matrix. | ||
@@ -243,6 +249,6 @@ | ||
| """ | ||
| cdef ssize_t i | ||
| cdef ssize_t j | ||
| cdef float x | ||
| cdef size_t size = len(alphabet) | ||
| cdef ssize_t i | ||
| cdef ssize_t j | ||
| cdef float x | ||
| cdef size_t size = len(alphabet) | ||
@@ -252,3 +258,3 @@ if len(alphabet) != len(set(alphabet)): | ||
| if len(matrix) != size: | ||
| raise ValueError("Matrix must contain one row per alphabet letter") | ||
| raise ValueError(f"Matrix must contain one row per alphabet letter, got {len(matrix)}") | ||
@@ -285,29 +291,5 @@ self.alphabet = alphabet | ||
| assert self._matrix != NULL | ||
| # use out-of-band pickling (only supported since protocol 5, see | ||
| # https://docs.python.org/3/library/pickle.html#out-of-band-buffers) | ||
| if protocol >= 5: | ||
| matrix = pickle.PickleBuffer(self) | ||
| else: | ||
| matrix = list(self) | ||
| matrix = list(self) | ||
| return (type(self), (matrix, self.alphabet, self.name)) | ||
| def __getbuffer__(self, Py_buffer* buffer, int flags): | ||
| assert self._data != NULL | ||
| if flags & PyBUF_FORMAT: | ||
| buffer.format = b"f" | ||
| else: | ||
| buffer.format = NULL | ||
| buffer.buf = self._data | ||
| buffer.internal = NULL | ||
| buffer.itemsize = sizeof(float) | ||
| buffer.len = self._nitems * sizeof(float) | ||
| buffer.ndim = 2 | ||
| buffer.obj = self | ||
| buffer.readonly = 1 | ||
| buffer.shape = <Py_ssize_t*> &self._shape | ||
| buffer.suboffsets = NULL | ||
| buffer.strides = NULL | ||
| def __len__(self): | ||
@@ -373,4 +355,22 @@ return self._size | ||
| def __getbuffer__(self, Py_buffer* buffer, int flags): | ||
| assert self._data != NULL | ||
| if flags & PyBUF_FORMAT: | ||
| buffer.format = b"f" | ||
| else: | ||
| buffer.format = NULL | ||
| buffer.buf = self._data | ||
| buffer.internal = NULL | ||
| buffer.itemsize = sizeof(float) | ||
| buffer.len = self._nitems * sizeof(float) | ||
| buffer.ndim = 2 | ||
| buffer.obj = self | ||
| buffer.readonly = 1 | ||
| buffer.shape = <Py_ssize_t*> &self._shape | ||
| buffer.suboffsets = NULL | ||
| buffer.strides = NULL | ||
| # --- Private methods ------------------------------------------------------ | ||
| cdef int _allocate(self, size_t size) except 1 nogil: | ||
@@ -509,3 +509,3 @@ cdef size_t i | ||
| assert self._data != NULL | ||
| cdef size_t i | ||
@@ -527,3 +527,3 @@ cdef float m = -INFINITY | ||
| Arguments: | ||
| alphabet (`str`): The new alphabet to use for the columns. It | ||
| alphabet (`str`): The new alphabet to use for the columns. It | ||
| must be a subset of ``self.alphabet``. | ||
@@ -530,0 +530,0 @@ |
@@ -1,2 +0,2 @@ | ||
| find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) | ||
| find_package(Python COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT} REQUIRED) | ||
| get_property(PYTHON_EXTENSIONS_SOURCE_DIR GLOBAL PROPERTY PYTHON_EXTENSIONS_SOURCE_DIR) | ||
@@ -97,3 +97,9 @@ | ||
| endif() | ||
| python_add_library(${_target} MODULE WITH_SOABI ${EXTENSION_SOURCES}) | ||
| if((NOT "${SKBUILD_SABI_VERSION}" STREQUAL "") AND (NOT CMAKE_BUILD_TYPE STREQUAL Debug)) | ||
| message(STATUS "Building in Limited API mode for Python: ${SKBUILD_SABI_VERSION}") | ||
| python_add_library(${_target} MODULE WITH_SOABI USE_SABI "${SKBUILD_SABI_VERSION}" ${EXTENSION_SOURCES}) | ||
| else() | ||
| message(STATUS "Building in latest API mode for Python: ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}") | ||
| python_add_library(${_target} MODULE WITH_SOABI ${EXTENSION_SOURCES}) | ||
| endif() | ||
| set_target_properties(${_target} PROPERTIES OUTPUT_NAME ${_name}) | ||
@@ -122,7 +128,2 @@ set_target_properties(${_target} PROPERTIES CXX_STANDARD 17) | ||
| message(DEBUG "Install folder for extension ${_name}: ${_dest_folder}") | ||
| # Add the targets to the list of Cython extensions | ||
| get_property(_ext GLOBAL PROPERTY PYRODIGAL_CYTHON_EXTENSIONS) | ||
| list(APPEND _ext ${_target}) | ||
| set_property(GLOBAL PROPERTY PYRODIGAL_CYTHON_EXTENSIONS ${_ext}) | ||
| endmacro() |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
305767
19.84%117
8.33%326
0.62%