← Về thư mục
tests/medchem/test_scripts.py
- molecules · function · L63-L64 — def molecules(*smiles)
- TemporaryDirectoryTestCase · class · L67-L71 — class TemporaryDirectoryTestCase(unittest.TestCase)
- setUp · method · L68-L71 — def setUp(self) -> None
- LoadMoleculesTests · class · L74-L177 — class LoadMoleculesTests(TemporaryDirectoryTestCase)
- test_a_csv_is_read_with_its_extra_columns_preserved · method · L77-L86 — def test_a_csv_is_read_with_its_extra_columns_preserved(self) -> None
- test_a_named_smiles_column_is_honoured · method · L88-L93 — def test_a_named_smiles_column_is_honoured(self) -> None
- test_a_tsv_is_split_on_tabs_not_commas · method · L95-L103 — def test_a_tsv_is_split_on_tabs_not_commas(self) -> None: # Reading a TSV with the comma separator would leave one column named # "smiles\tname", and the missing-column branch would exit instead.
- test_a_plain_text_file_treats_each_line_as_a_smiles · method · L105-L111 — def test_a_plain_text_file_treats_each_line_as_a_smiles(self) -> None
- test_an_sdf_carries_its_properties_into_the_frame · method · L113-L127 — def test_an_sdf_carries_its_properties_into_the_frame(self) -> None
- test_an_unparseable_smiles_drops_its_row_too · method · L129-L143 — def test_an_unparseable_smiles_drops_its_row_too(self) -> None: # The alignment guarantee: filter results are concatenated positionally # onto this frame, so a dropped molecule must drop its metadata row.
- test_a_file_of_only_bad_smiles_yields_nothing_rather_than_failing · method · L145-L150 — def test_a_file_of_only_bad_smiles_yields_nothing_rather_than_failing(self) -> None
- test_a_header_only_csv_loads_zero_molecules · method · L152-L157 — def test_a_header_only_csv_loads_zero_molecules(self) -> None
- test_a_missing_smiles_column_exits_rather_than_guessing · method · L159-L164 — def test_a_missing_smiles_column_exits_rather_than_guessing(self) -> None
- test_an_unsupported_extension_exits · method · L166-L171 — def test_an_unsupported_extension_exits(self) -> None
- test_the_extension_check_is_case_insensitive · method · L173-L177 — def test_the_extension_check_is_case_insensitive(self) -> None
- RuleFilterTests · class · L180-L219 — class RuleFilterTests(unittest.TestCase)
- test_rule_of_five_accepts_a_small_molecule_and_rejects_a_pentapeptide · method · L183-L187 — def test_rule_of_five_accepts_a_small_molecule_and_rejects_a_pentapeptide(self) -> None
- test_the_molecule_objects_are_not_carried_into_the_output_frame · method · L189-L193 — def test_the_molecule_objects_are_not_carried_into_the_output_frame(self) -> None: # A
mol column of RDKit objects cannot be written to CSV.
- test_several_rules_produce_one_column_each_plus_the_aggregates · method · L195-L208 — def test_several_rules_produce_one_column_each_plus_the_aggregates(self) -> None
- test_the_rule_names_the_cli_validates_against_include_the_documented_ones · method · L210-L215 — def test_the_rule_names_the_cli_validates_against_include_the_documented_ones(self) -> None: # main() warns when --rules names something outside this list, so the # list has to contain the rules SKILL.md tells the agent to ask for.
- test_an_unknown_rule_is_refused_rather_than_ignored · method · L217-L219 — def test_an_unknown_rule_is_refused_rather_than_ignored(self) -> None
- StructuralAlertTests · class · L222-L268 — class StructuralAlertTests(unittest.TestCase)
- test_common_alerts_pass_caffeine_and_exclude_catechol · method · L225-L228 — def test_common_alerts_pass_caffeine_and_exclude_catechol(self) -> None
- test_common_alerts_columns_are_renamed_to_the_passes_convention · method · L230-L237 — def test_common_alerts_columns_are_renamed_to_the_passes_convention(self) -> None: # generate_summary and --filter-output only see columns starting with #
passes_, so medchem's generic pass_filter/status must be renamed.
- test_nibr_passes_caffeine_and_excludes_catechol · method · L239-L242 — def test_nibr_passes_caffeine_and_excludes_catechol(self) -> None
- test_nibr_columns_are_renamed_too · method · L244-L248 — def test_nibr_columns_are_renamed_too(self) -> None
- test_the_pains_catalog_flags_catechol_and_leaves_caffeine_alone · method · L250-L257 — def test_the_pains_catalog_flags_catechol_and_leaves_caffeine_alone(self) -> None
- test_each_requested_catalog_is_yielded_separately · method · L259-L268 — def test_each_requested_catalog_is_yielded_separately(self) -> None: # main() pairs each yielded name with its own
passes_<name> column, so # the generator must not merge catalogs into one verdict.
- ComplexityAndQueryTests · class · L271-L303 — class ComplexityAndQueryTests(unittest.TestCase)
- test_the_complexity_column_records_the_metric_used · method · L272-L277 — def test_the_complexity_column_records_the_metric_used(self) -> None: # Two metrics in one run would collide on a fixed column name.
- test_a_generous_complexity_percentile_keeps_a_simple_molecule · method · L279-L283 — def test_a_generous_complexity_percentile_keeps_a_simple_molecule(self) -> None: # Ethanol sits at the very bottom of the ZINC-15 complexity # distribution, so a 99th-percentile ceiling cannot exclude it.
- test_a_query_can_both_admit_and_reject_molecules · method · L285-L290 — def test_a_query_can_both_admit_and_reject_molecules(self) -> None
- test_a_negated_query_inverts_the_verdict · method · L292-L296 — def test_a_negated_query_inverts_the_verdict(self) -> None
- test_a_malformed_query_raises_instead_of_admitting_everything · method · L298-L303 — def test_a_malformed_query_raises_instead_of_admitting_everything(self) -> None: # A parse failure that fell through would look like "all molecules # passed" -- the worst possible outcome for a filter.
- ChemicalGroupTests · class · L306-L323 — class ChemicalGroupTests(unittest.TestCase)
- test_one_boolean_column_is_produced_per_requested_group · method · L307-L317 — def test_one_boolean_column_is_produced_per_requested_group(self) -> None
- test_an_unrecognised_group_reports_no_matches_rather_than_raising · method · L319-L323 — def test_an_unrecognised_group_reports_no_matches_rather_than_raising(self) -> None: # Documented sharp edge: unlike --rules, group names are not validated, # so a typo yields an all-False column instead of an error.
- LillyFilterTests · class · L326-L333 — class LillyFilterTests(unittest.TestCase)
- test_a_missing_lilly_installation_yields_a_null_column_of_the_right_length · method · L327-L333 — def test_a_missing_lilly_installation_yields_a_null_column_of_the_right_length(self) -> None: # The Lilly rules are a separate conda package. When absent the script # must still return one row per molecule, or the positional concat in # main() would misalign every later column.
- SummaryReportTests · class · L336-L390 — class SummaryReportTests(TemporaryDirectoryTestCase)
- summarize · method · L339-L342 — def summarize(self, frame: "pandas.DataFrame", name: str = "results.csv") -> str
- test_counts_and_percentages_are_reported_per_filter · method · L344-L356 — def test_counts_and_percentages_are_reported_per_filter(self) -> None
- test_the_summary_sits_beside_the_output_and_takes_its_stem · method · L358-L361 — def test_the_summary_sits_beside_the_output_and_takes_its_stem(self) -> None
- test_the_aggregate_pass_all_column_is_counted_as_a_filter · method · L363-L367 — def test_the_aggregate_pass_all_column_is_counted_as_a_filter(self) -> None: # apply_rule_filters emits
pass_all, which does not start with # passes_; it is named explicitly so rule runs are summarised at all.
- test_a_non_boolean_filter_column_is_skipped_not_summed · method · L369-L379 — def test_a_non_boolean_filter_column_is_skipped_not_summed(self) -> None: # apply_lilly returns None values when the Lilly rules are missing; # summing those would raise rather than report.
- test_an_empty_result_set_does_not_divide_by_zero · method · L381-L385 — def test_an_empty_result_set_does_not_divide_by_zero(self) -> None
- test_a_frame_with_no_filter_columns_reports_only_the_total · method · L387-L390 — def test_a_frame_with_no_filter_columns_reports_only_the_total(self) -> None