Skip to content

Tiny Molecules Cause Issues #17

@corinwagen

Description

@corinwagen

I've seen some weird behavior with PRISM Pruner on very small systems. Here's my minimal script:

from prism_pruner.conformer_ensemble import ConformerEnsemble
from prism_pruner.pruner import prune

ensemble = ConformerEnsemble.from_xyz("h2.xyz")

pruned, mask = prune(
    ensemble.coords,
    ensemble.atoms,
    rot_corr_rmsd_pruning=True,
    debugfunction=print,
)

I made some trivial H2 and Ne ensembles for testing purposes:

H2 ensemble

h2.xyz

2
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
H     0.03753493   1.40368284  -0.00029150
H     0.65753493   1.40368284  -0.00029150
2
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
H     0.03753493   1.40368284  -0.00029150
H     0.65753493   1.40368284  -0.00029150
2
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
H     0.03753493   1.40368284  -0.00029150
H     0.65753493   1.40368284  -0.00029150
2
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
H     0.03753493   1.40368284  -0.00029150
H     0.65753493   1.40368284  -0.00029150
2
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
H     0.03753493   1.40368284  -0.00029150
H     0.65753493   1.40368284  -0.00029150
2
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
H     0.03753493   1.40368284  -0.00029150
H     0.65753493   1.40368284  -0.00029150
Ne ensemble

ne.xyz

1
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
Ne    0.03753493   1.40368284  -0.00029150
1
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
Ne    0.03753493   1.40368284  -0.00029150
1
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
Ne    0.03753493   1.40368284  -0.00029150
1
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
Ne    0.03753493   1.40368284  -0.00029150
1
charge: 0; multiplicity: 1; generated_by: Rowan; timestamp: 2026-03-17 13:34:38;
Ne    0.03753493   1.40368284  -0.00029150

When I run these, I get:

$ python h2.py
DEBUG: MOIPrunerConfig - Used cached data 0/5 times, 0.00% of total calls

prism_pruner/prism_pruner/pruner.py:513: RuntimeWarning: Mean of empty slice.
  centered = heavy - heavy.mean(axis=1, keepdims=True)  # (N, M, 3)
prism_pruner/.pixi/envs/dev/lib/python3.14/site-packages/numpy/_core/_methods.py:136: RuntimeWarning: invalid value encountered in divide
  ret = um.true_divide(
prism_pruner/prism_pruner/pruner.py:525: RuntimeWarning: invalid value encountered in divide
  rmsd_sq = (norm_sq[:, None] + norm_sq[None, :] - 2.0 * adjusted_sum_S) / M
DEBUG: RMSDPrunerConfig - rejected 0 (keeping 1/1), in 0.0 s

DEBUG: prune_by_rmsd_rot_corr - No subsymmetrical torsions found: skipping symmetry-corrected RMSD pruning
$ python ne.py
prism_pruner/pruner.py:199: RuntimeWarning: invalid value encountered in scalar divide
  if np.abs(im_1[j] - im_2[j]) / im_1[j] >= self.max_dev:
DEBUG: MOIPrunerConfig - k=1, rejected 4 (keeping 1/5), in 0.0 s
DEBUG: MOIPrunerConfig - keeping 1/5 (0.0 s)
DEBUG: MOIPrunerConfig - Used cached data 0/4 times, 0.00% of total calls

DEBUG: RMSDPrunerConfig - rejected 0 (keeping 1/1), in 0.0 s

DEBUG: prune_by_rmsd_rot_corr - No subsymmetrical torsions found: skipping symmetry-corrected RMSD pruning

It's not the end of the world, but causing a bit of messiness in the logs as we make PRISM Pruner part of scaled workflow computation here. Do you think it'd be worth adding some checks for cases like these?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions