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

[MRG] "Overload" cython consume methods with type introspection #1787

Merged
merged 8 commits into from
Sep 17, 2017
11 changes: 6 additions & 5 deletions khmer/_oxli/graphs.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from libc.stdint cimport uint8_t, uint32_t, uint64_t, uintptr_t

from khmer._oxli.oxli_types cimport *
from khmer._oxli.hashing cimport Kmer, CpKmer, KmerSet, CpKmerFactory, CpKmerIterator
from khmer._oxli.parsing cimport CpReadParser, CpSequence
from khmer._oxli.parsing cimport CpReadParser, CpSequence, FastxParserPtr
from khmer._oxli.legacy_partitioning cimport (CpSubsetPartition, cp_pre_partition_info,
SubsetPartition)
from khmer._oxli.utils cimport oxli_raise_py_error
Expand Down Expand Up @@ -139,15 +139,15 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil:

void consume_seqfile_and_tag[SeqIO](const string &,
unsigned int,
unsigned long long)
unsigned long long)

# Ugly workaround. For some reason, Cython doesn't like *just this*
# templated overload -- it chooses whichever was defined last, breaking
# resolution for either strings of FastxParserPtr. So, we rename it on
# the Cython side and give it a real name substitution for code gen.
void consume_seqfile_and_tag_readparser "consume_seqfile_and_tag" [SeqIO](shared_ptr[CpReadParser[SeqIO]],
unsigned int,
unsigned long long)
unsigned long long)

void consume_sequence_and_tag(const string &,
unsigned long long &)
Expand All @@ -160,7 +160,7 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil:
unsigned int &,
unsigned long long &) except +oxli_raise_py_error

uintptr_t trim_on_stoptags(string)
uintptr_t trim_on_stoptags(string)

unsigned int traverse_from_kmer(CpKmer,
uint32_t,
Expand All @@ -177,7 +177,7 @@ cdef extern from "oxli/hashgraph.hh" namespace "oxli" nogil:
void load_stop_tags(string, bool) except +oxli_raise_py_error
void extract_unique_paths(string, uint32_t, float, vector[string])
void calc_connected_graph_size(CpKmer, uint64_t&, KmerSet&,
const uint64_t, bool)
const uint64_t, bool)
uint32_t kmer_degree(HashIntoType, HashIntoType)
uint32_t kmer_degree(const char *)
void find_high_degree_nodes(const char *, set[HashIntoType] &) const
Expand Down Expand Up @@ -246,6 +246,7 @@ cdef class Hashtable:
cdef HashIntoType sanitize_hash_kmer(self, object kmer) except -1
cdef bytes _valid_sequence(self, str sequence)
cdef CpKmer _build_kmer(self, object kmer) except *
cdef FastxParserPtr _get_parser(self, object parser_or_filename) except *
cdef list _get_raw_tables(self, uint8_t **, vector[uint64_t])


Expand Down
Loading