tests package

Submodules

tests.conftest module

tests.test_GaussianGenECP module

class tests.test_GaussianGenECP.TestGaussianGenGenECP[source]

Bases: object

test_gen_fallback_when_heavy_element_does_not_require_ecp(caplog)[source]
test_genecp_fallback_when_basis_missing_from_bse(caplog)[source]
test_genecp_from_base_api(tmpdir, reference_genecp_txt_file_from_api)[source]
test_genecp_from_base_api_accepts_hyphenless_def2_heavy_basis()[source]
test_genecp_from_comfile(tmpdir, gaussian_opt_genecp_inputfile, genecp_txt_file_from_web)[source]
test_genecp_from_modred_gen_comfile(tmpdir, modred_gen_inputfile, gen_txt_file_from_web)[source]
test_genecp_from_modred_genecp_comfile(modred_genecp_inputfile)[source]
test_genecp_from_modred_genecp_solvent_comfile(modred_genecp_custom_solvent_inputfile)[source]
class tests.test_GaussianGenECP.TestGenECPReplacementInRoute[source]

Bases: object

Test that gen/genecp replacement in route strings doesn’t affect other keywords.

test_gen_replacement_does_not_affect_noeigentest()[source]

Test that ‘gen’ in ‘noeigentest’ is not replaced, and case mode behaves correctly.

test_gen_to_genecp_replacement()[source]

Test replacing ‘gen’ with ‘genecp’ in route strings for both case modes.

test_genecp_replacement_does_not_affect_other_keywords()[source]

Test that ‘genecp’ replacement works correctly in both case modes.

test_replacement_with_various_delimiters()[source]

Test that replacement works correctly with various delimiters, in both case modes.

class tests.test_GaussianGenECP.TestGenGenECPBasisDetermination[source]

Bases: object

Test automatic determination of gen vs genecp basis keywords based on elements present.

test_determine_basis_keyword_mixed_elements()[source]

Test molecule with both gen and genecp elements uses genecp.

test_determine_basis_keyword_no_heavy_elements()[source]

Test that molecules with no heavy elements use light elements basis.

test_determine_basis_keyword_non_gen_basis()[source]

Test that non-gen/genecp basis keywords are returned unchanged.

test_determine_basis_keyword_with_br()[source]

Test that molecules with only Br use ‘gen’ instead of ‘genecp’.

test_determine_basis_keyword_with_i()[source]

Test that molecules with I use ‘genecp’.

test_determine_basis_keyword_with_pd()[source]

Test that molecules with Pd use ‘genecp’.

test_periodic_table_requires_ecp()[source]

Test that requires_ecp correctly identifies elements needing ECPs.

tests.test_GaussianIO module

class tests.test_GaussianIO.TestGaussian16Input[source]

Bases: object

test_oniom_charge_multiplicity(gaussian_qmmm_inputfile_3layer)[source]
test_oniom_charge_multiplicity_2layer(gaussian_qmmm_inputfile_2layer)[source]
test_oniom_connectivity_only_has_no_mm_parameters(gaussian_qmmm_inputfile_2layer)[source]
test_oniom_freeze_flags_are_preserved(tmp_path)[source]
test_oniom_mm_parameters_empty_parts_and_groups()[source]

Cover empty groups/lines and non-float connectivity tokens.

test_oniom_mm_parameters_extracted_after_connectivity(tmp_path)[source]
test_oniom_mm_parameters_skips_empty_and_non_mm_groups(tmp_path)[source]
test_oniom_model_charge_defaults_when_absent(tmp_path)[source]

Fallback when model charge/mult keys are missing from the ONIOM dict.

test_oniom_negative_charge_line(tmp_path)[source]
test_oniom_partition_recursion_error_is_tolerated(tmp_path)[source]
test_oniom_route_without_layer_labels_returns_plain_molecule(tmp_path)[source]
test_oniom_single_pair_charge_defaults_model(tmp_path)[source]
test_oniom_three_layer_full_charge_line_maps_model(tmp_path)[source]
test_oniom_three_layer_short_charge_line(tmp_path)[source]
test_partition(gaussian_qmmm_inputfile_2layer)[source]
test_pbc_1d_input(gaussian_pbc_1d_inputfile)[source]
test_read_frozen_coords(gaussian_frozen_opt_inputfile)[source]
test_read_gaussian_input(gaussian_opt_inputfile)[source]
test_read_genecp_inputfile(gaussian_opt_genecp_inputfile)[source]
test_read_modred_inputfile(gaussian_modred_inputfile)[source]
test_read_scan_inputfile(gaussian_scan_inputfile)[source]
class tests.test_GaussianIO.TestGaussian16Output[source]

Bases: object

test_contribution_percentage_spin_scaling()[source]
test_custom_solvent_smd_generic(gaussian_smd_generic_outfile)[source]
test_energy_extraction_from_gaussian_output_file(gaussian_quintet_opt_outfile)[source]
test_normal_termination_semiempirical_pm6_output_file(gaussian_semiempirical_pm6_output_file)[source]
test_normal_termination_with_forces_and_frequencies(td_outputfile)[source]
test_normal_termination_with_trailing_blank_lines(gaussian_ts_genecp_outfile, tmp_path)[source]
test_oldform_redundant_coordinates_atomic_numbers(tmp_path)[source]
test_pd_insertion_ts_r_logfile(gaussian_pd_insertion_ts_r_outfile)[source]
test_quintet_opt_output(gaussian_quintet_opt_outfile)[source]
test_read_frozen_opt_outputfile(gaussian_frozen_opt_outfile)[source]
test_read_full_gen_outputfile(gaussian_full_gen_outfile)[source]
test_read_full_genecp_outputfile(gaussian_full_genecp_outfile)[source]
test_read_genecp_outputfile(gaussian_ts_genecp_outfile)[source]
test_read_hirshfeld_charges_outputfile(gaussian_hirshfeld_outfile)[source]
test_read_hirshfeld_rc_charges_outputfile(gaussian_rc_hirshfeld_outfile)[source]
test_read_modred_outputfile(gaussian_failed_modred_outfile)[source]
test_read_mp2_outputfile(gaussian_mp2_outputfile)[source]
test_read_oniom_outputfile(gaussian_oniom_outputfile)[source]
test_read_scan_outputfile(gaussian_failed_scan_outfile)[source]
test_singlet_opt_output(gaussian_singlet_opt_outfile)[source]
test_triplet_opt_output(gaussian_triplet_opt_outfile)[source]
class tests.test_GaussianIO.TestGaussian16pKaOutput[source]

Bases: object

Tests for Gaussian16pKaOutput class for pKa thermochemistry calculations.

Reference values are from .dat files in tests/data/GaussianTests/outputs/ Generated at T=373.15K, c=1.0 mol/L, csg=100 cm^-1, ch=100 cm^-1

5PQ_Me_ts1_no_pd_opt.dat values (HA - protonated acid):

E = -345.741944 hartree ZPE = 0.133804 hartree H = -345.595097 hartree qh-H = -345.596472 hartree T.S = 0.053929 hartree T.qh-S = 0.052278 hartree G(T) = -345.649026 hartree qh-G(T) = -345.648751 hartree

5PQ_Me_ts1_b_no_pd_opt.dat values (A- - conjugate base):

E = -344.915399 hartree ZPE = 0.115987 hartree H = -344.786580 hartree qh-H = -344.787739 hartree T.S = 0.052926 hartree T.qh-S = 0.051766 hartree G(T) = -344.839506 hartree qh-G(T) = -344.839505 hartree

A_E = -344.915399
A_G = -344.839506
A_H = -344.78658
A_QH_G = -344.839505
A_QH_H = -344.787739
A_QH_TS = 0.051766
A_TS = 0.052926
A_ZPE = 0.115987
HA_E = -345.741944
HA_G = -345.649026
HA_H = -345.595097
HA_QH_G = -345.648751
HA_QH_H = -345.596472
HA_QH_TS = 0.052278
HA_TS = 0.053929
HA_ZPE = 0.133804
PKA_COLLIDINE_REFERENCE = 6.75
test_compute_pka(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile, gaussian_pKa_HB_optimization_outputfile, gaussian_pKa_B_optimization_outputfile, gaussian_pKa_HA_single_point_outputfile, gaussian_pKa_A_single_point_outputfile, gaussian_pKa_HB_single_point_outputfile, gaussian_pKa_B_single_point_outputfile)[source]

Test pKa calculation using Dual-level Proton Exchange scheme.

Uses 5PQ_Me_ts1 as target acid (HA/A-) and collidine as reference (HB/B-). Reference pKa of collidine = 6.75

The dual-level approach uses: 1. Gas-phase frequency calculations for thermal corrections (G_corr) 2. Solvent single-point calculations for E_solv 3. G_soln = E_solv + G_corr for solution free energy (in Hartree/au) 4. Proton exchange scheme: HA + B⁻ → A⁻ + HB

test_compute_pka_direct_scheme(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile, gaussian_pKa_HA_single_point_outputfile, gaussian_pKa_A_single_point_outputfile)[source]

Test direct dissociation via unified compute_pka(scheme=’direct’).

test_compute_pka_energy_values(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile, gaussian_pKa_HB_optimization_outputfile, gaussian_pKa_B_optimization_outputfile, gaussian_pKa_HA_single_point_outputfile, gaussian_pKa_A_single_point_outputfile, gaussian_pKa_HB_single_point_outputfile, gaussian_pKa_B_single_point_outputfile)[source]

Test that dual-level calculation uses correct energy values.

All energies are in Hartree (au) except ΔG_soln which is also provided in kcal/mol for the pKa formula.

Verifies: - E_solv values from solvent SP files (Hartree) - G_corr = qh-G(T) - E_gas from gas-phase files (Hartree) - G_soln = E_solv + G_corr (Hartree) - ΔG_soln in both au and kcal/mol

test_compute_pka_thermochemistry_ha_and_a(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile)[source]

Test compute_pka_thermochemistry with exact reference values.

test_compute_thermochemistry_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test compute_thermochemistry returns all values for HA.

test_deprotonation_energy_difference(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile)[source]

Test that deprotonation energy difference is calculated correctly.

ΔE = E(A-) - E(HA) should be positive (deprotonation is endothermic) Δqh-G = qh-G(A-) - qh-G(HA) should also be positive

test_electronic_energy_a(gaussian_pKa_A_optimization_outputfile)[source]

Test electronic energy for A- matches reference value.

test_electronic_energy_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test electronic energy for HA matches reference value.

test_energy_units_conversion_kcal_mol(gaussian_pKa_HA_optimization_outputfile)[source]

Test energy conversion to kcal/mol.

test_energy_units_conversion_kj_mol(gaussian_pKa_HA_optimization_outputfile)[source]

Test energy conversion to kJ/mol.

test_enthalpy_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test enthalpy for HA matches reference value.

test_gibbs_free_energy_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test G(T) for HA matches reference value.

test_init_with_custom_settings(gaussian_pKa_HA_optimization_outputfile)[source]

Test initialization with custom thermochemistry settings.

test_init_with_default_settings(gaussian_pKa_HA_optimization_outputfile)[source]

Test initialization with default thermochemistry settings.

test_print_pka_summary(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile, gaussian_pKa_HB_optimization_outputfile, gaussian_pKa_B_optimization_outputfile, gaussian_pKa_HA_single_point_outputfile, gaussian_pKa_A_single_point_outputfile, gaussian_pKa_HB_single_point_outputfile, gaussian_pKa_B_single_point_outputfile, capsys)[source]

Test that print_pka_summary outputs correct format.

All energies should be displayed in Hartree (au) except ΔG_soln which is shown in both au and kcal/mol.

test_print_pka_thermochemistry_summary(gaussian_pKa_HA_optimization_outputfile, gaussian_pKa_A_optimization_outputfile, capsys)[source]

Test thermochemistry output for pKa calculation shows correct values.

This test verifies that individual thermochemistry values can be extracted from the output objects for HA and A- species.

