2828
2929@pytest .fixture (scope = "module" )
3030def stripped_gemmi (resources_dir : Path ) -> gemmi .Structure :
31+ """gemmi.Structure with hydrogens, ligands, and waters removed using gemmi methods."""
3132 s = gemmi .read_structure (str (resources_dir / "6b8x" / "6b8x_final.pdb" ))
3233 s .remove_hydrogens ()
3334 s .remove_ligands_and_waters ()
@@ -36,6 +37,8 @@ def stripped_gemmi(resources_dir: Path) -> gemmi.Structure:
3637
3738@pytest .fixture (scope = "module" )
3839def stripped_atom_array (resources_dir : Path ) -> AtomArray :
40+ """AtomArray with hydrogens, waters, and non-polymer/non-amino-acid atoms
41+ removed using existing utils."""
3942 arr = load_structure_with_altlocs (resources_dir / "6b8x" / "6b8x_final.pdb" )
4043 arr = remove_hydrogens (arr )
4144 arr = remove_waters (arr )
@@ -48,12 +51,15 @@ def stripped_atom_array(resources_dir: Path) -> AtomArray:
4851def gemmi_structure_from_atomarray (
4952 stripped_atom_array , stripped_gemmi : gemmi .Structure
5053) -> gemmi .Structure :
54+ """gemmi.Structure converted from the stripped AtomArray."""
5155 return atomarray_to_gemmi (
5256 stripped_atom_array , stripped_gemmi .cell , stripped_gemmi .spacegroup_hm
5357 )
5458
5559
5660def _compute_fprotein (gemmi_structure : gemmi .Structure , device : torch .device ) -> np .ndarray :
61+ """Compute |Fprotein| amplitudes from a gemmi structure via SFcalculator at ``DMIN``
62+ resolution. The final assert_numpy converts any tensor or list to a numpy array."""
5763 sfc = SFcalculator (
5864 PDBParser (gemmi_structure ),
5965 mtzdata = None ,
0 commit comments