Skip to content

Commit 4ddbe42

Browse files
committed
perf(conformations): remove fallback on module option
1 parent 3d38aef commit 4ddbe42

2 files changed

Lines changed: 5 additions & 20 deletions

File tree

‎CodeEntropy/levels/dihedrals/topology.py‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,12 @@ def _extract_topology_fragment(self, data_container: Any, molecule_id: Any) -> A
101101
molecule_id: Fragment index identifying the molecule to extract.
102102
103103
Returns:
104-
MDAnalysis AtomGroup for the selected molecule when lightweight
105-
extraction is available; otherwise, the fallback fragment object
106-
returned by ``extract_fragment``.
104+
MDAnalysis AtomGroup for the selected molecule
107105
"""
108-
if hasattr(self._universe_operations, "extract_fragment_atomgroup"):
109-
return self._universe_operations.extract_fragment_atomgroup(
110-
data_container,
111-
int(molecule_id),
112-
)
113-
114-
return self._universe_operations.extract_fragment(data_container, molecule_id)
106+
return self._universe_operations.extract_fragment_atomgroup(
107+
data_container,
108+
int(molecule_id),
109+
)
115110

116111
def _select_heavy_residue(self, mol: Any, res_id: int) -> Any:
117112
"""Select heavy atoms in a residue by residue index.

‎tests/unit/CodeEntropy/levels/dihedrals/test_topology.py‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,6 @@ def test_extract_topology_fragment_uses_lightweight_atomgroup_helper() -> None:
147147
universe_operations.extract_fragment.assert_not_called()
148148

149149

150-
def test_extract_topology_fragment_falls_back_to_existing_extract_fragment() -> None:
151-
class LegacyUniverseOperations:
152-
def extract_fragment(self, data_container: Any, molecule_id: Any) -> str:
153-
return f"fragment-{data_container}-{molecule_id}"
154-
155-
discovery = _make_discovery(LegacyUniverseOperations())
156-
157-
assert discovery._extract_topology_fragment("universe", 2) == "fragment-universe-2"
158-
159-
160150
def test_select_heavy_residue_builds_expected_selections() -> None:
161151
discovery = _make_discovery()
162152

0 commit comments

Comments
 (0)