55curr_dir = os .path .dirname (os .path .abspath (__file__ ))
66
77
8- def _test_autoSegment2_deprecated_shim ():
8+ def test_autoSegment2_deprecated_shim ():
99 import warnings
1010 from moleculekit .molecule import Molecule
1111 from moleculekit .tools .autosegment import autoSegment , autoSegment2
@@ -26,7 +26,7 @@ def _test_autoSegment2_deprecated_shim():
2626 assert np .array_equal (shim .chain , ref .chain )
2727
2828
29- def _test_autoSegment_classify ():
29+ def test_autoSegment_classify ():
3030 from moleculekit .molecule import Molecule
3131 from moleculekit .tools .autosegment import _classify_residues
3232
@@ -41,7 +41,7 @@ def _test_autoSegment_classify():
4141 assert "nucleic" not in cats
4242
4343
44- def _test_autoSegment_linked ():
44+ def test_autoSegment_linked ():
4545 from moleculekit .molecule import Molecule
4646 from moleculekit .tools .autosegment import _polymer_linked , _classify_residues
4747
@@ -66,7 +66,7 @@ def _test_autoSegment_linked():
6666 assert np .mean (linked ) > 0.95
6767
6868
69- def _test_autoSegment_1aud_continuous ():
69+ def test_autoSegment_1aud_continuous ():
7070 from os import path
7171 from moleculekit .molecule import Molecule
7272 from moleculekit .tools .autosegment import autoSegment
@@ -78,14 +78,14 @@ def _test_autoSegment_1aud_continuous():
7878 assert len (rna_segids ) == 1 , f"expected 1 RNA segment, got { rna_segids } "
7979
8080
81- def _test_autoSegment_3ptb_buckets ():
81+ def test_autoSegment_3ptb_buckets ():
8282 from moleculekit .molecule import Molecule
8383 from moleculekit .tools .autosegment import autoSegment
8484
8585 mol = Molecule ("3ptb" )
8686 out = autoSegment (mol , fields = ("chain" , "segid" ))
8787
88- # Same index ranges as the existing _test_autosegment_detailed
88+ # Same index ranges as the existing test_autosegment_detailed
8989 prot_idx = np .arange (1629 )
9090 ca_idx = np .array ([1629 ])
9191 ben_idx = np .arange (1630 , 1639 )
@@ -109,7 +109,7 @@ def _test_autoSegment_3ptb_buckets():
109109 assert len (set (groups )) == 4
110110
111111
112- def _test_autoSegment_system_matrix ():
112+ def test_autoSegment_system_matrix ():
113113 from os import path
114114 from moleculekit .molecule import Molecule
115115 from moleculekit .tools .autosegment import autoSegment
@@ -132,7 +132,7 @@ def _test_autoSegment_system_matrix():
132132 assert got == n , f"{ pid } : expected { n } segments, got { got } "
133133
134134
135- def _test_autoSegment_chain_change_splits ():
135+ def test_autoSegment_chain_change_splits ():
136136 from moleculekit .molecule import Molecule
137137 from moleculekit .tools .autosegment import autoSegment
138138
@@ -148,7 +148,7 @@ def _test_autoSegment_chain_change_splits():
148148 assert len (set (out .segid [prot_idx ])) >= 2
149149
150150
151- def _test_autoSegment_single_other_segment ():
151+ def test_autoSegment_single_other_segment ():
152152 from os import path
153153 from moleculekit .molecule import Molecule
154154 from moleculekit .tools .autosegment import autoSegment , _classify_residues
@@ -172,7 +172,7 @@ def _test_autoSegment_single_other_segment():
172172 assert merged .segid [other_atoms ][0 ] not in set (merged .segid [non_other ])
173173
174174
175- def _test_autoSegment_gfp_chromophore ():
175+ def test_autoSegment_gfp_chromophore ():
176176 # 1gfl: the GFP chromophore residue 65 (SER) is missing its backbone O, so
177177 # the standard "backbone" selection drops it. autoSegment classifies it by
178178 # N/CA/C presence and keeps each chain continuous through it.
@@ -191,7 +191,7 @@ def _test_autoSegment_gfp_chromophore():
191191 assert before [0 ] == after [0 ], f"chromophore split chain { ch } "
192192
193193
194- def _test_autoSegment_missing_carbonyl_continuity ():
194+ def test_autoSegment_missing_carbonyl_continuity ():
195195 # 1hgu: residues 148/151 are missing their carbonyl O (AS2 over-splits there),
196196 # while 37-39 are a genuine missing loop. autoSegment stays continuous through
197197 # the missing-O residues but splits at the real gap.
@@ -213,7 +213,7 @@ def seg(rid):
213213 assert seg (36 ) != seg (40 )
214214
215215
216- def _test_autoSegment_heavy_water_dod ():
216+ def test_autoSegment_heavy_water_dod ():
217217 # 2mb5 is a neutron structure with 89 DOD (D2O) residues. With DOD recognized
218218 # as water they collapse into a single water segment instead of 89 'other' ones.
219219 from os import path
@@ -227,7 +227,7 @@ def _test_autoSegment_heavy_water_dod():
227227 assert len (set (out .segid [dod ])) == 1
228228
229229
230- def _test_autoSegment_glycan_tree ():
230+ def test_autoSegment_glycan_tree ():
231231 # 3gbn: an N-linked glycan tree (NAG-NAG-BMA-MAN) must stay together as one
232232 # connected-component 'other' segment, separate from isolated small molecules.
233233 from os import path
@@ -249,7 +249,7 @@ def _test_autoSegment_glycan_tree():
249249 assert len (multi [0 ]) >= 3
250250
251251
252- def _test_autoSegment_5mat_internal_gaps ():
252+ def test_autoSegment_5mat_internal_gaps ():
253253 # 5MAT (renin) has two protein chains (A, C), each with a real missing-loop
254254 # gap, so autoSegment yields 4 polymer segments. The gaps are detected by
255255 # backbone distance (C-N 4.4 A in chain A, 10.4 A in chain C), not resids.
0 commit comments