Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to numpy 2.0 #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
description = "Synteny and rearrangement identifier between whole-genome assemblies"
readme = "README.md"
# Limit python version as pysam is not available for higher python versions
requires-python = ">=3.8, <=3.10"
requires-python = ">=3.8"
keywords = ["Structural Variation", "SV", "Pangenomics", "Bioinformatics"]
license = {text = "MIT"}
dependencies = [
Expand Down
10 changes: 5 additions & 5 deletions syri/pyxFiles/function.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ cimport numpy as np
cimport cython
np.random.seed(1)

cpdef inline getOverlapWithSynBlocks(np.ndarray[np.int_t, ndim=1] start, np.ndarray[np.int_t, ndim=1] end, np.ndarray chrom, np.ndarray[np.int_t, ndim=1] in_start, np.ndarray[np.int_t, ndim=1] in_end, np.ndarray in_chrom, np.int_t threshold, np.int_t count, np.int_t tUC, np.float_t tUP):
cpdef inline getOverlapWithSynBlocks(np.ndarray[np.int64_t, ndim=1] start, np.ndarray[np.int64_t, ndim=1] end, np.ndarray chrom, np.ndarray[np.int64_t, ndim=1] in_start, np.ndarray[np.int64_t, ndim=1] in_end, np.ndarray in_chrom, np.int64_t threshold, np.int64_t count, np.int64_t tUC, np.float_t tUP):

assert(len(start) == len(end) == len(chrom) ==count)
assert(len(in_start) == len(in_end) == len(in_chrom))

cdef Py_ssize_t i, j, n = len(in_start)
cdef np.int_t blockuni, s, e
cdef np.int64_t blockuni, s, e
cdef np.ndarray[np.npy_bool, ndim = 1, cast=True] uni = np.zeros(count, dtype="bool")
cdef np.ndarray[np.int_t, ndim=1] blocks
cdef np.ndarray[np.int64_t, ndim=1] blocks

for i in range(count):
blocks = np.zeros(n, dtype="int")
Expand Down Expand Up @@ -63,10 +63,10 @@ cpdef inline getmeblocks(long[:] astart, long[:] aend, long[:] bstart, long[:] b
# Function take the coordinates and cluster information of all translocated blocks and identifies mutually exclusive
# blocks (candidates with which a given candidate cannot co-exist) by comparing the coordinates of each block to the coordinates of the member blocks in its cluster
logger = logging.getLogger("getmeblocks")
cdef np.ndarray[np.int_t, ndim=1] members, temp
cdef np.ndarray[np.int64_t, ndim=1] members, temp
cdef np.ndarray[np.npy_bool, ndim=1, cast=True] meb, meb_a, meb_b, rem = np.zeros(len(astart), dtype="bool")
cdef int overlap
cdef np.int_t i, j, index
cdef np.int64_t i, j, index
meblock = {} ## for blocks which are overlapping with inplace blocks
melist = {} ## for blocks which are not overlapping with inplace blocks

Expand Down