← Về thư mục
tests/diffdock/test_scripts.py
- quietly · function · L57-L62 — def quietly(function, args, *kwargs)
- TemporaryDirectoryTestCase · class · L65-L69 — class TemporaryDirectoryTestCase(unittest.TestCase)
- setUp · method · L66-L69 — def setUp(self) -> None
- ConfidenceClassificationTests · class · L72-L89 — class ConfidenceClassificationTests(unittest.TestCase)
- test_the_three_published_bands · method · L75-L78 — def test_the_three_published_bands(self) -> None
- test_the_band_boundaries_fall_on_the_documented_side · method · L80-L85 — def test_the_band_boundaries_fall_on_the_documented_side(self) -> None: # Exactly 0 is not "High" -- the high band is strictly above zero -- and # exactly -1.5 is "Low", so the moderate band is (-1.5, 0].
- test_a_missing_score_is_unknown_rather_than_low · method · L87-L89 — def test_a_missing_score_is_unknown_rather_than_low(self) -> None: # A pose whose score could not be parsed must not be reported as bad.
- ConfidenceExtractionTests · class · L92-L142 — class ConfidenceExtractionTests(TemporaryDirectoryTestCase)
- test_the_score_is_read_from_the_current_filename_format · method · L93-L98 — def test_the_score_is_read_from_the_current_filename_format(self) -> None
- test_a_negative_score_keeps_its_sign · method · L100-L107 — def test_a_negative_score_keeps_its_sign(self) -> None: # Most real poses score below zero; dropping the minus sign would turn # every low-confidence pose into a high-confidence one.
- test_a_legacy_run_falls_back_to_confidence_scores_txt · method · L109-L116 — def test_a_legacy_run_falls_back_to_confidence_scores_txt(self) -> None: # Older DiffDock wrote rank_1.sdf plus one score per line, in rank order.
- test_a_rank_past_the_end_of_the_legacy_file_is_not_invented · method · L118-L122 — def test_a_rank_past_the_end_of_the_legacy_file_is_not_invented(self) -> None
- test_an_sdf_data_item_is_the_last_resort · method · L124-L130 — def test_an_sdf_data_item_is_the_last_resort(self) -> None: # The SDF data-item spelling: a
> <tag> line, then the value.
- test_an_inline_confidence_property_is_also_read · method · L132-L137 — def test_an_inline_confidence_property_is_also_read(self) -> None
- test_a_file_with_no_score_anywhere_yields_none · method · L139-L142 — def test_a_file_with_no_score_anywhere_yields_none(self) -> None
- ComplexParsingTests · class · L145-L186 — class ComplexParsingTests(TemporaryDirectoryTestCase)
- write · method · L147-L150 — def write(directory: Path, *names: str) -> None
- test_ranks_are_ordered_numerically_not_lexicographically · method · L152-L161 — def test_ranks_are_ordered_numerically_not_lexicographically(self) -> None: # "rank10" sorts before "rank2" as text; the top pose would be wrong.
- test_the_scored_filename_wins_over_the_bare_one_for_the_same_rank · method · L163-L169 — def test_the_scored_filename_wins_over_the_bare_one_for_the_same_rank(self) -> None: # A run can leave both spellings behind; keeping the unscored one would # silently drop the confidence for that rank.
- test_a_directory_without_pose_files_parses_to_nothing · method · L171-L173 — def test_a_directory_without_pose_files_parses_to_nothing(self) -> None
- test_a_single_complex_directory_is_reported_under_one_key · method · L175-L178 — def test_a_single_complex_directory_is_reported_under_one_key(self) -> None
- test_a_batch_directory_is_keyed_by_subdirectory_name · method · L180-L186 — def test_a_batch_directory_is_keyed_by_subdirectory_name(self) -> None
- TopPredictionTests · class · L189-L222 — class TopPredictionTests(unittest.TestCase)
- results · method · L191-L202 — def results(*entries)
- test_the_best_poses_are_ranked_across_every_complex · method · L204-L213 — def test_the_best_poses_are_ranked_across_every_complex(self) -> None
- test_unscored_poses_are_excluded_rather_than_sorted_as_zero · method · L215-L218 — def test_unscored_poses_are_excluded_rather_than_sorted_as_zero(self) -> None
- test_asking_for_more_than_exists_returns_what_exists · method · L220-L222 — def test_asking_for_more_than_exists_returns_what_exists(self) -> None
- CsvExportTests · class · L225-L248 — class CsvExportTests(TemporaryDirectoryTestCase)
- test_every_pose_becomes_one_row_with_its_band · method · L226-L248 — def test_every_pose_becomes_one_row_with_its_band(self) -> None
- SummaryFilterTests · class · L251-L289 — class SummaryFilterTests(unittest.TestCase)
- test_without_a_threshold_every_pose_is_listed · method · L262-L265 — def test_without_a_threshold_every_pose_is_listed(self) -> None
- test_a_threshold_keeps_the_poses_at_or_above_it · method · L267-L273 — def test_a_threshold_keeps_the_poses_at_or_above_it(self) -> None: # Inclusive at the boundary: -1.0 survives a threshold of -1.0.
- test_a_threshold_drops_lower_and_unscored_poses · method · L275-L280 — def test_a_threshold_drops_lower_and_unscored_poses(self) -> None
- test_top_n_truncates_the_listing · method · L282-L285 — def test_top_n_truncates_the_listing(self) -> None
- test_an_empty_complex_is_reported_rather_than_skipped · method · L287-L289 — def test_an_empty_complex_is_reported_rather_than_skipped(self) -> None
- SmilesValidationTests · class · L292-L309 — class SmilesValidationTests(unittest.TestCase)
- setUp · method · L293-L295 — def setUp(self) -> None
- test_a_real_drug_smiles_is_accepted · method · L297-L299 — def test_a_real_drug_smiles_is_accepted(self) -> None
- test_a_malformed_smiles_is_rejected · method · L301-L305 — def test_a_malformed_smiles_is_rejected(self) -> None: # An unclosed ring bond: RDKit returns None rather than raising.
- test_an_impossible_valence_is_rejected · method · L307-L309 — def test_an_impossible_valence_is_rejected(self) -> None
- FilePathValidationTests · class · L312-L338 — class FilePathValidationTests(TemporaryDirectoryTestCase)
- test_an_existing_file_passes · method · L313-L316 — def test_an_existing_file_passes(self) -> None
- test_a_missing_file_is_named_in_the_message · method · L318-L321 — def test_a_missing_file_is_named_in_the_message(self) -> None
- test_a_relative_path_resolves_against_the_base_directory · method · L323-L331 — def test_a_relative_path_resolves_against_the_base_directory(self) -> None: # Without the base directory the same path is looked up in the process # working directory, where it does not exist.
- test_an_empty_path_is_allowed_because_a_sequence_may_replace_it · method · L333-L338 — def test_an_empty_path_is_allowed_because_a_sequence_may_replace_it(self) -> None
- BatchCsvValidationTests · class · L341-L440 — class BatchCsvValidationTests(TemporaryDirectoryTestCase)
- write_csv · method · L344-L347 — def write_csv(self, *rows: str) -> Path
- test_a_usable_csv_passes_without_complaint · method · L349-L358 — def test_a_usable_csv_passes_without_complaint(self) -> None
- test_a_sequence_only_row_needs_no_protein_file · method · L360-L363 — def test_a_sequence_only_row_needs_no_protein_file(self) -> None
- test_a_row_with_neither_protein_input_is_rejected · method · L365-L370 — def test_a_row_with_neither_protein_input_is_rejected(self) -> None
- test_a_missing_complex_name_is_reported · method · L372-L377 — def test_a_missing_complex_name_is_reported(self) -> None
- test_a_missing_protein_file_is_reported_with_its_row · method · L379-L385 — def test_a_missing_protein_file_is_reported_with_its_row(self) -> None
- test_a_missing_ligand_description_is_reported · method · L387-L392 — def test_a_missing_ligand_description_is_reported(self) -> None
- test_a_ligand_path_is_checked_as_a_file_not_as_smiles · method · L394-L401 — def test_a_ligand_path_is_checked_as_a_file_not_as_smiles(self) -> None: # Anything containing a separator is treated as a path, so a missing # SDF must be reported as a file problem rather than as bad chemistry.
- test_both_protein_inputs_together_warn_but_still_validate · method · L403-L408 — def test_both_protein_inputs_together_warn_but_still_validate(self) -> None
- test_a_missing_column_is_reported_instead_of_raising · method · L410-L420 — def test_a_missing_column_is_reported_instead_of_raising(self) -> None: # Regression: the per-row checks index protein_path directly, so a CSV # without that column used to abort with KeyError.
- test_an_unreadable_csv_is_reported_not_raised · method · L422-L425 — def test_an_unreadable_csv_is_reported_not_raised(self) -> None
- test_a_header_only_csv_is_vacuously_valid · method · L427-L431 — def test_a_header_only_csv_is_vacuously_valid(self) -> None
- test_an_invalid_smiles_row_fails_validation · method · L433-L440 — def test_an_invalid_smiles_row_fails_validation(self) -> None
- TemplateCsvTests · class · L443-L467 — class TemplateCsvTests(TemporaryDirectoryTestCase)
- test_the_template_carries_the_four_columns_diffdock_requires · method · L444-L451 — def test_the_template_carries_the_four_columns_diffdock_requires(self) -> None
- test_the_requested_number_of_example_rows_is_written · method · L453-L455 — def test_the_requested_number_of_example_rows_is_written(self) -> None
- test_only_three_examples_exist_so_larger_requests_are_capped · method · L457-L461 — def test_only_three_examples_exist_so_larger_requests_are_capped(self) -> None: # The CLI advertises 1-3; asking for more must not produce empty rows.
- test_the_first_example_ligand_is_a_parseable_molecule · method · L463-L467 — def test_the_first_example_ligand_is_a_parseable_molecule(self) -> None
- ShippedTemplateAssetTests · class · L470-L499 — class ShippedTemplateAssetTests(unittest.TestCase)
- setUp · method · L473-L475 — def setUp(self) -> None
- test_it_declares_the_columns_the_validator_requires · method · L477-L481 — def test_it_declares_the_columns_the_validator_requires(self) -> None
- test_every_row_supplies_a_protein_by_path_or_by_sequence · method · L483-L489 — def test_every_row_supplies_a_protein_by_path_or_by_sequence(self) -> None
- test_every_smiles_in_the_asset_parses · method · L491-L499 — def test_every_smiles_in_the_asset_parses(self) -> None
- PythonVersionCheckTests · class · L502-L525 — class PythonVersionCheckTests(unittest.TestCase)
- version · method · L504-L507 — def version(major: int, minor: int, micro: int = 0)
- test_the_upstream_minimum_of_three_nine_passes · method · L509-L514 — def test_the_upstream_minimum_of_three_nine_passes(self) -> None: # DiffDock's environment.yml pins Python 3.9.18, so 3.9 is the floor.
- test_anything_older_fails_and_says_what_is_required · method · L516-L520 — def test_anything_older_fails_and_says_what_is_required(self) -> None
- test_a_newer_interpreter_is_accepted · method · L522-L525 — def test_a_newer_interpreter_is_accepted(self) -> None
- PackageProbeTests · class · L528-L608 — class PackageProbeTests(unittest.TestCase)
- test_a_present_package_reports_its_version · method · L529-L537 — def test_a_present_package_reports_its_version(self) -> None
- test_a_nested_version_attribute_is_followed · method · L539-L551 — def test_a_nested_version_attribute_is_followed(self) -> None: # RDKit's version lives at rdkit.rdBase.version, not on the package.
- test_a_package_without_a_version_still_counts_as_installed · method · L553-L560 — def test_a_package_without_a_version_still_counts_as_installed(self) -> None
- test_an_absent_package_is_reported_as_not_installed · method · L562-L567 — def test_an_absent_package_is_reported_as_not_installed(self) -> None
- test_torch_reports_cuda_separately_from_the_import · method · L569-L577 — def test_torch_reports_cuda_separately_from_the_import(self) -> None
- test_a_visible_gpu_is_named_in_the_report · method · L579-L592 — def test_a_visible_gpu_is_named_in_the_report(self) -> None
- test_missing_torch_reports_no_gpu_rather_than_raising · method · L594-L599 — def test_missing_torch_reports_no_gpu_rather_than_raising(self) -> None: # None in sys.modules makes
import torch raise ImportError.
- test_missing_esm_is_reported_as_optional · method · L601-L608 — def test_missing_esm_is_reported_as_optional(self) -> None
- InstallationProbeTests · class · L611-L642 — class InstallationProbeTests(TemporaryDirectoryTestCase)
- setUp · method · L612-L616 — def setUp(self) -> None
- test_an_unrelated_directory_is_not_a_diffdock_checkout · method · L618-L621 — def test_an_unrelated_directory_is_not_a_diffdock_checkout(self) -> None
- test_the_upstream_entry_points_are_what_it_looks_for · method · L623-L628 — def test_the_upstream_entry_points_are_what_it_looks_for(self) -> None
- test_absent_checkpoints_are_a_note_not_a_failure · method · L630-L635 — def test_absent_checkpoints_are_a_note_not_a_failure(self) -> None
- test_present_checkpoints_are_recognised_at_the_documented_path · method · L637-L642 — def test_present_checkpoints_are_recognised_at_the_documented_path(self) -> None
- PerformanceNoteTests · class · L645-L653 — class PerformanceNoteTests(unittest.TestCase)
- test_the_gpu_and_cpu_guidance_do_not_swap · method · L646-L653 — def test_the_gpu_and_cpu_guidance_do_not_swap(self) -> None