From b2fce6457228d21d53730646aaa605f49d8a331d Mon Sep 17 00:00:00 2001 From: Fanwang Meng Date: Tue, 17 Dec 2024 13:35:45 -0500 Subject: [PATCH] Treat Gaussian log and input files as special cases --- iodata/api.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/iodata/api.py b/iodata/api.py index 0e6b4e8d..784d6a82 100644 --- a/iodata/api.py +++ b/iodata/api.py @@ -46,9 +46,15 @@ def _find_format_modules(): for module_info in iter_modules(import_module("iodata.formats").__path__): if not module_info.ispkg: format_module = import_module("iodata.formats." + module_info.name) + # TODO: there should be more robust way to find out the module name if hasattr(format_module, "PATTERNS"): - for pattern in format_module.PATTERNS: - result[pattern.replace("*.", "")] = format_module + if module_info.name == "gaussianinput": + result["com"] = format_module + result["gjf"] = format_module + elif module_info.name == "gaussianlog": + result["log"] = format_module + else: + result[module_info.name] = format_module return result