Skip to content

Commit

Permalink
Improve detection of in and out formats.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmcezar committed Dec 26, 2024
1 parent f838ff2 commit 43d635a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 131 deletions.
2 changes: 1 addition & 1 deletion clusttraj/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .main import main

__version__ = "0.3.0"
__version__ = "0.3.1"

__all__ = [
"main",
Expand Down
136 changes: 6 additions & 130 deletions clusttraj/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ def configure_runtime(args_in: List[str]) -> ClustOptions:
Logger.setup(args.log)

# check input consistency
if os.path.splitext(args.trajectory_file)[1][1:] not in pybel.informats.keys():
parser.error(
f"The trajectory file format ({os.path.splitext(args.trajectory_file)[1][1:]}) is not supported."
)

if args.method not in [
"single",
"complete",
Expand All @@ -402,136 +407,7 @@ def configure_runtime(args_in: List[str]) -> ClustOptions:
)

if args.clusters_configurations:
if args.clusters_configurations not in [
"acr",
"adf",
"adfout",
"alc",
"arc",
"bgf",
"box",
"bs",
"c3d1",
"c3d2",
"cac",
"caccrt",
"cache",
"cacint",
"can",
"car",
"ccc",
"cdx",
"cdxml",
"cht",
"cif",
"ck",
"cml",
"cmlr",
"com",
"copy",
"crk2d",
"crk3d",
"csr",
"cssr",
"ct",
"cub",
"cube",
"dmol",
"dx",
"ent",
"fa",
"fasta",
"fch",
"fchk",
"fck",
"feat",
"fh",
"fix",
"fpt",
"fract",
"fs",
"fsa",
"g03",
"g92",
"g94",
"g98",
"gal",
"gam",
"gamin",
"gamout",
"gau",
"gjc",
"gjf",
"gpr",
"gr96",
"gukin",
"gukout",
"gzmat",
"hin",
"inchi",
"inp",
"ins",
"jin",
"jout",
"mcdl",
"mcif",
"mdl",
"ml2",
"mmcif",
"mmd",
"mmod",
"mol",
"mol2",
"molden",
"molreport",
"moo",
"mop",
"mopcrt",
"mopin",
"mopout",
"mpc",
"mpd",
"mpqc",
"mpqcin",
"msi",
"msms",
"nw",
"nwo",
"outmol",
"pc",
"pcm",
"pdb",
"png",
"pov",
"pqr",
"pqs",
"prep",
"qcin",
"qcout",
"report",
"res",
"rsmi",
"rxn",
"sd",
"sdf",
"smi",
"smiles",
"sy2",
"t41",
"tdd",
"test",
"therm",
"tmol",
"txt",
"txyz",
"unixyz",
"vmol",
"xed",
"xml",
"xyz",
"yob",
"zin",
]:
if args.clusters_configurations not in pybel.outformats.keys():
parser.error(
f"The format you selected to save the clustered superposed configurations ({args.clusters_configurations}) is not valid."
)
Expand Down

0 comments on commit 43d635a

Please sign in to comment.