← Về thư mục
tests/deepchem/test_scripts.py
- parser_choices · function · L88-L112 — def parser_choices(module, destination: str) -> list[str]
- dotted_name · function · L115-L116 — def dotted_name(node: ast.AST) -> str
- keyword_constants · function · L119-L127 — def keyword_constants(source: str, callee: str, keyword: str) -> list[object]
- run_script · function · L130-L139 — def run_script(name: str, *arguments: str, cwd: Path) -> subprocess.CompletedProcess
- MolnetCatalogueTests · class · L142-L193 — class MolnetCatalogueTests(unittest.TestCase)
- test_every_dataset_name_resolves_to_a_real_molnet_loader · method · L145-L151 — def test_every_dataset_name_resolves_to_a_real_molnet_loader(self) -> None: # The regression this guards:
getattr(dc.molnet, f"load_{name}") for a # dataset DeepChem exposes only under a suffixed loader name.
- test_bace_resolves_to_the_classification_loader · method · L153-L160 — def test_bace_resolves_to_the_classification_loader(self) -> None: # DeepChem has no
load_bace; the table declares BACE a classification # benchmark, so the classification loader is the matching one.
- test_the_declared_task_types_match_the_published_benchmarks · method · L162-L172 — def test_the_declared_task_types_match_the_published_benchmarks(self) -> None: # The task type selects the metric set (ROC-AUC vs R²) and the model # mode, so calling a regression benchmark "classification" produces # numbers that look plausible and mean nothing.
- test_the_declared_task_counts_match_the_published_benchmarks · method · L174-L181 — def test_the_declared_task_counts_match_the_published_benchmarks(self) -> None
- test_the_dataset_flag_offers_exactly_the_table · method · L183-L187 — def test_the_dataset_flag_offers_exactly_the_table(self) -> None
- test_the_model_flag_offers_exactly_the_model_table · method · L189-L193 — def test_the_model_flag_offers_exactly_the_model_table(self) -> None
- ModelFactoryTests · class · L196-L224 — class ModelFactoryTests(unittest.TestCase)
- test_an_unknown_model_is_refused_by_name · method · L199-L201 — def test_an_unknown_model_is_refused_by_name(self) -> None
- test_every_advertised_model_reaches_a_branch · method · L203-L216 — def test_every_advertised_model_reaches_a_branch(self) -> None: # Constructing these needs a torch backend, which the documented install # does not always provide, so the assertion is narrower than "it works": # whatever happens, it must not be the unknown-model fall-through.
- test_every_advertised_model_has_a_human_readable_description · method · L218-L224 — def test_every_advertised_model_has_a_human_readable_description(self) -> None: # The descriptions are printed as the run banner, so an empty one leaves # the log ambiguous about what was trained.
- PretrainedCatalogueTests · class · L227-L261 — class PretrainedCatalogueTests(unittest.TestCase)
- test_the_model_flag_offers_exactly_the_pretrained_table · method · L230-L234 — def test_the_model_flag_offers_exactly_the_pretrained_table(self) -> None
- test_each_entry_carries_a_name_and_a_description · method · L236-L241 — def test_each_entry_carries_a_name_and_a_description(self) -> None
- test_the_hub_backed_models_name_a_hugging_face_repository · method · L243-L249 — def test_the_hub_backed_models_name_a_hugging_face_repository(self) -> None: # These strings are passed straight to HuggingFaceModel; a bare model # name without the owner prefix cannot be resolved.
- test_grover_declares_no_hub_id_because_it_loads_itself · method · L251-L254 — def test_grover_declares_no_hub_id_because_it_loads_itself(self) -> None: # GroverModel takes a model_dir, not a hub id; a placeholder string here # would be passed to a loader that ignores it.
- test_every_pretrained_model_has_a_fine_tuning_entry_point · method · L256-L261 — def test_every_pretrained_model_has_a_fine_tuning_entry_point(self) -> None: # main() dispatches on the key; an unhandled one falls through to a # "not yet implemented" message after the dataset has been loaded.
- MolnetFeaturizerSelectionTests · class · L264-L326 — class MolnetFeaturizerSelectionTests(unittest.TestCase)
- load · method · L267-L277 — def load(self, dataset: str, model: str, loader: str | None = None) -> dict
- stub · function · L271-L273 — def stub(**keywords)
- test_smiles_models_get_raw_strings_and_grover_gets_graphs · method · L279-L284 — def test_smiles_models_get_raw_strings_and_grover_gets_graphs(self) -> None: # ChemBERTa and MolFormer tokenise SMILES themselves; GROVER is a graph # transformer and cannot read a string.
- test_an_unrecognised_model_falls_back_to_fingerprints · method · L286-L287 — def test_an_unrecognised_model_falls_back_to_fingerprints(self) -> None
- test_every_dataset_is_loaded_with_a_scaffold_split · method · L289-L294 — def test_every_dataset_is_loaded_with_a_scaffold_split(self) -> None: # A random split shares scaffolds between train and test and inflates # every reported score, so the split must not depend on the model.
- test_every_offered_dataset_is_in_the_loader_table · method · L296-L322 — def test_every_offered_dataset_is_in_the_loader_table(self) -> None: #
--dataset and the dict inside load_molnet_dataset are written out # separately, so a name in one and not the other is a live failure -- # the CLI accepts the run and it dies on "Unknown dataset".
- stub · function · L310-L311 — def stub(**keywords)
- test_an_unknown_dataset_is_refused_before_anything_downloads · method · L324-L326 — def test_an_unknown_dataset_is_refused_before_anything_downloads(self) -> None
- CustomDatasetTests · class · L329-L375 — class CustomDatasetTests(unittest.TestCase)
- setUp · method · L332-L340 — def setUp(self) -> None
- test_the_split_is_eighty_ten_ten · method · L342-L348 — def test_the_split_is_eighty_ten_ten(self) -> None
- test_a_smiles_model_keeps_the_strings_unfeaturized · method · L350-L357 — def test_a_smiles_model_keeps_the_strings_unfeaturized(self) -> None: # DummyFeaturizer is deliberate: the tokenizer inside the model does the # featurizing, so turning the SMILES into a fingerprint here would # destroy the input it needs.
- test_a_fingerprint_model_gets_a_2048_bit_vector · method · L359-L364 — def test_a_fingerprint_model_gets_a_2048_bit_vector(self) -> None
- test_the_named_smiles_column_is_the_one_featurized · method · L366-L375 — def test_the_named_smiles_column_is_the_one_featurized(self) -> None
- SolubilityScriptTests · class · L378-L406 — class SolubilityScriptTests(unittest.TestCase)
- test_the_fingerprint_width_matches_the_regressor_input_size · method · L381-L389 — def test_the_fingerprint_width_matches_the_regressor_input_size(self) -> None: #
n_features is fixed when the model is built and size when new # molecules are featurized. A mismatch is a shape error at predict # time -- after the training run has already been paid for.
- test_the_fingerprint_radius_is_the_same_everywhere · method · L391-L396 — def test_the_fingerprint_radius_is_the_same_everywhere(self) -> None: # Training on ECFP4 and predicting with ECFP6 silently produces garbage # rather than an error, because the vector width is unchanged.
- test_the_default_target_column_is_the_delaney_column_name · method · L398-L406 — def test_the_default_target_column_is_the_delaney_column_name(self) -> None: # The function's default has to match the column in the published # Delaney (ESOL) CSV, or the benchmark path finds no target.
- ArgumentValidationTests · class · L409-L444 — class ArgumentValidationTests(unittest.TestCase)
- setUp · method · L412-L415 — def setUp(self) -> None
- test_a_gnn_run_needs_a_dataset_or_a_csv · method · L417-L420 — def test_a_gnn_run_needs_a_dataset_or_a_csv(self) -> None
- test_a_gnn_run_refuses_both_a_dataset_and_a_csv · method · L422-L429 — def test_a_gnn_run_refuses_both_a_dataset_and_a_csv(self) -> None: # Silently preferring one would train on data the user did not ask for.
- test_transfer_learning_requires_a_pretrained_model · method · L431-L435 — def test_transfer_learning_requires_a_pretrained_model(self) -> None
- test_transfer_learning_refuses_both_input_sources · method · L437-L444 — def test_transfer_learning_refuses_both_input_sources(self) -> None