From 0f939af31ab766e0263ff78222fdd75a04cd488e Mon Sep 17 00:00:00 2001 From: yuanx749 Date: Tue, 28 May 2024 19:57:31 +0800 Subject: [PATCH] Add and clean --- pycdhit/__init__.py | 2 +- pycdhit/_class.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pycdhit/__init__.py b/pycdhit/__init__.py index 8503ffa..10884a7 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.12.0" +VERSION = "0.13.0" __all__ = [ # noqa: F405 "CommandBase", diff --git a/pycdhit/_class.py b/pycdhit/_class.py index 1676044..1982c60 100644 --- a/pycdhit/_class.py +++ b/pycdhit/_class.py @@ -80,11 +80,17 @@ class CDHIT(CommandBase): """ + _progs = { + "cd-hit", + "cd-hit-2d", + "cd-hit-est", + "cd-hit-est-2d", + "cd-hit-454", + } + def __init__(self, prog: str = "cd-hit", path: str = None): - if prog not in {"cd-hit", "cd-hit-2d", "cd-hit-est", "cd-hit-est-2d"}: - raise ValueError( - f"'{prog}' not in {{'cd-hit', 'cd-hit-2d', 'cd-hit-est', 'cd-hit-est-2d'}}" # noqa: E501 - ) + if prog not in self._progs: + raise ValueError(f"'{prog}' not in {self._progs}") super().__init__(prog, path) def help(self):