From 7a3da739dfd208d8619990e0b3c2e62a000477bd Mon Sep 17 00:00:00 2001 From: yuanx749 Date: Mon, 12 Feb 2024 12:49:31 +0800 Subject: [PATCH] Clean --- pycdhit/__init__.py | 2 +- pycdhit/_commands.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pycdhit/__init__.py b/pycdhit/__init__.py index 3cae3a9..8503ffa 100644 --- a/pycdhit/__init__.py +++ b/pycdhit/__init__.py @@ -4,7 +4,7 @@ from ._commands import * # noqa: F403 from ._io import * # noqa: F403 -VERSION = "0.11.0" +VERSION = "0.12.0" __all__ = [ # noqa: F405 "CommandBase", diff --git a/pycdhit/_commands.py b/pycdhit/_commands.py index 7eee9b3..35c10dd 100644 --- a/pycdhit/_commands.py +++ b/pycdhit/_commands.py @@ -55,12 +55,13 @@ def _run(command): raise -def _create_function(name: str, env_var: str): +def _create_function(name: str, func_name: str, env_var: str): def function(**kwargs) -> subprocess.CompletedProcess: command = [_format_program(name, os.getenv(env_var))] command.extend(_format_options(kwargs)) return _run(command) + function.__name__ = func_name function.__doc__ = f"""Run command {name}. If environment variable `{env_var}` exists, @@ -82,8 +83,8 @@ def function(**kwargs) -> subprocess.CompletedProcess: return function -for prog, fun in zip(PROGS, functions): - globals()[fun] = _create_function(prog, "CD_HIT_DIR") +for prog, func in zip(PROGS, functions): + globals()[func] = _create_function(prog, func, "CD_HIT_DIR") -for prog, fun in zip(AUXTOOLS, aux_functions): - globals()[fun] = _create_function(prog, "CD_HIT_AUXTOOLS_DIR") +for prog, func in zip(AUXTOOLS, aux_functions): + globals()[func] = _create_function(prog, func, "CD_HIT_AUXTOOLS_DIR")