test_qh_enthalpy_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test qh-H for HA matches reference value.

test_qh_gibbs_free_energy_a(gaussian_pKa_A_optimization_outputfile)[source]

Test qh-G(T) for A- matches reference value.

test_qh_gibbs_free_energy_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test qh-G(T) for HA matches reference value.

test_thermochemistry_property_caching(gaussian_pKa_HA_optimization_outputfile)[source]

Test that thermochemistry object is cached.

test_zero_point_energy_ha(gaussian_pKa_HA_optimization_outputfile)[source]

Test ZPE for HA matches reference value.

class tests.test_GaussianIO.TestGaussianCubeFile[source]

Bases: object

test_read_file_content(spin_cube_file)[source]
class tests.test_GaussianIO.TestGaussianPBCOutputFile[source]

Bases: object

test_read_2d_pbc_output(gaussian_pbc_2d_outputfile)[source]
class tests.test_GaussianIO.TestGaussianWBIOutput[source]

Bases: object

test_molecules(gaussian_benzene_opt_outfile)[source]
test_normal_termination_with_forces_and_frequencies(wbi_outputfile)[source]
class tests.test_GaussianIO.TestRouteString[source]

Bases: object

test_read_additional_route_parameters()[source]
test_read_route_semiempirical()[source]
test_read_route_string_nonstandard()[source]
test_read_route_string_oniom_layer_methods_and_bases()[source]
test_read_route_string_opt_options()[source]
test_read_route_string_standard()[source]
test_read_route_string_standard2()[source]
test_read_route_string_standard3a()[source]
test_read_route_string_standard3b()[source]
test_read_route_string_standard4()[source]
test_read_route_string_standard5()[source]
test_read_route_string_standard6()[source]
test_read_route_string_standard7()[source]
test_solvent_in_route()[source]

tests.test_GaussianSettings module

class tests.test_GaussianSettings.TestGaussianJobFromComFile[source]

Bases: object

test_cli_group_remove_solvent_overrides_project_settings(gaussian_yaml_settings_gas_solv_project_name)[source]

--remove-solvent at the gaussian group level clears project solvent.

This simulates: gaussian --remove-solvent sp when the project’s solvent-phase sp settings carry a solvent model.

test_cli_group_solvent_options_propagate_to_opt(gaussian_yaml_settings_gas_solv_project_name)[source]

Solvent options given at the gaussian group level propagate to opt settings.

This simulates: gaussian -sm smd -si water -so iterative opt where the solvent options live on the group command and are merged into the subcommand settings via GaussianJobSettings.merge().

test_cli_group_solvent_options_propagate_to_td()[source]

Solvent options given at the gaussian group level propagate to td settings.

This simulates: gaussian -sm smd -si water -so iterative td

test_include_solvent(gaussian_opt_inputfile, tmpdir)[source]
test_reads_com_file(gaussian_opt_inputfile)[source]
test_update_solvent(gaussian_opt_inputfile, tmpdir)[source]
class tests.test_GaussianSettings.TestGaussianJobFromLogFile[source]

Bases: object

test_accumulates_settings(tmpdir, gaussian_ts_genecp_outfile)[source]
test_reads_gaussian_pm6_outfile(tmpdir, gaussian_semiempirical_pm6_output_file)[source]
test_reads_gaussian_ts_genecp_outfile(tmpdir, gaussian_ts_genecp_outfile)[source]
test_reads_oldform_redundant_coordinates_with_atomic_numbers(tmp_path)[source]
test_reads_pd_insertion_ts_r_logfile(gaussian_pd_insertion_ts_r_outfile)[source]
class tests.test_GaussianSettings.TestGaussianJobSettings[source]

Bases: object

test_get_settings_from_yaml_gas_solv(gaussian_yaml_settings_gas_solv)[source]
test_get_settings_from_yaml_solv(gaussian_yaml_settings_solv)[source]
test_merge_dict()[source]
test_merge_other_settings()[source]
test_read_gaussian_hf_comfile(hf_com_filepath)[source]
test_read_gaussian_settings_from_orca_inp(water_sp_input_path)[source]
class tests.test_GaussianSettings.TestGaussianLinkJobSettingsGuess[source]

Bases: object

Tests for guess= formatting in GaussianLinkJobSettings route strings.

test_multiple_guess_options_with_parentheses()[source]

Multiple comma-separated options must be wrapped: guess=(mix,always)

test_pre_parenthesized_input_no_double_wrapping()[source]

Already-parenthesized input must not produce double parentheses.

test_pre_parenthesized_input_with_whitespace()[source]

Whitespace around parenthesized input must be handled.

test_single_guess_option_no_parentheses()[source]

Single option must appear without parentheses: guess=mix

class tests.test_GaussianSettings.TestGaussianPBCJob[source]

Bases: object

test_writes_gaussian_input_from_pbc_comfile(tmpdir, gaussian_pbc_3d_outputfile)[source]
class tests.test_GaussianSettings.TestGaussianQMMMJobSettings[source]

Bases: object

test_builtin_mm_helpers(tmpdir)[source]
test_qmmm_additional_opt_options_in_route()[source]

Regression test: -o/additional_opt_options_in_route must be merged into the opt/ts/modred keyword in the QMMM route string. Previously this field was silently ignored.

test_qmmm_additional_route_parameters()[source]

Regression test: -r/additional_route_parameters must appear in the QMMM route string. Previously _get_route_string_from_jobtype() in GaussianQMMMJobSettings never appended this field, so keywords like ‘scf=xqc’ were silently dropped.

test_qmmm_settings()[source]
test_qmmm_settings_for_atoms(gaussian_inputs_test_directory, gaussian_semiempirical_pm6_output_file)[source]
test_qmmm_settings_for_charge_and_multiplicity()[source]
class tests.test_GaussianSettings.TestGaussianRoute[source]

Bases: object

gas_route = 'opt=(ts,calcfc,noeigentest) freq m062x def2svp'
gas_route2 = 'opt b3lyp 6-31G(d) empiricaldispersion=gd3bj'
solv_route = 'mn15 def2svp scrf=(smd,solvent=DiChloroMethane)'
solv_route2 = '# opt=(calcfc,ts,noeigentest,maxstep=5) freq\nscrf=(smd,solvent=chlorobenzene) nosymm scf=qc def2svp m06'
test_settings_from_route()[source]
test_settings_from_route2()[source]
test_settings_from_route3()[source]
test_settings_from_route4()[source]
class tests.test_GaussianSettings.TestGaussianpKaJobSettings[source]

Bases: object

Tests for GaussianpKaJobSettings and GaussianpKaJob classes.

