Skip to content
Snippets Groups Projects
Commit dc7f482f authored by Martin Larralde's avatar Martin Larralde
Browse files

Make classes final and prevent direct instantiation of `Mapper`

parent 0f388a0f
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
# --- C imports --------------------------------------------------------------
cimport cython
cimport libcpp11.chrono
from cython.operator cimport dereference, preincrement, postincrement
from libc.string cimport memcpy
......@@ -231,6 +232,7 @@ cdef class _Parameterized:
return self._param.p_value
@cython.final
cdef class Sketch(_Parameterized):
"""An index computing minimizers over the reference genomes.
"""
......@@ -536,6 +538,7 @@ cdef class Sketch(_Parameterized):
return mapper
@cython.final
cdef class Mapper(_Parameterized):
"""A genome mapper using Murmur3 hashes and k-mers to compute ANI.
"""
......@@ -549,6 +552,9 @@ cdef class Mapper(_Parameterized):
# --- Magic methods ------------------------------------------------------
def __init__(self, *args, **kwargs):
raise TypeError("Mapper cannot be instantiated, use `Sketch.index` instead.")
def __dealloc__(self):
del self._sk
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment