INNER CODE UNIT · Python
set_num_threads
TimoLassmann/kalign · python-kalign/__init__.py:409
def set_num_threads(n: int) -> None:
"""Set the default number of threads for alignment operations."""
global _default_threads
if n < 1:
raise ValueError("Number of threads must be at least 1")
_thread_local.num_threads = n
_default_threads = n
def get_num_threads() -> int:
"""Get the current default number of threads."""
return getattr(_thread_local, "num_threads", _default_threads)
def align_from_file(
input_file: str,
seq_type: Union[str, int] = "auto",
gap_open: Optional[float] = None,