repo_id
stringclasses
400 values
commit_sha
stringclasses
400 values
commit_index
int32
0
951
in_repo_split
stringclasses
1 value
cross_repo_split
stringclasses
1 value
test_file
stringlengths
7
121
test_function
stringlengths
1
108
assertion_type
stringclasses
32 values
difficulty
stringclasses
8 values
context_lines
int32
3
600
prefix
large_stringlengths
44
113k
target
large_stringlengths
1
498
anchor_sha
stringclasses
400 values
anchor_index
int32
0
951
qna_source
stringclasses
1 value
MinishLab/semhash
feccbb996fb29193929bcfd98ee6ad24a8855b9d
15
train
train
tests/test_utils.py
test_to_frozendict
assert
func_call
19
import numpy as np import pytest from frozendict import frozendict from semhash.utils import ( Encoder, compute_candidate_limit, featurize, prepare_records, remove_exact_duplicates, to_frozendict, ) def test_to_frozendict() -> None: """Test converting dict to frozendict.""" record = {"...
frozendict({"a": "1", "c": "3"})
feccbb996fb29193929bcfd98ee6ad24a8855b9d
15
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_nodes.py
test_create_stub
assert
numeric_literal
20
import pytest from aizynthfinder.search.breadth_first.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer def setup_root(default_config): def wrapper(smiles): return MoleculeNode.create_root(smiles, config=default_config) return wrapper def...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_nodes.py
test_create_stub
assert
numeric_literal
21
import pytest from aizynthfinder.search.breadth_first.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer def setup_root(default_config): def wrapper(smiles): return MoleculeNode.create_root(smiles, config=default_config) return wrapper def...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_search.py
test_one_iteration
assert
numeric_literal
26
import random import pytest from aizynthfinder.search.breadth_first.search_tree import SearchTree def test_one_iteration(default_config, setup_policies, setup_stock): root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F", "O"] child2_sm...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_search.py
test_one_iteration
assert
numeric_literal
30
import random import pytest from aizynthfinder.search.breadth_first.search_tree import SearchTree def test_one_iteration(default_config, setup_policies, setup_stock): root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F", "O"] child2_sm...
6
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_search.py
test_search_incomplete
assert
numeric_literal
32
import random import pytest from aizynthfinder.search.breadth_first.search_tree import SearchTree def test_search_incomplete(default_config, setup_policies, setup_stock): root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F", "O"] child...
8
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_search.py
test_routes
assert
numeric_literal
34
import random import pytest from aizynthfinder.search.breadth_first.search_tree import SearchTree def test_routes(default_config, setup_policies, setup_stock): random.seed(666) root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["O", "CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F"]...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_mol.py
test_fingerprint
assert
numeric_literal
10
import pytest from rdkit import Chem from aizynthfinder.chem import MoleculeException, Molecule def test_fingerprint(): mol = Molecule(smiles="O") assert sum(mol.fingerprint(2)) ==
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_reaction.py
test_fwd_reaction
assert
numeric_literal
24
from aizynthfinder.chem import ( Molecule, UniqueMolecule, TreeMolecule, Reaction, TemplatedRetroReaction, FixedRetroReaction, SmilesBasedRetroReaction, hash_reactions, MoleculeException, ) from aizynthfinder.reactiontree import ReactionTree def test_fwd_reaction(): mol1 = Molec...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_serialization.py
test_deserialize_tree_mols
assert
numeric_literal
22
from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.chem import Molecule, TreeMolecule def test_deserialize_tree_mols(): store = { 123: { "smiles": "CCC", "class": "TreeMolecule", "parent": None, "transform...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_serialization.py
test_deserialize_tree_mols
assert
numeric_literal
23
from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.chem import Molecule, TreeMolecule def test_deserialize_tree_mols(): store = { 123: { "smiles": "CCC", "class": "TreeMolecule", "parent": None, "transform...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_collection.py
test_empty_collection
assert
numeric_literal
9
import pytest from aizynthfinder.context.collection import ContextCollection def test_empty_collection(): collection = StringCollection() assert len(collection) ==
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_collection.py
test_add_single_item
assert
numeric_literal
11
import pytest from aizynthfinder.context.collection import ContextCollection def test_add_single_item(): collection = StringCollection() collection.load("key1", "value1") assert len(collection) ==
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_collection.py
test_deselect_all
assert
numeric_literal
12
import pytest from aizynthfinder.context.collection import ContextCollection def test_deselect_all(): collection = StringCollection() collection.load("key1", "value1") collection.load("key2", "value2") collection.selection = ("key1", "key2") assert len(collection) ==
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mcts_config.py
test_get_properties
assert
numeric_literal
15
import pytest from aizynthfinder.context.config import Configuration from aizynthfinder.aizynthfinder import AiZynthFinder def test_get_properties(default_config): config = default_config props = config.properties # Just check a few properties assert props["C"] == 1.4 assert props["time_limit"] ...
6
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mol_cost.py
test_load_cost
assert
numeric_literal
12
from aizynthfinder.context.cost import ( ZeroMoleculeCost, MoleculeCost, ) from aizynthfinder.chem import Molecule def test_load_cost(): cost = MoleculeCost() cost.load(ZeroMoleculeCost()) assert len(cost) ==
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_policy.py
test_load_templated_expansion_policy
assert
numeric_literal
22
import pytest import numpy as np from aizynthfinder.chem import ( TreeMolecule, SmilesBasedRetroReaction, TemplatedRetroReaction, ) from aizynthfinder.context.policy import ( TemplateBasedExpansionStrategy, QuickKerasFilter, ReactantsCountFilter, ) from aizynthfinder.utils.exceptions import Rej...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_policy.py
test_reactants_count_rejection
assert
numeric_literal
26
import pytest import numpy as np from aizynthfinder.chem import ( TreeMolecule, SmilesBasedRetroReaction, TemplatedRetroReaction, ) from aizynthfinder.context.policy import ( TemplateBasedExpansionStrategy, QuickKerasFilter, ReactantsCountFilter, ) from aizynthfinder.utils.exceptions import Rej...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_score.py
test_template_occurrence_scorer_no_metadata
assert
numeric_literal
24
import pytest import numpy as np from aizynthfinder.context.scoring import ( StateScorer, NumberOfReactionsScorer, AverageTemplateOccurrenceScorer, NumberOfPrecursorsScorer, NumberOfPrecursorsInStockScorer, PriceSumScorer, RouteCostScorer, ScorerCollection, ScorerException, ) from a...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_score.py
test_template_occurrence_scorer
assert
numeric_literal
28
import pytest import numpy as np from aizynthfinder.context.scoring import ( StateScorer, NumberOfReactionsScorer, AverageTemplateOccurrenceScorer, NumberOfPrecursorsScorer, NumberOfPrecursorsInStockScorer, PriceSumScorer, RouteCostScorer, ScorerCollection, ScorerException, ) from a...
5
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_score.py
test_scorers_one_mcts_node
assert
numeric_literal
26
import pytest import numpy as np from aizynthfinder.context.scoring import ( StateScorer, NumberOfReactionsScorer, AverageTemplateOccurrenceScorer, NumberOfPrecursorsScorer, NumberOfPrecursorsInStockScorer, PriceSumScorer, RouteCostScorer, ScorerCollection, ScorerException, ) from a...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_score.py
test_scoring_branched_mcts_tree
assert
numeric_literal
24
import pytest import numpy as np from aizynthfinder.context.scoring import ( StateScorer, NumberOfReactionsScorer, AverageTemplateOccurrenceScorer, NumberOfPrecursorsScorer, NumberOfPrecursorsInStockScorer, PriceSumScorer, RouteCostScorer, ScorerCollection, ScorerException, ) from a...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_stock.py
test_load_stock
assert
numeric_literal
21
import pytest import sys from aizynthfinder.chem import Molecule from aizynthfinder.context.stock import ( StockException, ) from aizynthfinder.tools.make_stock import ( extract_plain_smiles, extract_smiles_from_module, make_hdf5_stock, make_mongo_stock, ) def test_load_stock(default_config, creat...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_stock.py
test_extract_smiles_from_plain_file
assert
numeric_literal
21
import pytest import sys from aizynthfinder.chem import Molecule from aizynthfinder.context.stock import ( StockException, ) from aizynthfinder.tools.make_stock import ( extract_plain_smiles, extract_smiles_from_module, make_hdf5_stock, make_mongo_stock, ) def test_extract_smiles_from_plain_file(c...
8
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_stock.py
test_extract_smiles_from_module
assert
numeric_literal
28
import pytest import sys from aizynthfinder.chem import Molecule from aizynthfinder.context.stock import ( StockException, ) from aizynthfinder.tools.make_stock import ( extract_plain_smiles, extract_smiles_from_module, make_hdf5_stock, make_mongo_stock, ) def test_extract_smiles_from_module(creat...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/dfpn/test_nodes.py
test_create_root_node
assert
numeric_literal
19
import pytest from aizynthfinder.search.dfpn.nodes import MoleculeNode, BIG_INT from aizynthfinder.search.dfpn import SearchTree def setup_root(default_config): def wrapper(smiles): owner = SearchTree(default_config) return MoleculeNode.create_root(smiles, config=default_config, owner=owner) ...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/dfpn/test_nodes.py
test_expand_reaction_node
assert
numeric_literal
24
import pytest from aizynthfinder.search.dfpn.nodes import MoleculeNode, BIG_INT from aizynthfinder.search.dfpn import SearchTree def setup_root(default_config): def wrapper(smiles): owner = SearchTree(default_config) return MoleculeNode.create_root(smiles, config=default_config, owner=owner) ...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/dfpn/test_search.py
test_search
assert
numeric_literal
30
import random import pytest from aizynthfinder.search.dfpn.search_tree import SearchTree def test_search(default_config, setup_policies, setup_stock): root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F", "O"] child2_smi = ["CN1CCC(Cl)...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/dfpn/test_search.py
test_search
assert
numeric_literal
39
import random import pytest from aizynthfinder.search.dfpn.search_tree import SearchTree def test_search(default_config, setup_policies, setup_stock): root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F", "O"] child2_smi = ["CN1CCC(Cl)...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_node.py
test_expand_root_node
assert
numeric_literal
8
def test_expand_root_node(setup_mcts_search): root, _, _ = setup_mcts_search root.expand() view = root.children_view() assert len(view["actions"]) ==
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_node.py
test_promising_child_of_root
assert
numeric_literal
11
def test_promising_child_of_root(setup_mcts_search): root, _, _ = setup_mcts_search root.expand() child = root.promising_child() view = root.children_view() assert view["objects"][0] is child assert root.children == [child] assert root[child]["visitations"] ==
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_serialization.py
test_serialize_deserialize_state
assert
numeric_literal
15
from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.chem import TreeMolecule from aizynthfinder.search.mcts import MctsState from aizynthfinder.search.mcts import MctsNode from aizynthfinder.search.mcts import MctsSearchTree def test_serialize_deserialize_state(defa...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_tree.py
test_route_to_node
assert
numeric_literal
7
def test_route_to_node(setup_complete_mcts_tree): tree, nodes = setup_complete_mcts_tree actions, route_nodes = nodes[2].path_to() assert len(actions) ==
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_tree.py
test_route_to_node
assert
numeric_literal
8
def test_route_to_node(setup_complete_mcts_tree): tree, nodes = setup_complete_mcts_tree actions, route_nodes = nodes[2].path_to() assert len(actions) == 2 assert len(nodes) ==
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_one_iteration
assert
numeric_literal
12
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_one_iteration(setup_search_tree): tree = setup_search_tree tree.one_iteration() assert len(tree.root.children) ==
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_one_iteration
assert
numeric_literal
13
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_one_iteration(setup_search_tree): tree = setup_search_tree tree.one_iteration() assert len(tree.root.children) == 1 assert len(tree.root.chil...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_one_iteration_filter_unfeasible
assert
numeric_literal
13
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_one_iteration_filter_unfeasible(setup_search_tree): tree = setup_search_tree smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1>>CN1CCC(Cl)CC1.N#Cc1ccc...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_one_expansion_with_finder
assert
numeric_literal
24
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_one_expansion_with_finder(setup_aizynthfinder): """ Test the building of this tree: root | child 1 ...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_one_expansion_with_finder
assert
numeric_literal
38
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_one_expansion_with_finder(setup_aizynthfinder): """ Test the building of this tree: root | child 1 ...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_cost.py
test_load_cost_from_config
assert
numeric_literal
18
import numpy as np import pytest from aizynthfinder.context.cost import MoleculeCost from aizynthfinder.search.retrostar.cost import RetroStarCost from aizynthfinder.chem import Molecule def test_load_cost_from_config(setup_mocked_model): cost = MoleculeCost() dict_ = { "aizynthfinder.search.retrost...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_nodes.py
test_create_root_node
assert
numeric_literal
12
import numpy as np import networkx as nx from aizynthfinder.search.retrostar.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.search.andor_trees import ReactionTreeFromAndOrTrace def test_create_root_node(setup_star_root): node = se...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_nodes.py
test_create_stub
assert
numeric_literal
16
import numpy as np import networkx as nx from aizynthfinder.search.retrostar.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.search.andor_trees import ReactionTreeFromAndOrTrace def test_create_stub(setup_star_root, get_action): ro...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_nodes.py
test_create_stub
assert
numeric_literal
17
import numpy as np import networkx as nx from aizynthfinder.search.retrostar.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.search.andor_trees import ReactionTreeFromAndOrTrace def test_create_stub(setup_star_root, get_action): ro...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_nodes.py
test_converstion_to_reaction_tree
assert
numeric_literal
27
import numpy as np import networkx as nx from aizynthfinder.search.retrostar.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.search.andor_trees import ReactionTreeFromAndOrTrace def test_converstion_to_reaction_tree( setup_star_roo...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_sort_nodes
assert
numeric_literal
19
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
5
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_sort_nodes
assert
numeric_literal
24
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_sort_nodes_return_all
assert
numeric_literal
19
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_sort_nodes_scorer
assert
numeric_literal
20
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_tree_statistics
assert
numeric_literal
20
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
6
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_tree_statistics
assert
numeric_literal
27
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_tree_statistics_andor_tree
assert
numeric_literal
26
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_analysis.py
test_create_route_collection_full
assert
numeric_literal
22
import os from tarfile import TarFile import numpy as np import pytest from aizynthfinder.analysis import TreeAnalysis, RouteCollection from aizynthfinder.analysis.utils import RouteSelectionArguments from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES from aizynthfinder.search.mcts import MctsSear...
8
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_cli.py
test_app_main_no_output
assert
numeric_literal
34
import os import glob import sys import pandas as pd import yaml import pytest from aizynthfinder.interfaces import AiZynthApp from aizynthfinder.interfaces.aizynthapp import main as app_main from aizynthfinder.interfaces.aizynthcli import main as cli_main from aizynthfinder.tools.make_stock import main as make_stock...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_cli.py
test_cli_multiple_smiles
assert
numeric_literal
49
import os import glob import sys import pandas as pd import yaml import pytest from aizynthfinder.interfaces import AiZynthApp from aizynthfinder.interfaces.aizynthapp import main as app_main from aizynthfinder.interfaces.aizynthcli import main as cli_main from aizynthfinder.tools.make_stock import main as make_stock...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_cli.py
test_cli_multiple_smiles_unsanitizable
assert
numeric_literal
39
import os import glob import sys import pandas as pd import yaml import pytest from aizynthfinder.interfaces import AiZynthApp from aizynthfinder.interfaces.aizynthapp import main as app_main from aizynthfinder.interfaces.aizynthcli import main as cli_main from aizynthfinder.tools.make_stock import main as make_stock...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_cli.py
test_make_stock_from_plain_file
assert
numeric_literal
31
import os import glob import sys import pandas as pd import yaml import pytest from aizynthfinder.interfaces import AiZynthApp from aizynthfinder.interfaces.aizynthapp import main as app_main from aizynthfinder.interfaces.aizynthcli import main as cli_main from aizynthfinder.tools.make_stock import main as make_stock...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_cli.py
test_preprocess_expansion
assert
numeric_literal
37
import os import glob import sys import pandas as pd import yaml import pytest from aizynthfinder.interfaces import AiZynthApp from aizynthfinder.interfaces.aizynthapp import main as app_main from aizynthfinder.interfaces.aizynthcli import main as cli_main from aizynthfinder.tools.make_stock import main as make_stock...
6
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_cli.py
test_preprocess_expansion_csv_headers
assert
numeric_literal
42
import os import glob import sys import pandas as pd import yaml import pytest from aizynthfinder.interfaces import AiZynthApp from aizynthfinder.interfaces.aizynthapp import main as app_main from aizynthfinder.interfaces.aizynthcli import main as cli_main from aizynthfinder.tools.make_stock import main as make_stock...
7
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_expander.py
test_expander_defaults
assert
numeric_literal
11
from aizynthfinder.aizynthfinder import AiZynthExpander def test_expander_defaults(get_one_step_expansion, setup_policies): expander = AiZynthExpander() setup_policies(get_one_step_expansion, config=expander.config) smi = "CCCCOc1ccc(CC(=O)N(C)O)cc1" reactions = expander.do_expansion(smi) assert...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_expander.py
test_expander_defaults
assert
numeric_literal
12
from aizynthfinder.aizynthfinder import AiZynthExpander def test_expander_defaults(get_one_step_expansion, setup_policies): expander = AiZynthExpander() setup_policies(get_one_step_expansion, config=expander.config) smi = "CCCCOc1ccc(CC(=O)N(C)O)cc1" reactions = expander.do_expansion(smi) assert ...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_finder.py
test_dead_end_expansion
assert
numeric_literal
22
import logging from aizynthfinder.aizynthfinder import AiZynthFinder def state_smiles(state): return [mol.smiles for mol in state.mols] def test_dead_end_expansion(setup_aizynthfinder): """ Test the building of this tree: root root cannot be expanded """ root_smi = "CN1CCC(C(=...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_finder.py
test_dead_end_expansion
assert
numeric_literal
25
import logging from aizynthfinder.aizynthfinder import AiZynthFinder def state_smiles(state): return [mol.smiles for mol in state.mols] def test_dead_end_expansion(setup_aizynthfinder): """ Test the building of this tree: root root cannot be expanded """ root_smi = "CN1CCC(C(=...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_finder.py
test_one_expansion
assert
numeric_literal
26
import logging from aizynthfinder.aizynthfinder import AiZynthFinder def state_smiles(state): return [mol.smiles for mol in state.mols] def test_one_expansion(setup_aizynthfinder): """ Test the building of this tree: root | child 1 """ root_smi = ...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_finder.py
test_two_expansions
assert
numeric_literal
31
import logging from aizynthfinder.aizynthfinder import AiZynthFinder def state_smiles(state): return [mol.smiles for mol in state.mols] def test_two_expansions(setup_aizynthfinder): """ Test the building of this tree: root | child 1 | ...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_finder.py
test_two_expansions_two_children
assert
numeric_literal
37
import logging from aizynthfinder.aizynthfinder import AiZynthFinder def state_smiles(state): return [mol.smiles for mol in state.mols] def test_two_expansions_two_children(setup_aizynthfinder): """ Test the building of this tree: root / \ child 1 chil...
5
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_finder.py
test_three_expansions
assert
numeric_literal
38
import logging from aizynthfinder.aizynthfinder import AiZynthFinder def state_smiles(state): return [mol.smiles for mol in state.mols] def test_three_expansions(setup_aizynthfinder): """ Test the building of this tree: root | child 1 | ...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_reactiontree.py
test_mcts_route_to_reactiontree
assert
numeric_literal
20
import pytest from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES def test_mcts_route_to_reactiontree(setup_linear_mcts, load_reaction_tree): def remove_metadata(tree_dict): if "metadata" in tree_dict: tree_dict["metadata"] = {} for child in tree_dict.get("children",...
5
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_reactiontree.py
test_mcts_route_to_reactiontree
assert
numeric_literal
23
import pytest from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES def test_mcts_route_to_reactiontree(setup_linear_mcts, load_reaction_tree): def remove_metadata(tree_dict): if "metadata" in tree_dict: tree_dict["metadata"] = {} for child in tree_dict.get("children",...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_reactiontree.py
test_mcts_route_to_reactiontree
assert
numeric_literal
26
import pytest from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES def test_mcts_route_to_reactiontree(setup_linear_mcts, load_reaction_tree): def remove_metadata(tree_dict): if "metadata" in tree_dict: tree_dict["metadata"] = {} for child in tree_dict.get("children",...
3
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_reactiontree.py
test_route_node_depth_from_mcts
assert
numeric_literal
10
import pytest from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES def test_route_node_depth_from_mcts(setup_branched_reaction_tree): rt = setup_branched_reaction_tree() mols = list(rt.molecules()) assert rt.depth(mols[0]) ==
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_reactiontree.py
test_route_node_depth_from_mcts
assert
numeric_literal
13
import pytest from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES def test_route_node_depth_from_mcts(setup_branched_reaction_tree): rt = setup_branched_reaction_tree() mols = list(rt.molecules()) assert rt.depth(mols[0]) == 0 assert rt.depth(mols[1]) == 2 assert rt.depth(mols[...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_reactiontree.py
test_route_node_depth_from_json
assert
numeric_literal
17
import pytest from aizynthfinder.reactiontree import ReactionTree, SUPPORT_DISTANCES def test_route_node_depth_from_json(load_reaction_tree): dict_ = load_reaction_tree("branched_route.json") rt = ReactionTree.from_dict(dict_) # Molecules loaded in a different order than when created from MCTS mols ...
6
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_training.py
test_split_and_save_data_frame
assert
numeric_literal
62
import os import pytest import pandas as pd import numpy as np from aizynthfinder.chem import Molecule def default_config(): return Config() def filter_model_sequence(mocker, default_config): mocked_load_npz = mocker.patch( "aizynthfinder.training.keras_models.sparse.load_npz" ) input_array ...
5
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_training.py
test_smiles_to_fingerprint
assert
numeric_literal
43
import os import pytest import pandas as pd import numpy as np from aizynthfinder.chem import Molecule def default_config(): return Config() def filter_model_sequence(mocker, default_config): mocked_load_npz = mocker.patch( "aizynthfinder.training.keras_models.sparse.load_npz" ) input_array ...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_training.py
test_reactants_molecules
assert
numeric_literal
43
import os import pytest import pandas as pd import numpy as np from aizynthfinder.chem import Molecule def default_config(): return Config() def filter_model_sequence(mocker, default_config): mocked_load_npz = mocker.patch( "aizynthfinder.training.keras_models.sparse.load_npz" ) input_array ...
2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/utils/test_file_utils.py
test_cat_hdf
assert
numeric_literal
41
import os import gzip import json import pytest import pandas as pd from aizynthfinder.utils.files import ( cat_datafiles, split_file, start_processes, read_datafile, save_datafile, ) def create_dummy_file(tmpdir, mocker): patched_tempfile = mocker.patch("aizynthfinder.utils.files.tempfile.mk...
4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/utils/test_image.py
test_graphviz_usage
assert
numeric_literal
40
import os import shutil import json from tarfile import TarFile from pathlib import Path import pytest from PIL import Image, ImageDraw from aizynthfinder.utils import image from aizynthfinder.chem import TreeMolecule, TemplatedRetroReaction def new_image(): img = Image.new(mode="RGB", size=(300, 300), color="wh...
0
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/utils/test_image.py
test_visjs_page
assert
numeric_literal
38
import os import shutil import json from tarfile import TarFile from pathlib import Path import pytest from PIL import Image, ImageDraw from aizynthfinder.utils import image from aizynthfinder.chem import TreeMolecule, TemplatedRetroReaction def new_image(): img = Image.new(mode="RGB", size=(300, 300), color="wh...
1
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_search.py
test_one_iteration
assert
numeric_literal
36
import random import pytest from aizynthfinder.search.breadth_first.search_tree import SearchTree def test_one_iteration(default_config, setup_policies, setup_stock): root_smi = "CN1CCC(C(=O)c2cccc(NC(=O)c3ccc(F)cc3)c2F)CC1" child1_smi = ["CN1CCC(Cl)CC1", "N#Cc1cccc(NC(=O)c2ccc(F)cc2)c1F", "O"] child2_sm...
10
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mcts_config.py
test_load_stop_criteria
assert
numeric_literal
17
import pytest from aizynthfinder.context.config import Configuration from aizynthfinder.aizynthfinder import AiZynthFinder def test_load_stop_criteria(write_yaml): filename = write_yaml( {"stock": {"stop_criteria": {"price": 100, "counts": {"C": 10}}}} ) config = Configuration.from_file(filename)...
10
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_stock.py
test_price_with_price
assert
numeric_literal
21
import pytest import sys from aizynthfinder.chem import Molecule from aizynthfinder.context.stock import ( StockException, ) from aizynthfinder.tools.make_stock import ( extract_plain_smiles, extract_smiles_from_module, make_hdf5_stock, make_mongo_stock, ) def test_price_with_price(setup_stock_wit...
14
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_split_andor_tree
assert
numeric_literal
14
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_split_andor_tree(shared_datadir, default_config): tree = SearchTree.from_json( str(shared_datadir / "andor_tree_for_clustering.json"), default_confi...
97
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_cost.py
test_retrostar_cost
assert
numeric_literal
14
import numpy as np import pytest from aizynthfinder.context.cost import MoleculeCost from aizynthfinder.search.retrostar.cost import RetroStarCost from aizynthfinder.chem import Molecule def test_retrostar_cost(setup_mocked_model): mol = Molecule(smiles="CCCC") cost = RetroStarCost(model_path="dummy", finge...
30
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_training.py
test_update_single_setting
assert
numeric_literal
43
import os import pytest import pandas as pd import numpy as np from aizynthfinder.chem import Molecule def default_config(): return Config() def filter_model_sequence(mocker, default_config): mocked_load_npz = mocker.patch( "aizynthfinder.training.keras_models.sparse.load_npz" ) input_array ...
10
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/test_training.py
test_split_and_save_data_frame
assert
numeric_literal
59
import os import pytest import pandas as pd import numpy as np from aizynthfinder.chem import Molecule def default_config(): return Config() def filter_model_sequence(mocker, default_config): mocked_load_npz = mocker.patch( "aizynthfinder.training.keras_models.sparse.load_npz" ) input_array ...
90
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mcts_config.py
test_load_from_file
assert
numeric_literal
21
import pytest from aizynthfinder.context.config import Configuration from aizynthfinder.aizynthfinder import AiZynthFinder def test_load_from_file(write_yaml): filename = write_yaml( { "properties": { "cutoff_number": 300, "post_processing": {"all_routes": True}...
300
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mcts_config.py
test_load_from_file
assert
numeric_literal
22
import pytest from aizynthfinder.context.config import Configuration from aizynthfinder.aizynthfinder import AiZynthFinder def test_load_from_file(write_yaml): filename = write_yaml( { "properties": { "cutoff_number": 300, "post_processing": {"all_routes": True}...
1.9
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mcts_config.py
test_load_from_file
assert
numeric_literal
23
import pytest from aizynthfinder.context.config import Configuration from aizynthfinder.aizynthfinder import AiZynthFinder def test_load_from_file(write_yaml): filename = write_yaml( { "properties": { "cutoff_number": 300, "post_processing": {"all_routes": True}...
200
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_mcts_config.py
test_get_properties
assert
numeric_literal
13
import pytest from aizynthfinder.context.config import Configuration from aizynthfinder.aizynthfinder import AiZynthFinder def test_get_properties(default_config): config = default_config props = config.properties # Just check a few properties assert props["C"] ==
1.4
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_serialization.py
test_chaining
assert
variable
16
from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.chem import Molecule, TreeMolecule def test_chaining(): serializer = MoleculeSerializer() mol1 = TreeMolecule(parent=None, smiles="CCC", transform=1) mol2 = TreeMolecule(smiles="CCO", parent=mol1) ...
id_
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_mol.py
test_equality
assert
variable
11
import pytest from rdkit import Chem from aizynthfinder.chem import MoleculeException, Molecule def test_equality(): mol1 = Molecule(smiles="CCCCO") mol2 = Molecule(smiles="OCCCC") assert mol1 ==
mol2
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/context/test_stock.py
test_mol_in_stock
assert
variable
20
import pytest import sys from aizynthfinder.chem import Molecule from aizynthfinder.context.stock import ( StockException, ) from aizynthfinder.tools.make_stock import ( extract_plain_smiles, extract_smiles_from_module, make_hdf5_stock, make_mongo_stock, ) def test_mol_in_stock(setup_stock_with_qu...
stock
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_node.py
test_promising_child_of_root
assert
variable
9
def test_promising_child_of_root(setup_mcts_search): root, _, _ = setup_mcts_search root.expand() child = root.promising_child() view = root.children_view() assert view["objects"][0] is
child
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/utils/test_image.py
test_rounded_rectangle
assert
variable
30
import os import shutil import json from tarfile import TarFile from pathlib import Path import pytest from PIL import Image, ImageDraw from aizynthfinder.utils import image from aizynthfinder.chem import TreeMolecule, TemplatedRetroReaction def new_image(): img = Image.new(mode="RGB", size=(300, 300), color="wh...
color
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/chem/test_reaction.py
test_create_fixed_reaction
assert
variable
21
from aizynthfinder.chem import ( Molecule, UniqueMolecule, TreeMolecule, Reaction, TemplatedRetroReaction, FixedRetroReaction, SmilesBasedRetroReaction, hash_reactions, MoleculeException, ) from aizynthfinder.reactiontree import ReactionTree def test_create_fixed_reaction(): smi...
smiles
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/mcts/test_tree.py
test_backpropagation
assert_*
variable
10
def test_backpropagation(setup_complete_mcts_tree, mocker): tree, nodes = setup_complete_mcts_tree for node in nodes: node.backpropagate = mocker.MagicMock() score = 1.5 tree.backpropagate(nodes[2], score) nodes[0].backpropagate.assert_called_once_with(nodes[1],
score)
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/dfpn/test_nodes.py
test_promising_child
assert
variable
25
import pytest from aizynthfinder.search.dfpn.nodes import MoleculeNode, BIG_INT from aizynthfinder.search.dfpn import SearchTree def setup_root(default_config): def wrapper(smiles): owner = SearchTree(default_config) return MoleculeNode.create_root(smiles, config=default_config, owner=owner) ...
BIG_INT
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/breadth_first/test_nodes.py
test_create_stub
assert
variable
23
import pytest from aizynthfinder.search.breadth_first.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer def setup_root(default_config): def wrapper(smiles): return MoleculeNode.create_root(smiles, config=default_config) return wrapper def...
reaction
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar.py
test_one_expansion_with_finder
assert
variable
25
import numpy as np from aizynthfinder.search.retrostar.search_tree import SearchTree from aizynthfinder.chem.serialization import MoleculeSerializer def test_one_expansion_with_finder(setup_aizynthfinder): """ Test the building of this tree: root | child 1 ...
root_smi
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor
MolecularAI/aizynthfinder
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
train
train
tests/retrostar/test_retrostar_nodes.py
test_create_stub
assert
variable
19
import numpy as np import networkx as nx from aizynthfinder.search.retrostar.nodes import MoleculeNode from aizynthfinder.chem.serialization import MoleculeSerializer, MoleculeDeserializer from aizynthfinder.search.andor_trees import ReactionTreeFromAndOrTrace def test_create_stub(setup_star_root, get_action): ro...
reaction
9e44989213c11f1bb647a00b8756e0c76a8f4b52
21
v2_extractor_at_anchor