From 26c72eb80172b4d312b5540e325115b63f62e656 Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Wed, 1 Apr 2026 23:10:12 +0800 Subject: [PATCH 1/2] fix: correct DT5 patch applyto from 'T' to 'DT' in PATCHES.xml Fixes #456 --- pdb2pqr/dat/PATCHES.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdb2pqr/dat/PATCHES.xml b/pdb2pqr/dat/PATCHES.xml index 2069701c..4cd04c86 100644 --- a/pdb2pqr/dat/PATCHES.xml +++ b/pdb2pqr/dat/PATCHES.xml @@ -579,7 +579,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE. DT5 - T + DT O1P P O2P From 25074830efb63a35a0b0d26e3b9ee361c2ee3604 Mon Sep 17 00:00:00 2001 From: nightcityblade Date: Wed, 8 Apr 2026 11:07:35 +0800 Subject: [PATCH 2/2] test: cover DT5 patch reference residue --- tests/patches_test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/patches_test.py diff --git a/tests/patches_test.py b/tests/patches_test.py new file mode 100644 index 00000000..5c2341d0 --- /dev/null +++ b/tests/patches_test.py @@ -0,0 +1,20 @@ +from pathlib import Path + +from pdb2pqr.definitions import Definition + + +def test_dt5_patch_applies_to_dt_reference() -> None: + dat_dir = Path(__file__).resolve().parents[1] / "pdb2pqr" / "dat" + + with ( + (dat_dir / "AA.xml").open() as aa_file, + (dat_dir / "NA.xml").open() as na_file, + (dat_dir / "PATCHES.xml").open() as patch_file, + ): + definition = Definition(aa_file, na_file, patch_file) + + assert "DT" in definition.map + assert "DT5" in definition.map + assert "P" not in definition.map["DT5"].map + assert "O1P" not in definition.map["DT5"].map + assert "H5T" in definition.map["DT5"].map