MDFactoryMDFactory

test_topology_utilities

Tests for topology utility functions including CGenFF topology parsing and mol2 generation.

attributecgenff_dir
= settings.cgenff_dir
attributecgenff_available
= cgenff_dir.exists() and (cgenff_dir / 'cgenff' / 'cgenff_batch.sh').exists()
attributeMOL2_REFERENCES
= Path(__file__).parent / 'testfiles' / 'mol2_references.json'
func_load_mol2_references()

Returns

None
func_extract_atom_types(mol2_str)

Extract Sybyl atom types from a mol2 string.

parammol2_str

Returns

None
func_extract_bond_types(mol2_str)

Extract Tripos bond types from a mol2 string.

parammol2_str

Returns

None
func_mol2_reference_ids(*, lipids_only=False, exclude_lipids=False)

Return list of (name, smiles, ref_mol2) from mol2_references.json.

paramlipids_only
= False
paramexclude_lipids
= False

Returns

None
func_assert_mol2_matches_reference(tmp_path, name, smiles, ref_mol2)

Shared assertion logic for mol2 reference tests.

paramtmp_path
paramname
paramsmiles
paramref_mol2

Returns

None
functest_write_mol2_from_rdkit(tmp_path, name, smiles, ref_mol2)

Test mol2 writer against 30 hand-picked reference molecules.

paramtmp_path
paramname
paramsmiles
paramref_mol2

Returns

None
functest_write_mol2_from_rdkit_lipids(tmp_path, name, smiles, ref_mol2)

Test mol2 writer against ~100 diverse lipids. Use pytest -m slow -n auto.

paramtmp_path
paramname
paramsmiles
paramref_mol2

Returns

None
functest_write_mol2_from_rdkit_no_conformer(tmp_path)

Test that write_mol2_from_rdkit raises ValueError when molecule has no conformers.

paramtmp_path

Returns

None
functest_extract_reusable_parts_from_cgenff_gmx_top(tmp_path)
paramtmp_path

Returns

None
functest_count_contiguous_strings()

Returns

None
functest_run_cgenff_to_gmx(tmp_path)
paramtmp_path

Returns

None
functest_sybyl_atom_types_positional()

Test _get_sybyl_atom_type positionally on small hand-built molecules.

Returns

None
functest_oco2_carboxylate_partner()

Test that both oxygens in a carboxylate get O.co2.

The charged oxygen matches via formal charge, the neutral one via partner logic.

Returns

None