test_conjugate_base_job_property(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test conjugate_base_job property.

test_conjugate_base_molecule_method(single_molecule_xyz_file)[source]

Test the public conjugate_base_molecule method.

test_conjugate_base_molecule_property(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test conjugate_base_molecule method on settings.

test_conjugate_pair_job_settings_method(single_molecule_xyz_file)[source]

Test the public conjugate_pair_job_settings method returns gas phase settings.

test_conjugate_pair_molecules_method(single_molecule_xyz_file)[source]

Test the public conjugate_pair_molecules method.

test_create_conjugate_base_molecule(single_molecule_xyz_file)[source]

Test creating conjugate base molecule by removing a proton.

test_create_conjugate_base_molecule_custom_charge(single_molecule_xyz_file)[source]

Test creating conjugate base with custom charge/multiplicity.

test_create_conjugate_base_molecule_invalid_index(single_molecule_xyz_file)[source]

Test that error is raised for out-of-range proton index.

test_create_conjugate_base_molecule_no_proton_index(single_molecule_xyz_file)[source]

Test that error is raised when proton_index is not specified.

test_create_conjugate_base_molecule_not_hydrogen(single_molecule_xyz_file)[source]

Test that error is raised when index is not a hydrogen.

test_create_job_settings(single_molecule_xyz_file)[source]

Test creating gas phase job settings for both forms.

test_create_molecules(single_molecule_xyz_file)[source]

Test creating both protonated and conjugate base molecules.

test_default_scheme()[source]

Test that default thermodynamic cycle is proton exchange.

test_direct_cycle_custom_delta_g()[source]

Test direct cycle with custom delta_G_proton.

test_direct_cycle_no_reference()[source]

Test that direct cycle does not require reference acid.

test_gas_phase_optimization_settings(single_molecule_xyz_file)[source]

Test that gas phase optimization has no solvent.

test_get_reference_conjugate_base_molecule(single_molecule_xyz_file)[source]

Test creating reference conjugate base by removing proton.

test_get_reference_molecule(single_molecule_xyz_file)[source]

Test loading reference molecule from file.

test_init_custom_values()[source]

Test initialization with custom values.

test_init_invalid_settings_type(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test that error is raised for non-pKa settings.

test_init_no_proton_index(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test that error is raised when proton_index is not specified.

test_job_init_valid_settings(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test initialization with valid pKa settings.

test_job_labels(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test that job labels are correctly generated.

test_pka_jobs_property(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test that pka_jobs returns both jobs.

test_proton_exchange_with_reference_file(single_molecule_xyz_file)[source]

Test proton exchange cycle with reference acid file.

test_proton_exchange_without_reference_file()[source]

Test proton exchange cycle without reference file.

test_protonated_charge_multiplicity_properties()[source]

Test that protonated_charge/multiplicity are aliases for charge/multiplicity.

test_protonated_job_property(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test protonated_job property.

test_protonated_molecule_property(single_molecule_xyz_file, gaussian_jobrunner_no_scratch)[source]

Test protonated_molecule method on settings.

test_reference_gas_phase_job_settings(single_molecule_xyz_file)[source]

Test reference acid gas phase optimization settings.

test_reference_solution_phase_sp_settings(single_molecule_xyz_file)[source]

Test reference acid solution phase SP settings.

test_reference_validation(single_molecule_xyz_file)[source]

Test that reference settings validation works.

test_reference_validation_missing_proton_index(single_molecule_xyz_file)[source]

Test validation fails when reference_proton_index is missing.

test_solution_phase_sp_settings(single_molecule_xyz_file)[source]

Test that solution phase SP uses same level of theory with solvent.

tests.test_GaussianWriter module

class tests.test_GaussianWriter.TestGaussianInputWriter[source]

Bases: object

test_append_mm_parameters_skips_plain_molecule()[source]

False branch: molecule is not a QMMMMolecule and has no params file.

test_write_gaussian_input_from_pbc_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_pbc_2d_outputfile, gaussian_jobrunner_no_scratch, gaussian_written_opt_from_graphite_2d_pbc_log)[source]
test_write_modred_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_modred_file)[source]
test_write_modred_with_custom_basis_for_all_elements_in_structure_using_api(tmpdir, gaussian_yaml_settings_gas_solv_project_name, modred_genecp_inputfile, gaussian_jobrunner_no_scratch, gaussian_modred_with_custom_basis_for_all_atoms_from_api)[source]
test_write_opt_input_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, gaussian_written_ts_from_nhc_singlet_log_file)[source]

Taking the Gaussian nhc_neutral_singlet.log output and write aldehyde_opt.com using the settings from the .log file.

test_write_opt_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_opt_file)[source]
test_write_opt_job_with_route(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_opt_file_with_route)[source]
test_write_qmmm_amber_from_oniom_com_without_sidecar_files(tmpdir, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_amber_incomplete_mm_atom_info_raises(tmpdir, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_amber_requires_mm_atom_info(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_amber_with_mm_atom_info(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]

Cut covalent bonds are assigned as link atoms when bonded_atoms is omitted.

test_write_qmmm_genecp_follows_conventional_basis_path(tmpdir, gaussian_jobrunner_no_scratch)[source]

ONIOM gen/genecp uses the same shared basis path as non-QMMM jobs.

test_write_qmmm_inherits_layers_from_molecule(tmpdir, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_input_from_logfile(tmpdir, gaussian_yaml_settings_qmmm_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, gaussian_written_qmmm_log_file)[source]

Taking the Gaussian nhc_neutral_singlet.log output and write qmmm .com

test_write_qmmm_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_written_qmmm_file, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_job_with_scale_factors(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]

Both MM boundary atoms may link to the same high-layer atom.

test_write_qmmm_missing_mm_parameters_file_raises(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_mm_parameters_file_overrides_molecule_params(tmpdir, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]
test_write_qmmm_pm6_skips_connectivity_section(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]

Gaussian permits only one link-atom specification per atom.

test_write_qmmm_uses_layers_from_oniom_com(tmpdir, gaussian_qmmm_inputfile_2layer, gaussian_yaml_settings_qmmm_project_name, gaussian_jobrunner_no_scratch)[source]
test_write_scan_job_multiple_degrees_of_freedom(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_scan_multiple_degrees_of_freedom_file)[source]
test_write_scan_job_multiple_degrees_of_freedom_with_constraints(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_scan_multiple_degrees_of_freedom_with_constraints_file)[source]
test_write_scan_job_single_degree_of_freedom(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_scan_single_degree_of_freedom_file)[source]
test_write_semiempirical_opt_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_pm6_opt_file)[source]
test_write_sp_input_with_solvation_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, gaussian_written_sp_from_nhc_singlet_log_with_solvent_file)[source]

Test writing simple .com input file using settings from .log file, including solvation.

test_write_sp_with_custom_solvation_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, smd_TBME_solvent_parameters_text_file, gaussian_written_sp_from_nhc_singlet_log_with_custom_solvent_file)[source]

Test writing input file from log file. Simply taking the Gaussian nhc_neutral_singlet.log output and write gaussian_sp_custom_solv.com using the settings from the .log file and including custom solvation parameters from file smd_TBME.

test_write_ts_job(tmpdir, single_molecule_xyz_file, gaussian_yaml_settings_gas_solv_project_name, gaussian_jobrunner_no_scratch, gaussian_written_ts_file)[source]
test_write_ts_with_custom_basis_from_logfile(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_singlet_opt_outfile, gaussian_jobrunner_no_scratch, Ni_def2tzvp_PCHOSi_svp_text_file, gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_file)[source]
test_write_ts_with_custom_basis_using_api(tmpdir, gaussian_yaml_settings_gas_solv_project_name, gaussian_ts_genecp_outfile, gaussian_jobrunner_no_scratch, gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file)[source]

tests.test_ORCAIO module

class tests.test_ORCAIO.TestORCABasis[source]

Bases: object

test_orca_all_auxiliary_basis_sets()[source]
class tests.test_ORCAIO.TestORCAEngrad[source]

Bases: object

test_read_water_output(water_engrad_path)[source]
class tests.test_ORCAIO.TestORCAInput[source]

Bases: object

test_orca_faulty_solvent(orca_faulty_solv)[source]
test_orca_neb_input_with_xyz_files_specified(tmpdir, orca_input_nebts_file, orca_input_nebts_reactant_xyz_file, orca_input_nebts_product_xyz_file, orca_input_nebts_ts_xyz_file)[source]
test_orca_qmmm_input(orca_inputs_directory)[source]
test_read_solvent(orca_epr_solv)[source]
test_read_water_opt_input(water_opt_input_path)[source]
test_read_water_sp_input(water_sp_input_path)[source]
class tests.test_ORCAIO.TestORCANEB[source]

Bases: object

test_read_neb_output(orca_neb_output_file)[source]
class tests.test_ORCAIO.TestORCANEBInput[source]

Bases: object

Test suite for ORCANEBInput class.

test_neb_input_all_properties(tmpdir)[source]

Test reading all NEB input properties at once.

test_neb_input_case_insensitive(tmpdir)[source]

Test that NEB input parsing is case-insensitive.

test_neb_input_charge_and_multiplicity(orca_input_nebts_file)[source]

Test reading charge and multiplicity from NEB input.

test_neb_input_ending_xyzfile(orca_input_nebts_file)[source]

Test reading ending XYZ file from NEB input.

test_neb_input_inherits_from_orca_input(orca_input_nebts_file)[source]

Test that ORCANEBInput inherits from ORCAInput.

test_neb_input_nimages(orca_input_nebts_file)[source]

Test reading number of images from NEB input.

test_neb_input_pre_optimization_false(orca_input_nebts_file)[source]

Test reading pre-optimization flag (False) from NEB input.

test_neb_input_restarting_allxyzfile_none(orca_input_nebts_file)[source]

Test that restarting_allxyzfile is None when not specified.

test_neb_input_starting_xyzfile(orca_input_nebts_file)[source]

Test reading starting XYZ file from NEB input.

test_neb_input_ts_xyzfile(orca_input_nebts_file)[source]

Test reading TS XYZ file from NEB input.

test_neb_input_with_preopt_true(tmpdir)[source]

Test reading NEB input with pre-optimization enabled.

test_neb_input_with_restart_file(tmpdir)[source]

Test reading NEB input with restart file.

test_neb_input_without_ts_file(tmpdir)[source]

Test reading NEB input without TS guess file.

test_read_neb_input_basic(orca_input_nebts_file)[source]

Test basic reading of NEB input file.

class tests.test_ORCAIO.TestORCANEBJobSettings[source]

Bases: object

Test suite for ORCANEBJobSettings class.

test_equality_different_intermediate_xyzfile()[source]

Test that settings with different intermediate file are not equal.

test_equality_different_joboption()[source]

Test that settings with different joboption are not equal.

test_equality_different_nimages()[source]

Test that settings with different nimages are not equal.

test_equality_different_parent_attributes()[source]

Test that settings with different parent class attributes are not equal.

test_equality_different_preopt_ends()[source]

Test that settings with different preopt_ends are not equal.

test_equality_different_restarting_xyzfile()[source]

Test that settings with different restart file are not equal.

test_equality_different_semiempirical()[source]

Test that settings with different semiempirical method are not equal.

test_equality_identical_settings()[source]

Test that identical NEB settings are equal.

test_equality_includes_all_neb_attributes()[source]

Test that all 7 NEB-specific attributes are included in equality check.

test_inheritance()[source]

Test inheritance from ORCAJobSettings.

test_init_default()[source]

Test default initialization.

test_init_with_parameters()[source]

Test initialization with parameters.

test_neb_block_basic(tmpdir)[source]

Test basic NEB block generation via ORCAInputWriter.

test_route_string_generation()[source]

Test route string generation.

test_validation_errors()[source]

Test validation raises appropriate errors.

class tests.test_ORCAIO.TestORCAOutput[source]

Bases: object

test_fe2_quintet_orbital_properties(fe2_quintet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe2 quintet state.

test_fe2_singlet_orbital_properties(fe2_singlet_output)[source]

Test HOMO/LUMO properties for Fe2 singlet state.

test_fe2_triplet_orbital_properties(fe2_triplet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe2 triplet state.

test_fe3_doublet_orbital_properties(fe3_doublet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe3 doublet state.

test_fe3_quartet_orbital_properties(fe3_quartet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe3 quartet state.

test_fe3_sextet_orbital_properties(fe3_sextet_output)[source]

Test HOMO/LUMO/SOMO properties for Fe3 sextet state.

test_get_constrained_atoms(orca_fixed_atoms, orca_fixed_bonds_and_angles, orca_fixed_dihedral)[source]
test_get_constrained_bond_lengths_and_angles(orca_fixed_bonds_and_angles)[source]
test_get_constrained_dihedral_angles(orca_fixed_dihedral)[source]
test_gtoint_errfile(gtoint_errfile)[source]
test_he_freq_output(orca_he_output_freq)[source]
test_read_hirshfeld_full_print_output(hirshfeld_full_print)[source]
test_read_sp_full_print_output(dlpno_ccsdt_sp_full_print)[source]
test_read_sp_output(water_sp_gas_path)[source]
test_read_water_output(water_output_gas_path)[source]
test_sn2_ts_orca_output(orca_sn2_ts_output)[source]
test_water_optimized_output(water_output_gas_path)[source]
class tests.test_ORCAIO.TestORCAQMMM[source]

Bases: object

test_read_qmmm_output(orca_two_layer_qmmmm_output_file)[source]
class tests.test_ORCAIO.TestORCAQMMMJobSettings[source]

Bases: object

test_charge_and_multiplicity_population()[source]

ORCAQMMMJobSettings should populate .charge and .multiplicity from intermediate or high fields.

test_embedding_type_helpers(tmp_path)[source]
test_partition_string_empty_and_none()[source]

Empty string or None should return empty partition block.

test_partition_string_qm_and_qm2()[source]

When both high_level_atoms and medium_level_atoms provided, both lines should be returned.

test_partition_string_single_and_list_input()[source]

Partition string should accept ‘1-15,37,39’ or list and compress ranges.

test_qmmm_block_uses_orca_keywords()[source]
test_qmmm_xyz_line_does_not_fall_back_to_total_charge()[source]
test_qmmm_xyz_line_uses_charge_high_not_total()[source]
test_route_string_without_parent_jobtype()[source]

Unset parent_jobtype should not crash route generation.

class tests.test_ORCAIO.TestORCARoute[source]

Bases: object

test_read_route()[source]
class tests.test_ORCAIO.TestORCApKaOutput[source]

Bases: object

Tests for ORCApKaOutput using ORCATests pKa fixtures from outputs/.

EXPECTED_DG_AU = -0.02392099999997299
EXPECTED_DG_KCAL = -15.010654129046468
L2_A_E = -1101.075761
L2_A_QH_G = -1100.815285
L2_A_SP_E = -1101.157126
L2_HA_E = -1101.598928
L2_HA_QH_G = -1101.32487
L2_HA_SP_E = -1101.625867
PHENOL_B_E = -306.533586
PHENOL_B_QH_G = -306.467527
PHENOL_B_SP_E = -306.628244
PHENOL_HB_E = -307.111134
PHENOL_HB_QH_G = -307.031069
PHENOL_HB_SP_E = -307.12133
test_compute_pka_thermochemistry_ha_and_a(orca_outputs_directory)[source]

Test compute_pka_thermochemistry with HA and A- only.

test_compute_pka_uses_requested_files(orca_outputs_directory)[source]
test_electronic_energy_and_qh_gibbs_match_combined_dat(orca_outputs_directory)[source]
test_init_with_default_settings(orca_outputs_directory)[source]

tests.test_PyMOLJobs module

tests.test_YAMLIO module

class tests.test_YAMLIO.TestYAMLFile[source]

Bases: object

test_server_yaml(server_yaml_file)[source]

tests.test_converter module

tests.test_groupers module

class tests.test_groupers.TestConformerIdExtraction[source]

Bases: object

Test conformer ID extraction from filenames.

test_all_files_without_cxx_pattern()[source]

Test that a folder with no _cXX_ pattern files works correctly.

test_conformer_id_fallback_to_filename()[source]

Test that filename is used as conformer ID when no _cXX_ pattern.

test_conformer_ids_molecules_correspondence(ts_conformers_log_directory)[source]

Test that conformer_ids and molecules are strictly one-to-one corresponding.

This verifies that after sorting, each molecule’s energy matches the energy from its corresponding file (identified by conf_id).

test_extract_conformer_id_with_pattern()[source]

Test extraction with _cXX_ pattern.

test_extract_conformer_id_without_pattern()[source]

Test extraction without _cXX_ pattern returns None.

test_mixed_pattern_files_correspondence()[source]

Test correspondence when mixing files with and without _cXX_ pattern.

class tests.test_groupers.Test_BasicRMSD_grouper_and_basic_functionality[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_num_groups_parameter(multiple_molecules_xyz_file)[source]
test_pick_the_lowestenergy_conformers(multiple_molecules_xyz_file)[source]
test_rmsd_grouper(methanol_molecules, methanol_and_ethanol)[source]
test_rmsd_grouper_for_crest_conformers(multiple_molecules_xyz_file)[source]
test_rmsd_grouper_for_crest_conformers_ignore_Hs(multiple_molecules_xyz_file)[source]
test_rmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file)[source]
class tests.test_groupers.Test_EnergyGrouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_energy_extraction_from_ts_log_files(ts_conformers_log_directory)[source]

Test that energy is correctly extracted from TS log files as SCF Done energy.

test_energy_extraction_from_xyz_file(multiple_molecules_xyz_file)[source]
test_energy_grouper_for_crest_conformers(multiple_molecules_xyz_file)[source]

Test EnergyGrouper with molecules that have energy information.

test_energy_grouper_for_log_conformers(ts_conformers_log_directory)[source]

Test EnergyGrouper with molecules loaded from log files using Gibbs energy.

test_energy_grouper_raises_error_for_missing_energy(methanol_molecules)[source]
test_gibbs_energy_extraction_function(ts_conformers_log_directory)[source]

Test that Gaussian16Output.gibbs_free_energy extracts correct value.

class tests.test_groupers.Test_HungarianRMSD_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_hrmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file)[source]
test_hrmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file)[source]
test_ignore_hydrogen(multiple_molecules_xyz_file)[source]
class tests.test_groupers.Test_IRMSD_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={}), Mark(name='skipif', args=(True,), kwargs={'reason': 'irmsd command not available'})]
test_ignore_hydrogen(two_rotated_molecules_xyz_file)[source]
test_irmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file)[source]
test_irmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file)[source]
class tests.test_groupers.Test_PymolRMSD_grouper[source]

Bases: object

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
classmethod setup_class()[source]

Initialize PyMOL once for all tests in this class.

classmethod teardown_class()[source]

Clean up PyMOL after all tests in this class are done.

teardown_method(method)[source]

Clean up PyMOL objects after each test method to prevent slowdown.

test_ignore_hydrogen(multiple_molecules_xyz_file)[source]
test_pymol_grouper_rejects_multiproc(methanol_molecules)[source]

Test that PyMOL grouper raises error when num_procs > 1.

test_pymolrmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file)[source]
test_pymolrmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file)[source]
class tests.test_groupers.Test_SpyRMSD_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_ignore_hydrogen(multiple_molecules_xyz_file)[source]
test_spyrmsd_grouper_for_crest_molecules(multiple_molecules_xyz_file)[source]
test_spyrmsd_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file)[source]
class tests.test_groupers.Test_Tanimoto_similarity_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_tanimoto_grouper_for_crest_conformers(multiple_molecules_xyz_file)[source]
test_tanimoto_similarity_grouper(methanol_molecules, methanol_and_ethanol)[source]
class tests.test_groupers.Test_TorsionFingerprint_grouper[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_count_groups_matches_complete_linkage_iteration_order(methanol_molecules)[source]
test_torsionfingerprint_grouper_for_crest_molecules(multiple_molecules_xyz_file)[source]
test_torsionfingerprint_grouper_for_rotated_molecules(two_rotated_molecules_xyz_file)[source]
test_use_maxdev_parameter(multiple_molecules_xyz_file)[source]
test_use_weights_parameter(multiple_molecules_xyz_file)[source]
class tests.test_groupers.Test_conformer_ids_functionality[source]

Bases: object

Test conformer_ids parameter functionality.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_conformer_ids_from_log_directory(ts_conformers_log_directory)[source]

Test loading conformer IDs from a directory of log files.

test_traj_conformer_ids_original_indices()[source]

Test that traj job correctly sets original conformer indices.

class tests.test_groupers.Test_edge_cases[source]

Bases: object

Test edge cases and boundary conditions.

pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_different_formulas_always_separate(methanol_and_ethanol)[source]

Test that molecules with different formulas are always in separate groups.

test_num_groups_equals_num_molecules(methanol_molecules)[source]

Test requesting same number of groups as molecules.

test_num_groups_exceeds_num_molecules(methanol_molecules)[source]

Test requesting more groups than molecules.

test_rmsd_infinity_for_different_molecules(methanol_and_ethanol)[source]

Test that RMSD returns infinity for molecules with different atom counts.

test_two_molecules_grouping()[source]

Test grouping with minimum number of molecules (2).

test_very_high_threshold(multiple_molecules_xyz_file)[source]

Test with very high threshold (should create few groups).

test_very_low_threshold(multiple_molecules_xyz_file)[source]

Test with very low threshold (should create many groups).

class tests.test_groupers.Test_energy_extraction_function[source]

Bases: object

Framework tests for energy extraction by file type.

pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_energy_extraction_gaussian(gaussian_dppeFeCl2_link_opt_outputfile)[source]
test_energy_extraction_orca(fe2_singlet_output)[source]
class tests.test_groupers.Test_grouper_complete_linkage[source]

Bases: object

Test complete linkage clustering behavior.

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_complete_linkage_prevents_chaining(multiple_molecules_xyz_file)[source]

Test that complete linkage prevents chaining effect in grouping.

class tests.test_groupers.Test_grouper_utility_functions[source]

Bases: object

Test utility functions and helper methods in groupers.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_grouping_result_caching(multiple_molecules_xyz_file)[source]

Test that grouping results are cached and reused.

test_rmsd_matrix_with_num_groups(multiple_molecules_xyz_file, temporary_working_dir)[source]

Test that RMSD matrix filename reflects num_groups when used.

test_unique_returns_lowest_energy_representative(multiple_molecules_xyz_file)[source]

Test that unique() returns lowest energy molecule from each group.

class tests.test_groupers.Test_label_and_append_label[source]

Bases: object

Test -l (label) and -a (append_label) parameter functionality.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_different_labels_create_different_outputs(multiple_molecules_xyz_file)[source]

Test that different labels create separate output directories.

test_get_label_function()[source]

Test _get_label function logic.

test_label_in_group_xyz_files(multiple_molecules_xyz_file)[source]

Test that label parameter affects group XYZ file names.

test_label_in_output_directory(multiple_molecules_xyz_file)[source]

Test that label parameter affects output directory name.

test_label_with_num_groups(multiple_molecules_xyz_file)[source]

Test that label works correctly with num_groups parameter.

class tests.test_groupers.Test_other_groupers[source]

Bases: object

NUM_PROCS = 4
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_base_record_template_method(methanol_molecules)[source]
test_connectivity_grouper(methanol_molecules, methanol_and_ethanol)[source]
test_connectivity_grouper_for_crest_conformers(multiple_molecules_xyz_file)[source]
test_formula_grouper(methanol_molecules, methanol_and_ethanol, conformers_from_rdkit)[source]
test_rdkit_isomorphism_grouper(methanol_molecules, methanol_and_ethanol)[source]
test_record_writes_formula_outputs_with_headers(methanol_and_ethanol, temporary_working_dir)[source]

Detailed record test: verify non-matrix output sheet and header lines.

test_record_writes_rmsd_matrix_with_headers(methanol_molecules, temporary_working_dir)[source]

Detailed record test: verify matrix file and key header lines are written.

class tests.test_groupers.Test_output_file_generation[source]

Bases: object

Test that grouper generates correct output files.

NUM_PROCS = 1
pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
test_group_xyz_files_contain_energy_and_index_info(multiple_molecules_xyz_file)[source]

Test that group XYZ files contain energy and original index information.

test_group_xyz_files_energy_from_log_files(ts_conformers_log_directory)[source]

Test that energy is correctly extracted from log files and written to group XYZ files.

test_group_xyz_files_sorted_by_energy(multiple_molecules_xyz_file)[source]

Test that molecules in group XYZ files are sorted by energy (lowest first).

class tests.test_groupers.Testfactory[source]

Bases: object

pytestmark = [Mark(name='usefixtures', args=('temporary_working_dir',), kwargs={})]
classmethod teardown_class()[source]

Clean up PyMOL after all tests in this class are done.

test_structure_grouper_factory(methanol_molecules)[source]
test_structure_grouper_factory_energy(multiple_molecules_xyz_file)[source]

Test factory creation of energy grouper (requires molecules with energy).

tests.test_organizer module

class tests.test_organizer.TestOrganizer[source]

Bases: object

test_file_organizer(tmpdir, excel_file)[source]

tests.test_server module

class tests.test_server.TestMissingProgramSectionFallback[source]

Bases: object

Tests that Executable.from_servername raises ValueError when the program block (e.g. XTB, CREST) is absent from the server YAML, and that programs which ARE present still parse correctly.

Covers users who installed CHEMSMART before xTB support was added.

test_crest_missing_section_raises(legacy_server_yaml)[source]

CRESTExecutable.from_servername raises ValueError when CREST block absent.

test_present_section_still_parsed_correctly(legacy_server_yaml)[source]

Programs that are present in the legacy YAML are still parsed.

test_xtb_missing_section_error_message(legacy_server_yaml)[source]

The ValueError message mentions updating the server YAML.

test_xtb_missing_section_raises(legacy_server_yaml)[source]

XTBExecutable.from_servername raises ValueError when XTB block absent.

class tests.test_server.TestServer[source]

Bases: object

test_crest_executable(server_yaml_file)[source]
test_gaussian_executable(server_yaml_file)[source]
test_orca_executable(server_yaml_file)[source]
test_pbs_submitter_writes_extra_scheduler_directives()[source]
test_server_yaml(server_yaml_file)[source]
test_slurm_submitter_writes_extra_scheduler_directives()[source]
test_xtb_executable(server_yaml_file)[source]

tests.test_structures module

class tests.test_structures.TestCDXFile[source]

Bases: object

Tests for ChemDraw file reading functionality.

test_cdx_molecule_to_graph(single_molecule_cdxml_file_benzene)[source]

Test that molecules from CDXML can be converted to graph.

test_cdx_molecule_to_rdkit_conversion(single_molecule_cdxml_file_benzene)[source]

Test that molecules from CDXML can be converted to RDKit.

test_cdxfile_get_molecules_index(multi_molecule_cdxml_file)[source]

Test CDXFile.get_molecules with various index specifications.

test_molecule_from_filepath_cdx(single_molecule_cdx_file_imidazole)[source]

Test Molecule.from_filepath with a binary ChemDraw .cdx file.

test_molecule_from_filepath_cdxml(single_molecule_cdxml_file_benzene)[source]

Test Molecule.from_filepath with CDXML file.

test_molecule_from_filepath_cdxml_multi_molecules(multi_molecule_cdxml_file)[source]

Test reading multiple molecules from CDXML using from_filepath.

test_molecule_from_filepath_cdxml_pathlib(single_molecule_cdxml_file_benzene)[source]

Test Molecule.from_filepath with pathlib.Path.

test_molecule_from_filepath_cdxml_return_list(single_molecule_cdxml_file_benzene)[source]

Test return_list parameter with single molecule CDXML file.

test_read_complex_molecule_cdxml_file_(complex_molecule_cdxml_file)[source]

Test reading a single molecule from a CDXML file.

test_read_metal_ligand_molecules_cdxml_file_(metal_ligand_molecules_cdxml_file)[source]

Test reading multiple organometallic molecules from a CDXML file with Cp and aromatic ligands.

test_read_multi_molecule_cdxml_file(multi_molecule_cdxml_file)[source]

Test reading multiple molecules from a CDXML file.

test_read_single_molecule_cdx_file_imidazole(single_molecule_cdx_file_imidazole)[source]

Test reading a single molecule from a CDXML file.

test_read_single_molecule_cdxml_file_benzene(single_molecule_cdxml_file_benzene)[source]

Test reading a single molecule from a CDXML file.

test_read_single_molecule_cdxml_file_methane(single_molecule_cdxml_file_methane)[source]

Test reading a single molecule from a CDXML file.

class tests.test_structures.TestCXSMILES[source]

Bases: object

Tests for Molecule.cxsmiles property (RDKit backend).

EXPECTED_NORMAL = '[H]C([H])([H])C([H])([H])op(=O)oC([H])([H])C([H])([H])[H] |(3.6969,1.9448,0.2049;3.0842,1.2373,-0.3608;3.7313,0.4472,-0.7559;2.652,1.7556,-1.2232;1.9939,0.6488,0.5088;1.3583,1.4601,0.8855;2.4534,0.1313,1.3605;1.2255,-0.2622,-0.2653;0.0003,-0.9988,0.5013;0.0051,-2.2423,-0.2655;-1.2252,-0.2619,-0.2663;-1.9972,0.645,0.509;-2.4576,0.1238,1.3579;-1.364,1.4563,0.8899;-3.0867,1.2342,-0.3613;-3.702,1.9386,0.2054;-2.6535,1.756,-1.221;-3.7312,0.4439,-0.7604)|'
EXPECTED_R_ENANTIOMER = '[H]c1c([H])c([H])c(P(=O)(c2c([H])c([H])c([H])c([H])c2[H])C([H])([H])[C@@]2(C([H])([H])[H])c(=O)n(C([H])([H])[H])c3c([H])c([H])c([H])c([H])c32)c([H])c1[H] |(0.657587,4.92454,-1.29892;0.276843,3.96138,-0.951759;0.485742,2.81258,-1.71847;1.03401,2.87447,-2.66093;0.006912,1.57925,-1.27484;0.204594,0.685275,-1.87284;-0.6776,1.49046,-0.055628;-1.25801,-0.0518,0.702519;-1.3091,0.044461,2.20006;-2.88635,-0.380829,-0.012479;-3.12941,-0.354113,-1.39219;-2.32549,-0.092551,-2.08777;-4.40354,-0.645056,-1.87792;-4.59613,-0.624486,-2.95272;-5.43533,-0.955747,-0.986524;-6.43361,-1.18057,-1.36882;-5.19575,-0.974224,0.388852;-6.00568,-1.21169,1.08208;-3.92009,-0.687184,0.879324;-3.70148,-0.688059,1.9505;-0.227699,-1.40463,0.052757;-0.119079,-1.24802,-1.03485;-0.807656,-2.33494,0.17008;1.15351,-1.5942,0.72979;0.99867,-2.27426,2.08799;0.308383,-1.69441,2.71697;1.97119,-2.35931,2.59369;0.59233,-3.28598,1.93715;1.93427,-2.48285,-0.25179;1.70453,-3.64544,-0.504979;2.90906,-1.70492,-0.846562;3.81634,-2.19747,-1.84937;3.73917,-1.61247,-2.77951;3.54494,-3.24141,-2.05378;4.8593,-2.15693,-1.49649;2.95902,-0.433075,-0.262488;3.8266,0.615031,-0.550651;4.58376,0.527564,-1.3328;3.69973,1.78628,0.210751;4.36465,2.62845,0.005447;2.75405,1.88809,1.23239;2.68234,2.80776,1.81661;1.88531,0.820237,1.50649;1.12177,0.893949,2.28612;1.97673,-0.328846,0.734248;-0.882212,2.64496,0.711945;-1.38448,2.55034,1.67858;-0.411788,3.878,0.260678;-0.570718,4.77518,0.863087),wU:23.24|'
EXPECTED_R_ROTAMER = '[H]c1n=c(-c2c(-os(=O)(=O)C(F)(F)F)c([H])c([H])c3c([H])c([H])c([H])c([H])c23)c2c([H])c([H])c([H])c([H])c2c1[H] |(-0.329609,2.38122,-3.61273;-0.026158,2.27146,-2.56743;0.336125,1.02648,-2.1812;0.702396,0.825008,-0.934002;1.01703,-0.590455,-0.562362;-0.007714,-1.51067,-0.532668;-1.30548,-1.10616,-0.852577;-2.1204,-0.164611,0.168256;-2.55417,1.01923,-0.515766;-1.46291,-0.151398,1.44906;-3.57423,-1.28562,0.320271;-4.16542,-1.41565,-0.847695;-3.16121,-2.46571,0.747804;-4.41207,-0.76474,1.19438;0.181508,-2.86971,-0.206966;-0.687662,-3.52873,-0.187174;1.44931,-3.31282,0.079351;1.62504,-4.36094,0.333044;2.55451,-2.41778,0.057183;3.87361,-2.86277,0.348232;4.02499,-3.91674,0.595343;4.93563,-1.98941,0.318758;5.94394,-2.3428,0.544269;4.72459,-0.626471,-0.008915;5.57315,0.060292,-0.037079;3.46034,-0.164367,-0.295324;3.30174,0.885311,-0.552026;2.34077,-1.04278,-0.266984;0.743402,1.86566,0.050067;1.11738,1.6475,1.4052;1.36594,0.635744,1.73181;1.14034,2.69619,2.29419;1.42424,2.52279,3.3341;0.783222,4.00428,1.87401;0.805052,4.82508,2.59435;0.401105,4.23926,0.574492;0.114218,5.24117,0.245832;0.370036,3.17459,-0.368519;-0.025328,3.3532,-1.71845;-0.329238,4.34162,-2.07033)|'
EXPECTED_S_ENANTIOMER = '[H]c1c([H])c([H])c(P(=O)(c2c([H])c([H])c([H])c([H])c2[H])C([H])([H])[C@]2(C([H])([H])[H])c(=O)n(C([H])([H])[H])c3c([H])c([H])c([H])c([H])c32)c([H])c1[H] |(-4.10545,4.56874,0.709448;-3.52977,3.64265,0.645345;-3.31587,2.87242,1.79018;-3.72201,3.19528,2.7513;-2.57592,1.69184,1.70894;-2.37818,1.07929,2.59263;-2.05266,1.27517,0.478011;-1.13514,-0.28848,0.507738;-0.75977,-0.677078,1.90906;-2.21055,-1.523,-0.263839;-2.718,-1.39784,-1.56435;-2.48778,-0.513904,-2.16641;-3.52676,-2.40254,-2.09389;-3.92258,-2.30619,-3.10717;-3.83217,-3.53062,-1.32596;-4.46746,-4.31554,-1.7426;-3.3289,-3.6555,-0.02996;-3.56957,-4.53716,0.56812;-2.51594,-2.65283,0.503124;-2.10519,-2.72167,1.51378;0.246332,-0.126442,-0.664672;0.507903,-1.14931,-0.980531;-0.124177,0.404384,-1.55997;1.49769,0.604701,-0.148795;1.1654,1.86783,0.660908;0.549974,2.55301,0.05834;2.09382,2.38433,0.946933;0.621442,1.59517,1.57793;2.29809,1.06731,-1.37867;1.86402,1.731,-2.29803;3.58921,0.612819,-1.24748;4.63005,0.881221,-2.20479;5.4733,1.41251,-1.73622;4.19794,1.50997,-2.994;5.00869,-0.052287,-2.65075;3.72297,-0.193357,-0.108558;4.85777,-0.860668,0.337892;5.8052,-0.793848,-0.201106;4.73765,-1.62678,1.50603;5.61099,-2.16479,1.88194;3.52468,-1.71469,2.1904;3.45722,-2.32196,3.09528;2.38859,-1.03029,1.72864;1.4267,-1.09209,2.24455;2.49776,-0.268364,0.573364;-2.26183,2.05492,-0.668208;-1.83522,1.76286,-1.63193;-3.00036,3.23568,-0.582173;-3.1564,3.84433,-1.47533),wU:23.24|'
EXPECTED_S_ROTAMER = '[H]c1n=c(-c2c(-os(=O)(=O)C(F)(F)F)c([H])c([H])c3c([H])c([H])c([H])c([H])c23)c2c([H])c([H])c([H])c([H])c2c1[H] |(-0.329441,-2.38184,-3.61277;-0.026136,-2.27183,-2.56745;0.33626,-1.0268,-2.18149;0.702361,-0.825125,-0.934248;1.01698,0.590384,-0.562766;-0.007759,1.51064,-0.533148;-1.3055,1.10597,-0.853096;-2.12019,0.16467,0.168019;-1.46257,0.151709,1.44877;-2.55422,-1.01919,-0.515773;-3.57381,1.28579,0.320452;-3.16032,2.46582,0.747959;-4.16523,1.41612,-0.847356;-4.41149,0.765061,1.19469;0.181532,2.86961,-0.207313;-0.687458,3.52887,-0.187547;1.44935,3.31259,0.07922;1.62509,4.36068,0.33303;2.55452,2.41752,0.057133;3.87361,2.86235,0.348425;4.02509,3.91629,0.595642;4.93552,1.98887,0.319058;5.94384,2.34212,0.544769;4.7244,0.625956,-0.008734;5.5729,-0.060885,-0.036781;3.46015,0.164008,-0.295385;3.30143,-0.885637,-0.552158;2.3407,1.04257,-0.26718;0.743183,-1.86557,0.050012;1.11714,-1.64713,1.40512;1.36576,-0.635314,1.7315;1.1399,-2.69559,2.29437;1.42376,-2.522,3.33425;0.782587,-4.00373,1.87448;0.804249,-4.82437,2.595;0.400478,-4.23897,0.575013;0.11344,-5.24092,0.246622;0.369622,-3.17453,-0.368276;-0.025656,-3.35336,-1.71819;-0.329772,-4.34179,-2.06987)|'
test_enantiomers_differ(cxsmiles_r_enantiomer_file, cxsmiles_s_enantiomer_file)[source]

R and S enantiomers must produce different CXSMILES. The SMILES core itself differs (@@/@ chirality annotation).

test_large_molecule_c2_cxsmiles(cxsmiles_large_molecule_c2_file, cxsmiles_expected_large_c2_file)[source]

CXSMILES for a large molecule (c2) should match the expected value.

test_large_molecule_c3_cxsmiles(cxsmiles_large_molecule_c3_file, cxsmiles_expected_large_c3_file)[source]

CXSMILES for a large molecule (c3) should match the expected value.

test_large_molecules_differ(cxsmiles_large_molecule_c2_file, cxsmiles_large_molecule_c3_file)[source]

Two different large molecules should produce different CXSMILES.

test_r_enantiomer_cxsmiles(cxsmiles_r_enantiomer_file)[source]

CXSMILES for the R-enantiomer should match the expected value.

test_r_rotamer_cxsmiles(cxsmiles_r_rotamer_file)[source]

CXSMILES for the R-rotamer should match the expected value.

test_regression_cxsmiles(cxsmiles_normal_file)[source]

CXSMILES for a simple molecule should be deterministic across repeated calls.

test_rotamers_differ(cxsmiles_r_rotamer_file, cxsmiles_s_rotamer_file)[source]

R and S rotamers must produce different CXSMILES. Rotamers share the same SMILES core (identical connectivity) but differ in the CX coordinate extension (3D geometry).

test_s_enantiomer_cxsmiles(cxsmiles_s_enantiomer_file)[source]

CXSMILES for the S-enantiomer should match the expected value.

test_s_rotamer_cxsmiles(cxsmiles_s_rotamer_file)[source]

CXSMILES for the S-rotamer should match the expected value.

class tests.test_structures.TestChemicalFeatures[source]

Bases: object

test_more_stereochemistry_handling()[source]

Test preservation of stereochemical information with PubChem.

test_resonance_handling(gaussian_ozone_opt_outfile, gaussian_acetone_opt_outfile, gaussian_benzene_opt_outfile)[source]

Test handling of resonance structures.

test_stereochemistry_handling(methyl3hexane_molecule)[source]

Test preservation of stereochemical information.

test_volume(gaussian_ozone_opt_outfile, gaussian_acetone_opt_outfile)[source]

Test volume calculation for molecules.

Tests various volume calculation methods: - voronoi_dirichlet_occupied_volume - crude_volume_by_vdw_radii - crude_volume_by_atomic_radii - vdw_volume - vdw_volume_from_rdkit - voronoi_dirichlet_polyhedra_occupied_volume

class tests.test_structures.TestCoordinateBlock[source]

Bases: object

test_coordinate_block_with_partitions_returns_qmmm_molecule()[source]

ONIOM coordinate block should return QMMMMolecule.

test_coordinate_block_without_partitions_returns_molecule()[source]

Non-ONIOM coordinate block should return Molecule, not QMMMMolecule.

test_read_coordinate_block()[source]
test_read_gaussian_cb_frozen_atoms()[source]
test_read_gaussian_cb_with_tv()[source]
class tests.test_structures.TestCoordinateBlockAdvanced[source]

Bases: object

test_cube_file_format()[source]

Test parsing of cube file format coordinates.

test_mixed_coordinate_formats()[source]

Test parsing of mixed coordinate formats.

class tests.test_structures.TestFileHandlingAdvanced[source]

Bases: object

test_corrupted_file_handling(tmpdir)[source]

Test error handling for corrupted files.

test_large_file_handling(tmpdir)[source]

Test handling of large molecule files.

class tests.test_structures.TestGraphFeatures[source]

Bases: object

test_graph_properties()[source]

Test molecular graph properties.

test_variable_bond_cutoffs()[source]

Test bond detection with different cutoff buffers.

class tests.test_structures.TestInChI[source]

Bases: object

Tests for Molecule.inchi and Molecule.inchikey properties (Open Babel backend).

EXPECTED_INCHI_NORMAL = 'InChI=1S/C4H10O3P/c1-3-6-8(5)7-4-2/h3-4H2,1-2H3'
EXPECTED_INCHI_R_ENANTIOMER = 'InChI=1S/C23H22NO2P/c1-23(20-15-9-10-16-21(20)24(2)22(23)25)17-27(26,18-11-5-3-6-12-18)19-13-7-4-8-14-19/h3-16H,17H2,1-2H3/t23-/m1/s1'
EXPECTED_INCHI_S_ENANTIOMER = 'InChI=1S/C23H22NO2P/c1-23(20-15-9-10-16-21(20)24(2)22(23)25)17-27(26,18-11-5-3-6-12-18)19-13-7-4-8-14-19/h3-16H,17H2,1-2H3/t23-/m0/s1'
EXPECTED_LARGE_C2 = 'KRPJGRYSEYYRSW-YWQHEUOTSA-M'
EXPECTED_LARGE_C3 = 'WYLDIUSELJCHHK-MMELAICESA-M'
EXPECTED_NORMAL = 'NNJYFTBCZFRDIO-UHFFFAOYSA-N'
EXPECTED_R_ENANTIOMER = 'YDCAVENCOFCEDV-HSZRJFAPSA-N'
EXPECTED_S_ENANTIOMER = 'YDCAVENCOFCEDV-QHCPKHFHSA-N'
test_enantiomers_share_connectivity_layer(inchikey_r_enantiomer_file, inchikey_s_enantiomer_file)[source]

R and S enantiomers share the same first (connectivity) layer of the InChI and InChIKey (identical constitution) but differ in the stereo layer, confirming that Open Babel correctly resolves the axial chirality.

test_large_molecule_c2_inchikey(inchikey_large_molecule_c2_file)[source]

InChIKey for a large molecule (c2) should match the expected value.

test_large_molecule_c3_inchikey(inchikey_large_molecule_c3_file)[source]

InChIKey for a large molecule (c3) should match the expected value.

test_large_molecules_differ(inchikey_large_molecule_c3_file, inchikey_large_molecule_c2_file)[source]

Two different large molecules should produce different InChIKeys and InChI strings.

test_r_enantiomer_inchikey(inchikey_r_enantiomer_file)[source]

InChIKey for the R-enantiomer should match the expected value.

test_regression_inchikey(inchikey_normal_file)[source]

InChIKey for a simple small molecule should be deterministic across repeated calls.

test_s_enantiomer_inchikey(inchikey_s_enantiomer_file)[source]

InChIKey for the S-enantiomer should match the expected value.

class tests.test_structures.TestInChIKey[source]

Bases: object

Tests for Molecule.inchikey property (Open Babel backend).

class tests.test_structures.TestMoleculeAdvanced[source]

Bases: object

test_charge_and_multiplicity_handling()[source]

Test preservation of charge and multiplicity states.

test_convert_ase_atoms_with_constraints_to_molecule(constrained_atoms)[source]

Test conversion of ASE Atoms with constraints to Molecule.

test_distance_calculation()[source]

Test bond distance calculations.

test_empty_molecule_handling()[source]

Test edge case of empty molecule.

test_from_pdb_file_infers_uppercase_two_letter_elements_when_blank(tmpdir)[source]

Test blank PDB element columns fall back to uppercase atom-name inference.

test_from_pdb_file_preserves_atom_and_residue_metadata(tmpdir)[source]

Test native PDB import preserves atom names and residue metadata.

test_from_pdb_file_supports_model_index_selection(tmpdir)[source]

Test PDB MODEL/ENDMDL parsing and index selection.

test_frozen_atoms_manipulation()[source]

Test frozen atoms property handling.

test_infer_pdb_element_from_uppercase_atom_names()[source]

Test uppercase PDB atom names can still infer two-letter elements.

test_invalid_molecule_creation()[source]

Test error handling for invalid molecule configurations.

test_is_aromatic_non_aromatic_molecules()[source]

Regression test: non-aromatic molecules must not be reported as aromatic.

Bond-order heuristics can assign order 1.5 to bonds like O-H or Mg-I, which previously caused is_aromatic to return True for H2O and MgI2. The property must use ring membership to validate aromaticity.

test_molecule_from_db_with_pbc_and_constraints(constrained_pbc_db_file)[source]

Test creation of Molecule from database with PBC and constraints.

test_molecule_graph_generation()[source]

Test molecular graph creation with bond detection.

test_molecule_to_rdkit_conversion()[source]

Test conversion of Molecule to RDKit Mol object.

test_pbc_handling()[source]

Test periodic boundary conditions handling.

test_pdb_with_different_flavors(single_molecule_xyz_file)[source]

Test PDB conversion with different flavor options.

test_pdb_with_no_bonds(single_molecule_xyz_file)[source]

Test PDB conversion without bond detection.

test_to_ase_energy_unit_conversion()[source]

Test that to_ase() converts energy from Hartree to eV.

test_to_ase_energy_with_none_forces()[source]

Test that to_ase() converts energy when forces are None.

test_to_ase_forces_unit_conversion()[source]

Test that to_ase() converts forces from Hartree/Bohr to eV/Å.

test_to_ase_none_energy_and_forces()[source]

Test that to_ase() preserves None for energy and forces.

test_to_ase_none_energy_with_forces()[source]

Test that to_ase() converts forces when energy is None.

test_to_pdb_conversion(single_molecule_xyz_file)[source]

Test conversion of Molecule to PDB format.

test_to_pdb_strict_columns_and_final_end_record()[source]

Test strict PDB 3.3 atom-column formatting and final END line.

test_to_pdb_uses_molecule_attributes_for_chain_and_residue_metadata()[source]

Test chain/residue metadata taken directly from Molecule attributes.

test_write_generic_method_with_pdb_format(single_molecule_xyz_file, tmpdir)[source]

Test generic write() method with PDB format.

test_write_pdb_file(single_molecule_xyz_file, tmpdir)[source]

Test writing Molecule to PDB file.

test_write_pdb_rejects_unexpected_keyword_argument(single_molecule_xyz_file, tmpdir)[source]

Test write_pdb rejects unexpected kwargs instead of ignoring them.

class tests.test_structures.TestMoleculeAndStructureIdentifiers[source]

Bases: object

Tests for Molecule.canonical_geometry, Molecule.structure_id, Molecule.structure_label, Molecule.molecule_id, and Molecule.molecule_label.

canonical_geometry: string encoding of the geometry invariant under

translation, rotation, and atom-index permutation.

structure_id: SHA-256 hex digest of (canonical_geometry, charge, multiplicity). structure_label: “str-{chemical_formula}-{structure_id[:12]}”. molecule_id: Unique chemical species identifier (InChIKey string).

Topology- and stereochemistry-based; geometry-independent.

molecule_label: “mol-{chemical_formula}-{molecule_id}”.

test_atom_permutation_preserves_both_ids(canonical_3b_file, canonical_3b_permuted_file)[source]

Permuting atom input order must preserve both structure_id and molecule_id (invariance to atom-listing order).

test_different_electronic_state_changes_structure_id_not_molecule_id(canonical_formaldehyde_file)[source]

The same geometry with different charge or multiplicity must produce a different structure_id (electronic state is part of the structure hash) but the same molecule_id (topology is unchanged).

test_different_species_differ_in_both_ids(canonical_formaldehyde_file, canonical_methane_file)[source]

Two chemically distinct molecules must differ in both structure_id and molecule_id.

test_enantiomers_differ_in_both_ids(canonical_r_bromochlorofluoromethane_file, canonical_s_bromochlorofluoromethane_file)[source]

R- and S-bromochlorofluoromethane are non-superimposable mirror images: both structure_id (different geometry) and molecule_id (InChIKey encodes stereochemistry) must differ. The first InChIKey block (connectivity layer) is shared; the stereo layer (second block) differs.

test_geometry_distortion_changes_structure_id_not_molecule_id(canonical_methane_file, canonical_methane_distorted_file)[source]

Elongating one C-H bond by ~2e-3 Å must change structure_id (geometry changed) but leave molecule_id unchanged (same topology).

test_ids_are_deterministic(canonical_formaldehyde_file)[source]

Loading the same file twice must give identical structure_id, structure_label, molecule_id, and molecule_label.

test_molecule_label_format(canonical_formaldehyde_file)[source]

molecule_label must follow ‘mol-{chemical_formula}-{molecule_id}’.

test_rigid_transform_preserves_both_ids_3b(canonical_3b_file, canonical_3b_trans_rot_file)[source]

Translating and rotating 3b (C17H17NOS, C1 symmetry, 37 atoms) must preserve both structure_id and molecule_id.

test_rigid_transform_preserves_both_ids_formaldehyde(canonical_formaldehyde_file, canonical_formaldehyde_trans_rot_file)[source]

Translating and rotating formaldehyde (C2v) must preserve both structure_id and molecule_id.

test_rigid_transform_preserves_both_ids_methane(canonical_methane_file, canonical_methane_trans_rot_file)[source]

Translating and rotating methane (Td, spherical top) should preserve both structure_id and molecule_id (xfail: canonicalization not guaranteed for degenerate inertia tensors).

test_structure_label_format(canonical_formaldehyde_file)[source]

structure_label must follow ‘str-{chemical_formula}-{structure_id[:12]}’.

test_sub_threshold_perturbation_preserves_both_ids(canonical_formaldehyde_file, canonical_formaldehyde_perturbed_file)[source]

A coordinate perturbation of ~1e-7 Å (well below the 1e-4 Å rounding threshold) must preserve both structure_id and molecule_id.

class tests.test_structures.TestQMMMMolecule[source]

Bases: object

Tests for QMMMMolecule partitioning and related functionality.

Cut covalent bonds become link-atom pairs when bonded_atoms is omitted.

test_mm_atom_info_from_coordinate_lines()[source]
test_qmmm_helpers_for_uncovered_branches()[source]
test_qmmm_partition_out_of_range_raises()[source]

Specifying out-of-range atom indices should raise a ValueError.

test_qmmm_partition_overlap_raises()[source]

Creating a QMMMMolecule with overlapping partitions should raise a ValueError.

String layer specs must still produce link-atom lines.

test_write_gaussian_connectivity_and_frozen_mm_labels()[source]
class tests.test_structures.TestQMMMinMolecule[source]

Bases: object

test_atoms_in_levels_default_low_level(tmpdir, qmmm_written_xyz_file, qmmm_written_xyz_only_file, methyl3hexane_molecule)[source]
test_atoms_in_levels_wrong_low_level(tmpdir, methyl3hexane_molecule)[source]
test_qmmm_atoms_handling(tmpdir)[source]

Test QM/MM atoms handling.

test_qmmm_partition_out_of_range_raises()[source]

Specifying out-of-range atom indices should raise a ValueError.

test_qmmm_partition_overlap_raises()[source]

Creating a QMMMMolecule with overlapping partitions should raise a ValueError.

class tests.test_structures.TestSDFFile[source]

Bases: object

test_converts_sdf_string_to_molecule_object(tmpdir)[source]
class tests.test_structures.TestStructureCoverageBoost[source]

Bases: object

test_atomic_radii_lists(single_molecule_xyz_file)[source]
test_bond_lengths_helper()[source]
test_bond_orders_and_graphs(gaussian_benzene_opt_outfile)[source]
test_chiral_aromatic_ring(gaussian_benzene_opt_outfile)[source]
test_coordinate_block_basic()[source]
test_coordinate_block_symbol_token_fallback()[source]
test_coordinate_block_variants()[source]
test_db_neither_chemsmart_nor_ase(tmpdir)[source]
test_delete_atoms_paths(gaussian_benzene_opt_outfile)[source]
test_determine_level_from_atom_index(single_molecule_xyz_file)[source]
test_determine_level_on_molecule()[source]
test_empty_filepath_returns_none(tmpdir)[source]
test_energy_and_positions_setters(single_molecule_xyz_file)[source]
test_from_ase_and_copy(single_molecule_xyz_file)[source]
test_from_filepath_missing(tmpdir)[source]
test_from_molecule_copy_dict()[source]
test_from_pubchem_mocked()[source]
test_from_rdkit()[source]
test_geometry_helpers(single_molecule_xyz_file)[source]
test_getitem_and_len(single_molecule_xyz_file)[source]
test_graphs_and_bond_orders_water()[source]
test_has_vibrations_props(single_molecule_xyz_file)[source]
test_inchi_import_error(single_molecule_xyz_file)[source]
test_inchikey_inchi_smiles(gaussian_benzene_opt_outfile)[source]
test_init_rejects_empty_symbols()[source]
test_init_validation_branches()[source]
test_is_linear_three_atom_collinear()[source]
test_mass_properties(single_molecule_xyz_file)[source]
test_moments_and_rot_temps(gaussian_benzene_opt_outfile)[source]
test_monoatomic_diatomic_linear()[source]
test_monoatomic_moi_and_rot_temps()[source]
test_num_atoms_setter(single_molecule_xyz_file)[source]
test_pbc_property(single_molecule_xyz_file)[source]
test_pbc_write_gaussian_coords(tmpdir)[source]
test_pka_molecule(single_molecule_xyz_file)[source]
test_pka_non_hydrogen_proton_index(single_molecule_xyz_file)[source]
test_qmmm_high_none_raises(single_molecule_xyz_file)[source]
test_qmmm_overlap_raises(single_molecule_xyz_file)[source]
test_qmmm_partition_levels(single_molecule_xyz_file, tmpdir)[source]
test_qmmm_partition_validation()[source]
test_qmmm_real_charge_sets_state(single_molecule_xyz_file)[source]
test_rdkit_fingerprints(gaussian_benzene_opt_outfile)[source]
test_rdkit_vectorized_bond_types(gaussian_benzene_opt_outfile)[source]
test_read_chemsmart_db()[source]
test_read_pdb_return_list(single_model_pdb_file)[source]
test_read_sdf_and_other_list(tmpdir)[source]
test_read_unsupported_out_and_gaussian_inp_error(tmpdir)[source]
test_repr_str_and_chemical_symbols_none()[source]
test_return_list_from_filepath(single_molecule_xyz_file)[source]
test_to_pymatgen_and_x_data(gaussian_ozone_opt_outfile)[source]
test_to_x_data_no_positions_raises()[source]
test_vdw_volume_and_pbc(gaussian_benzene_opt_outfile)[source]
test_vectorized_bond_add(gaussian_benzene_opt_outfile)[source]
test_vibrationally_displaced(single_molecule_xyz_file)[source]
test_vibrationally_displaced_negative_index(gaussian_singlet_opt_outfile)[source]
test_volumes(gaussian_benzene_opt_outfile)[source]
test_write_coordinates_programs(single_molecule_xyz_file)[source]
test_write_cosmorsxyz_via_write(tmpdir)[source]
test_write_extxyz_bad_forces_ignored(tmpdir)[source]
test_write_extxyz_forces_shape_mismatch(tmpdir)[source]
test_write_extxyz_with_forces_and_energy(tmpdir)[source]
test_write_gaussian_with_frozen(tmpdir)[source]
test_write_pdb_rejects_kwargs(single_molecule_xyz_file, tmpdir)[source]
test_write_via_openbabel_fallback(single_molecule_xyz_file, tmpdir)[source]
class tests.test_structures.TestStructures[source]

Bases: object

test_molecular_geometry()[source]

Test molecular geometry calculations.

test_read_crest_dynamics_trj_as_xyz(crest_octane_outfolder)[source]
test_read_crestopt_log_as_xyz(crest_octane_outfolder)[source]

crestopt.log is XYZ with .log extension.

test_read_molecule_energy_from_xyz_file(xtb_optimized_xyz_file, chemsmart_generated_xyz_file, extended_xyz_file)[source]
test_read_molecule_from_multiple_molecules_xyz_file(multiple_molecules_xyz_file)[source]
test_read_molecule_from_single_molecule_xyz_file(single_molecule_xyz_file)[source]
class tests.test_structures.TestStructuresFromGaussianInput[source]

Bases: object

test_read_molecule_from_gaussian_frozen_opt(tmpdir, gaussian_frozen_opt_inputfile)[source]
test_read_molecule_from_gaussian_modred(gaussian_modred_inputfile)[source]
test_read_molecule_from_gaussian_opt_input(tmpdir, gaussian_opt_inputfile)[source]
test_read_molecule_from_gaussian_pbc(tmpdir, gaussian_pbc_1d_inputfile)[source]
test_read_molecule_from_gaussian_scan(gaussian_scan_inputfile)[source]
test_read_molecule_from_modred_gen(modred_gen_inputfile)[source]
test_read_molecule_from_modred_genecp(modred_genecp_inputfile)[source]
test_read_molecule_from_modred_genecp_custom_solvent(modred_genecp_custom_solvent_inputfile)[source]
test_read_molecule_from_opt_genecp(gaussian_opt_genecp_inputfile)[source]
class tests.test_structures.TestpKaCDXFile[source]

Bases: object

test_detect_proton_in_fragment_explicit_h(colored_proton_two_molecule_cdxml_file)[source]

_detect_proton_in_fragment finds explicit H in each fragment.

test_detect_proton_in_fragment_uniform_color_raises(single_molecule_cdxml_file_benzene)[source]

_detect_proton_in_fragment raises when all atoms share a colour.

test_fragment_colors_match_flat_colors(colored_proton_cdxml_file)[source]

Fragment colours concatenated should match the flat parse_cdxml_element_colors output.

test_functional_group_proton_user_color_phenol(colored_implicit_proton_cdxml_file)[source]

User-specified colour for phenol implicit OH hydrogen.

test_get_colored_proton_index_auto_detect(colored_proton_cdxml_file)[source]

Test auto-detection of uniquely coloured proton when that proton appears as an explicit node (default mode).

test_get_colored_proton_index_invalid_color_code_raises(colored_implicit_proton_cdxml_file)[source]

Test that specifying a non-existent colour code raises.

test_get_colored_proton_index_multiple_atoms_same_color_raises(complex_molecule_cdxml_file)[source]

Test that specifying a colour shared by non-H atoms raises.

test_get_colored_proton_index_no_hydrogen_raises(complex_molecule_cdxml_file)[source]

Test that auto-detect raises when coloured atoms are not hydrogen.

test_get_colored_proton_index_no_unique_color_raises(single_molecule_cdxml_file_benzene)[source]

Test that auto-detect raises when all atoms share the same colour.

test_get_colored_proton_index_user_specified(colored_proton_cdxml_file)[source]

Test user-specified colour mode with phenol functional-group H.

Colour 4 is the implicit-H span colour in the phenol OH label.

test_get_pka_molecule_explicit_proton_index(colored_proton_cdxml_file)[source]

Test that an explicit proton_index bypasses colour detection.

test_get_pka_molecules_auto_implicit_h(colored_implicit_proton_cdxml_file)[source]

Auto-detection handles implicit/functional-group H (phenol OH).

test_get_pka_molecules_auto_nested_fragment_groups(pka_scale_cdxml_file)[source]

Nested ChemDraw fragment groups resolve coloured acidic protons.

test_get_pka_molecules_auto_single_fragment(colored_proton_cdxml_file)[source]

get_pka_molecules_auto returns one PKaMolecule for a single-fragment file.

test_get_pka_molecules_auto_two_fragments(colored_proton_two_molecule_cdxml_file)[source]

get_pka_molecules_auto returns two PKaMolecules with independent proton detection.

test_get_pka_molecules_delegates_to_auto(colored_proton_two_molecule_cdxml_file)[source]

get_pka_molecules() with index=’:’ and no proton args delegates to get_pka_molecules_auto().

test_get_pka_molecules_with_explicit_proton_index(colored_proton_two_molecule_cdxml_file)[source]

get_pka_molecules with explicit proton_index applies the same index to all fragments.

test_implicit_proton_removal_phenol(colored_implicit_proton_cdxml_file)[source]

End-to-end: detect phenol OH proton by colour, remove it.

Phenol (C6H6O, 13 atoms) → phenoxide (C6H5O, 12 atoms). The OH hydrogen is an implicit H on the O node, identified via the coloured “H” span in the label.

test_parse_cdxml_atom_colors(colored_implicit_proton_cdxml_file)[source]

Test that atom colours are parsed correctly from phenol.cdxml.

Phenol has 7 CDXML atoms (6 C + 1 O). The O node carries the label <s color="0">O</s><s color="4">H</s> – the “H” is rendered in colour 4 while the heavy atom keeps colour 0. parse_cdxml_atom_colors must record this in implicit_h_color.

test_parse_cdxml_atom_colors_benzene_no_color(single_molecule_cdxml_file_benzene)[source]

Test parsing benzene CDXML where all atoms have the same colour.

test_parse_cdxml_fragment_colors_single_fragment(colored_proton_cdxml_file)[source]

parse_cdxml_fragment_colors returns one sub-list for single-fragment files.

test_parse_cdxml_fragment_colors_two_fragments(colored_proton_two_molecule_cdxml_file)[source]

parse_cdxml_fragment_colors returns two sub-lists for two-fragment files.

test_proton_removal_phenol(colored_proton_cdxml_file)[source]

Test that the coloured proton can be removed from the molecule. The coloured proton is an explicit node in the CDXML, so should be removed as a normal atom. Phenol (C6H6O, 13 atoms) → phenoxide (C6H5O, 12 atoms).

tests.test_utils module

class tests.test_utils.TestDeduplicateStringKeywords[source]

Bases: object

Tests for deduplicate_string_keywords utility function.

test_args_and_bare_keyword_keeps_args_form()[source]

When keyword(args) appears before the bare keyword, keyword(args) is kept.

test_bare_and_args_keyword_keeps_args_form()[source]

When bare keyword and keyword(args) both appear, keyword(args) is kept.

test_bare_keyword_duplicate_keeps_first()[source]

When a bare keyword appears twice, the first occurrence is kept.

test_case_insensitive_matching()[source]

Matching is case-insensitive.

test_docstring_example()[source]

Reproduce the example given in the docstring.

test_empty_keywords_list_returns_unchanged()[source]

Route string is returned unchanged when keywords is an empty list.

test_empty_keywords_returns_unchanged()[source]

Route string is returned unchanged when keywords is empty.

test_empty_route_string_returns_unchanged()[source]

Empty route string is returned as-is regardless of keywords.

test_keyword_as_list()[source]

Keywords can be passed as a list.

test_keyword_as_string()[source]

A single keyword can be passed as a string.

test_keyword_as_tuple()[source]

Keywords can be passed as a tuple.

test_keyword_not_present_returns_unchanged()[source]

Route string is returned unchanged when the keyword is not present.

test_keyword_with_longer_args_preferred_over_shorter()[source]

When keyword appears twice with args, the longer args form is kept.

test_mixed_case_keyword_argument()[source]

The keyword argument itself is matched case-insensitively.

test_multiple_keywords_deduplicated()[source]

Multiple keywords are all deduplicated in one pass.

test_no_duplicates_returns_unchanged()[source]

Route string without duplicates is returned unchanged.

test_none_route_string_returns_unchanged()[source]

None route string is returned as-is.

test_three_bare_duplicates_keeps_first()[source]

When a bare keyword appears three times, only the first is kept.

test_unrelated_tokens_preserved()[source]

Tokens not in the keyword list are always preserved.

class tests.test_utils.TestGetListFromStringRange[source]

Bases: object

test_get_list_from_string()[source]
test_get_list_from_string_range()[source]
class tests.test_utils.TestIOUtilities[source]

Bases: object

test_basic_conversion(input_str, expected)[source]
test_clean_duplicate_structure()[source]
test_clean_label()[source]
test_conversion_strips_whitespace()[source]
test_create_molecule_list()[source]
test_header_like_then_data_like()[source]
test_line_of_all_integers(line, allow_sign, expected)[source]
test_line_of_integer_followed_by_floats(line, expected)[source]
test_raises_value_error_on_empty_or_invalid_input(bad_input)[source]
test_reject_plain_ints_as_floats()[source]
test_trailing_and_leading_spaces()[source]
test_trailing_comma_is_ignored()[source]
class tests.test_utils.TestNaturallySorted[source]

Bases: object

test_alphanumeric()[source]

Test sorting alphanumeric strings.

test_empty_list()[source]

Test sorting an empty list.

test_file_names()[source]

Test sorting typical file names.

test_large_numbers()[source]

Test sorting with large numbers.

test_mixed_case()[source]

Test sorting with mixed case letters.

test_mixed_types()[source]

Test sorting with mixed formats (numbers, letters, and empty strings).

test_no_numbers()[source]

Test sorting strings without numbers.

test_numeric_order()[source]

Test sorting strings with numbers in natural order.

test_single_item()[source]

Test sorting a list with one item.

test_special_characters()[source]

Test sorting with special characters.

class tests.test_utils.TestPKaTableParsing[source]

Bases: object

Tests for the pKa table parsing utility functions.

test_discover_pka_reference_companion_outputs(tmp_path)[source]

analyze should discover HRef companion files from the HRef gas output.

test_discover_pka_target_companion_outputs_matches_batch_suffixes(tmp_path)[source]

analyze auto-discovery should use the same suffixes as batch-analyze.

test_echo_pka_output_table_results_writes_same_table_to_file(tmp_path)[source]

batch-analyze -O should write the same table echoed to stdout.

test_export_pka_results_table_direct_scheme(tmp_path)[source]

Direct-cycle export uses the ΔG_diss column label.

test_export_pka_results_table_matches_stdout_format(tmp_path)[source]

-O output should match the formatted batch table printed to stdout.

test_parse_and_resolve_multi_row_table(tmp_path)[source]

End-to-end test: parse → resolve → validate on a multi-row table.

test_parse_pka_output_table_alias_columns(tmp_path)[source]

Test that aliased column names (e.g., HA_optimization_output) work.

test_parse_pka_output_table_csv(tmp_path)[source]

Test parsing a CSV output table with canonical column names.

test_parse_pka_output_table_empty(tmp_path)[source]

Test that an empty output table raises ValueError.

test_parse_pka_output_table_empty_cells_become_none(tmp_path)[source]

Blank CSV cells must not remain as float NaN in parsed entries.

test_parse_pka_output_table_file_not_found()[source]

Test that a missing table file raises FileNotFoundError.

test_parse_pka_table_blank_proton_index_for_cdxml(tmp_path, colored_proton_cdxml_file)[source]

Blank proton_index is allowed for single-molecule CDXML table rows.

test_parse_pka_table_blank_proton_index_for_xyz_raises(tmp_path)[source]

Blank proton_index is rejected for non-CDXML table rows.

test_parse_pka_table_csv(tmp_path)[source]

Test parsing a comma-delimited .csv table file.

test_parse_pka_table_empty_raises(tmp_path)[source]

Test that empty table raises ValueError.

test_parse_pka_table_file_not_found()[source]

Test that missing file raises FileNotFoundError.

test_parse_pka_table_invalid_column_count(tmp_path)[source]

Test that invalid column count raises ValueError.

test_parse_pka_table_invalid_integer(tmp_path)[source]

Test that invalid integer values raise ValueError.

test_parse_pka_table_skip_comments_and_empty_lines(tmp_path)[source]

Test that comments and empty lines are skipped.

test_parse_pka_table_txt(tmp_path)[source]

Test parsing a whitespace-delimited .txt table file.

test_pka_output_table_entry_repr()[source]

Test PKaOutputTableEntry string representation.

test_pka_output_table_entry_resolve_filenames_gaussian_log(tmp_path, monkeypatch)[source]

Blank result-file cells resolve to Gaussian <basename>_<suffix>.log files.

test_pka_output_table_entry_resolve_filenames_orca_default_extension(tmp_path, monkeypatch)[source]

ORCA reference paths default missing basename outputs to .out.

test_pka_output_table_entry_resolve_filenames_orca_out(tmp_path, monkeypatch)[source]

Blank result-file cells resolve to ORCA <basename>_<suffix>.out files.

test_pka_output_table_entry_to_dict()[source]

Test to_dict returns all stored data.

test_pka_output_table_entry_validate_missing_basename()[source]

Test validation catches missing basename.

test_pka_output_table_entry_validate_missing_file(tmp_path)[source]

Test validation catches missing files.

test_pka_output_table_entry_validate_valid(tmp_path)[source]

Test validation passes for a complete, valid entry.

test_pka_output_table_prepare_autodetects_files_and_inherits_references(tmp_path, monkeypatch)[source]

prepare() auto-discovers output files and carries forward references.

test_pka_output_table_run_pka(tmp_path)[source]

PKaOutputTable owns parsing, validation, and pKa execution.

test_pka_output_table_run_pka_direct(tmp_path)[source]

PKaOutputTable supports direct-cycle batch analysis.

test_pka_table_entry_alias_resolution(tmp_path)[source]

Alias resolution should keep backward-compatible attribute access.

test_pka_table_entry_dict_and_kwargs_helpers()[source]

to_dict/to_kwargs should support forwarding to downstream settings.

test_pka_table_entry_from_headers_and_row_dynamic()[source]
test_pka_table_entry_repr()[source]

Test PKaTableEntry string representation.

test_pka_table_entry_validate_invalid_multiplicity(tmp_path)[source]

Test PKaTableEntry validation catches invalid multiplicity.

test_pka_table_entry_validate_invalid_proton_index(tmp_path)[source]

Test PKaTableEntry validation catches invalid proton_index.

test_pka_table_entry_validate_missing_file(tmp_path)[source]

Test PKaTableEntry validation catches missing files.

test_resolve_pka_output_references_carry_forward(tmp_path)[source]

Test that blank reference cells are filled from the previous row.

test_resolve_pka_output_references_first_row_blank_raises()[source]

Test that blank reference in first row raises ValueError.

test_resolve_pka_output_references_partial_carry_forward()[source]

Test carry-forward when only some ref columns are blank.

test_validate_pka_table_entries(tmp_path)[source]

Test batch validation of PKaTableEntry list.

class tests.test_utils.TestParseIndexSpecification[source]

Bases: object

Tests for the new unified parse_index_specification function.

test_ase_style_single_indices()[source]

Test ASE-style single index specifications.

test_ase_style_slices()[source]

Test ASE-style slice specifications.

test_boundary_checking_enabled()[source]

Test boundary checking when allow_out_of_range=False.

test_duplicate_detection_enabled()[source]

Test duplicate detection when allow_duplicates=False.

test_free_format_comma_separated()[source]

Test free-format comma-separated specifications.

test_free_format_hyphen_ranges()[source]

Test free-format hyphen-based range specifications.

test_free_format_mixed()[source]

Test free-format mixed specifications.

test_free_format_with_negative_indices()[source]

Test free-format with negative indices.

test_invalid_inputs()[source]

Test that invalid inputs raise ValueError.

test_parse_index_boundary_detection_disabled()[source]

Test boundary detection when allow_out_of_range=False.

test_parse_index_boundary_detection_enabled()[source]

Test boundary detection when allow_out_of_range=True.

test_parse_index_duplicate_detection_disabled()[source]

Test duplicate detection when allow_duplicates=False.

test_parse_index_duplicate_detection_enabled()[source]

Test duplicate detection when allow_duplicates=True.

test_with_actual_lists()[source]

Test parse_index_specification with actual list indexing.

class tests.test_utils.TestReturnObjectsAndIndicesFromStringIndex[source]

Bases: object

Tests for the return_objects_and_indices_from_string_index utility function.

test_empty_list_raises_index_error()[source]

Test that accessing empty list raises IndexError.

test_index_zero_raises_value_error()[source]

Test that index 0 raises ValueError (1-based indexing required).

test_out_of_range_raises_index_error()[source]

Test that out-of-range index raises IndexError.

test_range_with_brackets()[source]

Test user-defined range with brackets.

test_single_index_last()[source]

Test single index at end of list.

test_single_index_middle()[source]

Test single index in middle of list.

test_single_index_string()[source]

Test single index as a string (1-based).

test_single_negative_index()[source]

Test negative index (last item).

test_slice_all()[source]

Test slice selecting all elements using ‘:’.

test_slice_from_beginning()[source]

Test slice from beginning to index.

test_slice_from_start()[source]

Test slice from beginning.

test_slice_range()[source]

Test slice with start and stop (1-based, exclusive stop).

test_slice_to_end()[source]

Test slice to end using open-ended slice.

test_slice_with_step()[source]

Test slice with step parameter.

test_specified_indices_5_to_8()[source]

Test that specified indices are preserved (e.g., 5:8 gives indices 5,6,7).

test_user_defined_range()[source]

Test user-defined range format (comma-separated).

test_user_defined_range_complex()[source]

Test complex user-defined range.

test_user_defined_range_with_hyphen()[source]

Test user-defined range with hyphen notation.

test_with_integer_objects()[source]

Test with list of integers as objects.

test_with_mixed_objects()[source]

Test with list of mixed types as objects.

class tests.test_utils.TestRunCommand[source]

Bases: object

Tests for the run_command utility function.

test_command_exception(mock_popen, capture_log)[source]

Test handling an exception during command execution.

test_command_failure(mock_popen, capture_log)[source]

Test running a command that fails with non-zero return code.

test_invalid_input_type(capture_log)[source]

Test handling invalid input type (neither string nor list).

test_list_command_success(mock_popen)[source]

Test running a command provided as a list with successful execution.

test_string_command_success(mock_popen)[source]

Test running a command provided as a string with successful execution.

test_string_command_with_quotes(mock_popen)[source]

Test running a string command with quoted arguments.

class tests.test_utils.TestString2Index1Based[source]

Bases: object

test_invalid_inputs()[source]
test_open_ended_slice()[source]
test_single_integer()[source]
test_slice()[source]
test_slice_with_step()[source]
class tests.test_utils.TestUtils[source]

Bases: object

test_cmp_with_ignore_list(gaussian_written_opt_file, gaussian_written_opt_file_with_route)[source]
test_cmp_with_ignore_string(gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file, gaussian_written_sp_from_nhc_singlet_log_with_custom_basis_from_api_file_v2)[source]
test_content_blocking(gaussian_opt_inputfile)[source]
test_get_indices_from_string()[source]

Test the conversion of string indices to a list of integers; 1-based indices.

test_get_list_from_string_range()[source]
test_get_range_from_list()[source]
test_is_float()[source]
test_iterative_compare_list_of_dicts()[source]
test_iterative_compare_list_of_elements()[source]
test_iterative_compare_list_of_lists()[source]
test_iterative_compare_list_of_string()[source]
test_iterative_compare_list_of_tuples()[source]

Module contents