diff --git a/pixi.lock b/pixi.lock index 0f3d998..10ff3c6 100644 --- a/pixi.lock +++ b/pixi.lock @@ -582,8 +582,8 @@ packages: timestamp: 1759948672799 - pypi: ./ name: autoio - version: 2025.10.2 - sha256: 3f634db95d830ccba4294985049f1b752e7f7cfe50f8cd8b43ee0359a98be061 + version: 2025.11.0 + sha256: ff80070e26545c913d5bc7e0431f6a4cb195414a0ffd049725ac32ca97063e43 requires_python: '>=3.11' editable: true - conda: https://conda.anaconda.org/conda-forge/linux-64/brotli-1.1.0-hb03c661_4.conda diff --git a/pyproject.toml b/pyproject.toml index 4fe73b7..428856c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "autoio" -version = "2025.10.2" +version = "2025.11.0" description = "I/O interfaces for external codes used by AutoMech" readme = "README.md" dependencies = [] diff --git a/src/projrot_io/util.py b/src/projrot_io/util.py index 97e2853..43bb5c2 100644 --- a/src/projrot_io/util.py +++ b/src/projrot_io/util.py @@ -66,16 +66,16 @@ def _format_grad_str(geo, grad): :type grads: list :rtype: str """ - atom_list = [] for i, (sym, _) in enumerate(geo): atom_list.append(int(ptab.to_number(sym))) # Format the strings for the xyz gradients full_grads_str = '' - for i, grads in enumerate(grad): - grads_str = f'{grads[0]:>14.8f}{grads[1]:>14.8f}{grads[2]:>14.8f}' - full_grads_str += f'{i+1:2d}{atom_list[i]:4d}{grads_str}\n' + if grad: + for i, grads in enumerate(grad): + grads_str = f'{grads[0]:>14.8f}{grads[1]:>14.8f}{grads[2]:>14.8f}' + full_grads_str += f'{i+1:2d}{atom_list[i]:4d}{grads_str}\n' return remove_trail_whitespace(full_grads_str)