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

Making package compatible with language_level=3 #10

Open
wants to merge 7 commits 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 phasedibd/compressed_haplotype_alignment.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from libc.stdint cimport uint8_t, uint16_t, uint32_t
from libc.stdio cimport *
from haplotype_alignment cimport HaplotypeAlignment
from .haplotype_alignment cimport HaplotypeAlignment


cdef class CompressedHaplotypeAlignment(HaplotypeAlignment):
Expand Down
6 changes: 3 additions & 3 deletions phasedibd/templated_pbwt_analysis.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

from libc.stdio cimport *
from haplotype_alignment cimport HaplotypeAlignment
from compressed_haplotype_alignment cimport CompressedHaplotypeAlignment
from vcf_haplotype_alignment cimport VcfHaplotypeAlignment
from .haplotype_alignment cimport HaplotypeAlignment
from .compressed_haplotype_alignment cimport CompressedHaplotypeAlignment
from .vcf_haplotype_alignment cimport VcfHaplotypeAlignment
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t


Expand Down
4 changes: 2 additions & 2 deletions phasedibd/templated_pbwt_analysis.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ cdef class TPBWT:
free(self.segments_end_bp)
cdef uint32_t num_cols
if self.current_matches_start != NULL:
num_cols = sizeof(self.current_matches_start)/sizeof(self.current_matches_start[0])
num_cols = sizeof(self.current_matches_start)//sizeof(self.current_matches_start[0])
for i in xrange(num_cols):
free(self.current_matches_start[i])
free(self.current_matches_end[i])
Expand Down Expand Up @@ -162,7 +162,7 @@ cdef class TPBWT:

# first free any already allocated memory
if self.current_matches_start != NULL:
num_rows = sizeof(self.current_matches_start)/sizeof(self.current_matches_start[0])
num_rows = sizeof(self.current_matches_start)//sizeof(self.current_matches_start[0])
for i in xrange(num_rows):
free(self.current_matches_start[i])
free(self.current_matches_end[i])
Expand Down
2 changes: 1 addition & 1 deletion phasedibd/vcf_haplotype_alignment.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ from libc.stdint cimport uint8_t, uint32_t
from libc.stdio cimport *
from libc.stdlib cimport *
from libc.string cimport *
from haplotype_alignment cimport HaplotypeAlignment
from .haplotype_alignment cimport HaplotypeAlignment


cdef class VcfHaplotypeAlignment(HaplotypeAlignment):
Expand Down
2 changes: 1 addition & 1 deletion phasedibd/vcf_haplotype_alignment.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# cython: profile=True

from libc.stdlib cimport malloc, free
from haplotype_alignment cimport HaplotypeAlignment
from .haplotype_alignment cimport HaplotypeAlignment
import numpy as np
cimport numpy as np
import pandas as pd
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pandas==1.2.3
numpy==1.20.2
cython==0.29.23
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
packages=[name],
include_package_data=True,
url='https://github.com/23andme/' + name,
ext_modules=cythonize([Extension('phasedibd.*', ['phasedibd/*.pyx'], include_dirs=[np.get_include()])]),
ext_modules=cythonize([Extension('phasedibd.*', ['phasedibd/*.pyx'], include_dirs=[np.get_include()])], language_level="3"),
include_dirs=[np.get_include()]
)