├── .github ├── pull_request_template.md └── workflows │ ├── publish_release.yml │ └── tests.yml ├── .gitignore ├── .readthedocs.yml ├── LICENSE ├── README.rst ├── benchmarks ├── __init__.py └── cof │ ├── __init__.py │ └── benchmark_kagome.py ├── docs ├── Makefile └── source │ ├── _static │ └── stk.png │ ├── _templates │ ├── class.rst │ └── module.rst │ ├── basic_ea_example.rst │ ├── basic_examples.rst │ ├── cage.rst │ ├── cof.rst │ ├── conf.py │ ├── constructed_molecule_databases.rst │ ├── construction_overview.rst │ ├── crossover.rst │ ├── fitness_calculators.rst │ ├── fitness_normalizers.rst │ ├── functional_group_factories.rst │ ├── functional_groups.rst │ ├── graph_components.rst │ ├── host_guest.rst │ ├── index.rst │ ├── intermediate_ea_example.rst │ ├── key_makers.rst │ ├── metal_complex.rst │ ├── modules.rst │ ├── molecule_databases.rst │ ├── mutation.rst │ ├── optimizers.rst │ ├── plotters.rst │ ├── polymer.rst │ ├── reaction_factories.rst │ ├── reactions.rst │ ├── selection.rst │ ├── small.rst │ ├── value_databases.rst │ ├── video_tutorials.rst │ └── writers.rst ├── justfile ├── pyproject.toml ├── src └── stk │ ├── __init__.py │ ├── _internal │ ├── __init__.py │ ├── atom.py │ ├── atom_info.py │ ├── bond.py │ ├── bond_info.py │ ├── building_block.py │ ├── constructed_molecule.py │ ├── construction_result │ │ ├── __init__.py │ │ ├── construction_result.py │ │ └── periodic.py │ ├── construction_state │ │ ├── __init__.py │ │ ├── construction_state.py │ │ ├── graph_state.py │ │ └── molecule_state │ │ │ ├── __init__.py │ │ │ ├── deletions_summary.py │ │ │ ├── molecule_state.py │ │ │ ├── placements_summary │ │ │ ├── __init__.py │ │ │ ├── atom_batch.py │ │ │ ├── bond_batch.py │ │ │ └── placements_summary.py │ │ │ └── reactions_summary │ │ │ ├── __init__.py │ │ │ ├── atom_batch.py │ │ │ ├── bond_batch.py │ │ │ └── reactions_summary.py │ ├── databases │ │ ├── __init__.py │ │ ├── constructed_molecule.py │ │ ├── molecule.py │ │ ├── mongo_db │ │ │ ├── __init__.py │ │ │ ├── constructed_molecule.py │ │ │ ├── molecule.py │ │ │ ├── utilities.py │ │ │ └── value.py │ │ └── value.py │ ├── ea │ │ ├── __init__.py │ │ ├── crossover │ │ │ ├── __init__.py │ │ │ ├── genetic_recombination.py │ │ │ ├── molecule_crosser.py │ │ │ ├── random.py │ │ │ └── record.py │ │ ├── evolutionary_algorithm │ │ │ ├── __init__.py │ │ │ ├── evolutionary_algorithm.py │ │ │ └── implementations │ │ │ │ ├── __init__.py │ │ │ │ ├── implementation.py │ │ │ │ ├── parallel.py │ │ │ │ └── serial.py │ │ ├── fitness_calculators │ │ │ ├── __init__.py │ │ │ ├── fitness_calculator.py │ │ │ ├── fitness_function.py │ │ │ └── property_vector.py │ │ ├── fitness_normalizers │ │ │ ├── __init__.py │ │ │ ├── add.py │ │ │ ├── divide_by_mean.py │ │ │ ├── fitness_normalizer.py │ │ │ ├── multiply.py │ │ │ ├── null.py │ │ │ ├── power.py │ │ │ ├── replace_fitness.py │ │ │ ├── sequence.py │ │ │ ├── shift_up.py │ │ │ └── sum.py │ │ ├── generation.py │ │ ├── molecule_record.py │ │ ├── mutation │ │ │ ├── __init__.py │ │ │ ├── mutator.py │ │ │ ├── random.py │ │ │ ├── random_building_block.py │ │ │ ├── random_topology_graph.py │ │ │ ├── record.py │ │ │ └── similar_building_block.py │ │ ├── plotters │ │ │ ├── __init__.py │ │ │ ├── progress.py │ │ │ └── selection.py │ │ └── selection │ │ │ ├── __init__.py │ │ │ ├── batch.py │ │ │ └── selectors │ │ │ ├── __init__.py │ │ │ ├── above_average.py │ │ │ ├── best.py │ │ │ ├── filter_batches.py │ │ │ ├── filter_molecules.py │ │ │ ├── remove_batches.py │ │ │ ├── remove_molecules.py │ │ │ ├── roulette.py │ │ │ ├── selector.py │ │ │ ├── stochastic_universal_sampling.py │ │ │ ├── tournament.py │ │ │ ├── worst.py │ │ │ └── yielded_batches.py │ ├── elements.py │ ├── functional_group_factories │ │ ├── __init__.py │ │ ├── alcohol_factory.py │ │ ├── aldehyde_factory.py │ │ ├── amide_factory.py │ │ ├── boronic_acid_factory.py │ │ ├── bromo_factory.py │ │ ├── carboxylic_acid_factory.py │ │ ├── dibromo_factory.py │ │ ├── difluoro_factory.py │ │ ├── diol_factory.py │ │ ├── fluoro_factory.py │ │ ├── functional_group_factory.py │ │ ├── iodo_factory.py │ │ ├── primary_amino_factory.py │ │ ├── ring_amine_factory.py │ │ ├── secondary_amino_factory.py │ │ ├── smarts.py │ │ ├── terminal_alkene_factory.py │ │ ├── terminal_alkyne_factory.py │ │ ├── thioacid_factory.py │ │ ├── thiol_factory.py │ │ └── utilities.py │ ├── functional_groups │ │ ├── __init__.py │ │ ├── alcohol.py │ │ ├── aldehyde.py │ │ ├── alkene.py │ │ ├── alkyne.py │ │ ├── amide.py │ │ ├── boronic_acid.py │ │ ├── bromo.py │ │ ├── carboxylic_acid.py │ │ ├── dibromo.py │ │ ├── difluoro.py │ │ ├── diol.py │ │ ├── fluoro.py │ │ ├── functional_group.py │ │ ├── generic_functional_group.py │ │ ├── iodo.py │ │ ├── primary_amino.py │ │ ├── ring_amine.py │ │ ├── secondary_amino.py │ │ ├── single_atom.py │ │ ├── thioacid.py │ │ └── thiol.py │ ├── json_serde │ │ ├── __init__.py │ │ ├── constructed_molecule.py │ │ ├── molecule.py │ │ └── utilities.py │ ├── key_makers │ │ ├── __init__.py │ │ ├── inchi.py │ │ ├── inchi_key.py │ │ ├── molecule.py │ │ ├── smiles.py │ │ └── utilities.py │ ├── molecule.py │ ├── optimizers │ │ ├── __init__.py │ │ ├── collapser.py │ │ ├── mchammer.py │ │ ├── null.py │ │ ├── optimizer.py │ │ ├── periodic_collapser.py │ │ ├── spinner.py │ │ └── utilities.py │ ├── periodic_info.py │ ├── reaction_factories │ │ ├── __init__.py │ │ ├── dative_reaction_factory.py │ │ ├── generic_reaction_factory.py │ │ └── reaction_factory.py │ ├── reactions │ │ ├── __init__.py │ │ ├── dative_reaction │ │ │ ├── __init__.py │ │ │ ├── dative_reaction.py │ │ │ └── utilities.py │ │ ├── one_one_reaction.py │ │ ├── one_two_reaction.py │ │ ├── reaction │ │ │ ├── __init__.py │ │ │ ├── new_atom.py │ │ │ ├── reaction.py │ │ │ └── reaction_result.py │ │ ├── ring_amine_reaction.py │ │ └── two_two_reaction.py │ ├── topology_graphs │ │ ├── __init__.py │ │ ├── cage │ │ │ ├── __init__.py │ │ │ ├── cage.py │ │ │ ├── cage_construction_state.py │ │ │ ├── eight_plus_sixteen.py │ │ │ ├── eight_plus_twelve.py │ │ │ ├── five_plus_ten.py │ │ │ ├── four_plus_eight.py │ │ │ ├── four_plus_four.py │ │ │ ├── four_plus_six.py │ │ │ ├── four_plus_six_2.py │ │ │ ├── m12l24.py │ │ │ ├── m24l48.py │ │ │ ├── m2l4_lantern.py │ │ │ ├── m3l3_triangle.py │ │ │ ├── m3l6.py │ │ │ ├── m4l4_square.py │ │ │ ├── m4l4_tetrahedron.py │ │ │ ├── m4l6_tetrahedron.py │ │ │ ├── m4l6_tetrahedron_spacer.py │ │ │ ├── m4l8.py │ │ │ ├── m6l12_cube.py │ │ │ ├── m6l2l3_prism.py │ │ │ ├── m8l6_cube.py │ │ │ ├── one_plus_one.py │ │ │ ├── six_plus_eight.py │ │ │ ├── six_plus_nine.py │ │ │ ├── six_plus_twelve.py │ │ │ ├── ten_plus_twenty.py │ │ │ ├── three_plus_six.py │ │ │ ├── twelve_plus_thirty.py │ │ │ ├── twenty_plus_thirty.py │ │ │ ├── two_plus_four.py │ │ │ ├── two_plus_three.py │ │ │ ├── two_plus_two.py │ │ │ └── vertices.py │ │ ├── cof │ │ │ ├── __init__.py │ │ │ ├── cof.py │ │ │ ├── edge.py │ │ │ ├── hexagonal.py │ │ │ ├── honeycomb.py │ │ │ ├── kagome.py │ │ │ ├── linkerless_honeycomb.py │ │ │ ├── periodic_hexagonal.py │ │ │ ├── periodic_honeycomb.py │ │ │ ├── periodic_kagome.py │ │ │ ├── periodic_linkerless_honeycomb.py │ │ │ ├── periodic_square.py │ │ │ ├── square.py │ │ │ └── vertices.py │ │ ├── edge.py │ │ ├── edge_group.py │ │ ├── host_guest │ │ │ ├── __init__.py │ │ │ ├── complex.py │ │ │ └── vertices.py │ │ ├── macrocycle │ │ │ ├── __init__.py │ │ │ ├── macrocycle.py │ │ │ └── vertices.py │ │ ├── metal_complex │ │ │ ├── __init__.py │ │ │ ├── bidentate_square_planar.py │ │ │ ├── cis_protected_square_planar.py │ │ │ ├── metal_complex.py │ │ │ ├── octahedral.py │ │ │ ├── octahedral_delta.py │ │ │ ├── octahedral_lambda.py │ │ │ ├── paddlewheel.py │ │ │ ├── porphyrin.py │ │ │ ├── square_planar.py │ │ │ └── vertices.py │ │ ├── polymer │ │ │ ├── __init__.py │ │ │ ├── linear.py │ │ │ └── vertices.py │ │ ├── rotaxane │ │ │ ├── __init__.py │ │ │ ├── nrotaxane.py │ │ │ └── vertices.py │ │ ├── small │ │ │ ├── __init__.py │ │ │ ├── ncore.py │ │ │ └── vertices.py │ │ ├── topology_graph │ │ │ ├── __init__.py │ │ │ ├── parallel.py │ │ │ ├── serial.py │ │ │ ├── topology_graph.py │ │ │ └── utilities.py │ │ ├── utilities │ │ │ ├── __init__.py │ │ │ ├── edge_sorter.py │ │ │ ├── functional_group_sorter.py │ │ │ └── sorter.py │ │ └── vertex.py │ ├── utilities │ │ ├── __init__.py │ │ ├── molecule.py │ │ ├── updaters │ │ │ ├── __init__.py │ │ │ ├── mae.py │ │ │ ├── mdl_mol.py │ │ │ ├── pdb.py │ │ │ ├── turbomole.py │ │ │ └── xyz.py │ │ ├── utilities.py │ │ └── writers │ │ │ ├── __init__.py │ │ │ ├── mdl_mol.py │ │ │ ├── pdb.py │ │ │ └── xyz.py │ └── writers │ │ ├── __init__.py │ │ ├── mdl_mol.py │ │ ├── pdb.py │ │ ├── turbomole.py │ │ └── xyz.py │ ├── cage.py │ ├── cof.py │ ├── host_guest.py │ ├── macrocycle.py │ ├── metal_complex.py │ ├── polymer.py │ ├── py.typed │ ├── rotaxane.py │ └── small.py └── tests ├── __init__.py ├── conftest.py ├── databases ├── __init__.py ├── constructed_molecule │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── fixtures │ │ ├── __init__.py │ │ └── constructed_molecule_mongo_db.py │ ├── get_all │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ └── constructed_molecule_mongo_db.py │ │ └── test_get_all.py │ ├── mongo_db │ │ ├── __init__.py │ │ ├── test_constructed_molecule_caching.py │ │ ├── test_constructed_molecule_update.py │ │ └── utilities.py │ └── test_database.py ├── molecule │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── fixtures │ │ ├── __init__.py │ │ └── molecule_mongo_db.py │ ├── get_all │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ └── molecule_mongo_db.py │ │ └── test_get_all.py │ ├── mongo_db │ │ ├── __init__.py │ │ ├── test_molecule_caching.py │ │ ├── test_molecule_update.py │ │ └── utilities.py │ └── test_database.py ├── utilities.py └── value │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── fixtures │ ├── __init__.py │ └── mongo_db.py │ ├── mongo_db │ ├── __init__.py │ ├── test_value_caching.py │ ├── test_value_update.py │ └── utilities.py │ └── test_database.py ├── drop_test_database.py ├── ea ├── __init__.py ├── crossover │ ├── __init__.py │ └── crossers │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ ├── __init__.py │ │ ├── genetic_recombination.py │ │ └── random.py │ │ └── test_cross.py ├── fitness_calculator │ ├── __init__.py │ ├── test_caching │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── fitness_function.py │ │ │ ├── property_vector.py │ │ │ └── utilities.py │ │ └── test_caching.py │ └── test_get_fitness_value │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ ├── __init__.py │ │ ├── fitness_function.py │ │ └── property_vector.py │ │ └── test_get_fitness_value.py ├── fitness_normalizer │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── fixtures │ │ ├── __init__.py │ │ ├── add.py │ │ ├── divide_by_mean.py │ │ ├── multiply.py │ │ ├── null.py │ │ ├── power.py │ │ ├── replace_fitness.py │ │ ├── sequence.py │ │ ├── shift_up.py │ │ └── sum.py │ └── test_normalize.py ├── mutation │ ├── __init__.py │ └── mutator │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ ├── __init__.py │ │ ├── random.py │ │ ├── random_building_block.py │ │ ├── random_topology_graph.py │ │ └── similar_building_block.py │ │ └── test_mutate.py ├── plotters │ ├── __init__.py │ ├── progress │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ └── test_progress_plotter.py │ └── selection │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ └── test_selection_plotter.py └── selection │ ├── __init__.py │ └── selector │ ├── __init__.py │ └── select │ ├── __init__.py │ ├── select_1 │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── fixtures │ │ ├── __init__.py │ │ ├── above_average.py │ │ ├── best.py │ │ ├── filter_batches.py │ │ ├── filter_molecules.py │ │ ├── remove_batches.py │ │ ├── remove_molecules.py │ │ ├── utilities.py │ │ └── worst.py │ └── test_select.py │ └── select_2 │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── fixtures │ ├── __init__.py │ ├── roulette.py │ ├── stochastic_universal_sampling.py │ └── tournament.py │ └── test_select.py ├── molecular ├── __init__.py ├── atoms │ ├── __init__.py │ ├── atom │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_clone.py │ │ ├── test_get_atomic_number.py │ │ ├── test_get_charge.py │ │ ├── test_get_id.py │ │ ├── test_repr.py │ │ ├── test_with_id.py │ │ └── utilities.py │ └── atom_info │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_get_atom.py │ │ ├── test_get_building_block.py │ │ └── test_get_building_block_id.py ├── bonds │ ├── __init__.py │ ├── bond │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_clone.py │ │ ├── test_get_atom1.py │ │ ├── test_get_atom2.py │ │ ├── test_get_order.py │ │ ├── test_get_periodicity.py │ │ ├── test_is_periodic.py │ │ ├── test_repr.py │ │ ├── utilities.py │ │ ├── with_atoms │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_atoms.py │ │ └── with_ids │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_ids.py │ └── bond_info │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_get_bond.py │ │ ├── test_get_building_block.py │ │ └── test_get_building_block_id.py ├── functional_groups │ ├── __init__.py │ ├── functional_group │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── alcohol.py │ │ │ ├── aldehyde.py │ │ │ ├── alkene.py │ │ │ ├── alkyne.py │ │ │ ├── amide.py │ │ │ ├── boronic_acid.py │ │ │ ├── bromo.py │ │ │ ├── carboxylic_acid.py │ │ │ ├── dibromo.py │ │ │ ├── difluoro.py │ │ │ ├── diol.py │ │ │ ├── fluoro.py │ │ │ ├── iodo.py │ │ │ ├── primary_amino.py │ │ │ ├── ring_amine.py │ │ │ ├── secondary_amino.py │ │ │ ├── single_atom.py │ │ │ ├── thioacid.py │ │ │ └── thiol.py │ │ ├── functional_group │ │ │ ├── __init__.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_atom_ids.py │ │ │ ├── test_get_atoms.py │ │ │ ├── test_get_core_atom_ids.py │ │ │ ├── test_get_placer_ids.py │ │ │ ├── test_repr.py │ │ │ ├── with_atoms │ │ │ │ ├── __init__.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_with_atoms.py │ │ │ └── with_ids │ │ │ │ ├── __init__.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_with_ids.py │ │ ├── generic_functional_group │ │ │ ├── __init__.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_bonder_ids.py │ │ │ ├── test_get_bonders.py │ │ │ ├── test_get_deleter_ids.py │ │ │ ├── test_get_deleters.py │ │ │ ├── test_get_num_bonders.py │ │ │ ├── test_repr.py │ │ │ ├── with_atoms │ │ │ │ ├── __init__.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_with_atoms.py │ │ │ └── with_ids │ │ │ │ ├── __init__.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_with_ids.py │ │ └── utilities.py │ └── functional_group_factory │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── functional_group_factory │ │ ├── __init__.py │ │ ├── conftest.py │ │ └── test_get_functional_groups.py │ │ ├── generic_functional_group_factory │ │ ├── __init__.py │ │ ├── conftest.py │ │ └── test_get_functional_groups.py │ │ └── utilities.py ├── key_makers │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_get_key.py │ └── test_get_key_name.py ├── molecules │ ├── __init__.py │ ├── building_block │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── default_init.py │ │ │ ├── init.py │ │ │ ├── init_from_file.py │ │ │ ├── init_from_molecule.py │ │ │ └── init_from_rdkit_mol.py │ │ ├── test_get_core_atom_ids.py │ │ ├── test_get_functional_groups.py │ │ ├── test_get_num_functional_groups.py │ │ ├── test_get_num_placers.py │ │ ├── test_get_placer_ids.py │ │ ├── test_repr.py │ │ └── test_with_functional_groups.py │ ├── constructed_molecule │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── cof.py │ │ │ └── linear.py │ │ ├── test_get_atom_infos.py │ │ ├── test_get_bond_infos.py │ │ ├── test_get_building_blocks.py │ │ └── test_get_num_building_block.py │ ├── molecule │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── building_blocks.py │ │ │ ├── cage │ │ │ │ ├── __init__.py │ │ │ │ ├── cage.py │ │ │ │ ├── metal_topologies │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── m12l24.py │ │ │ │ │ ├── m24l48.py │ │ │ │ │ ├── m2l4_lantern.py │ │ │ │ │ ├── m3l3_triangle.py │ │ │ │ │ ├── m3l6.py │ │ │ │ │ ├── m4l4_square.py │ │ │ │ │ ├── m4l4_tetrahedron.py │ │ │ │ │ ├── m4l6_tetrahedron.py │ │ │ │ │ ├── m4l6_tetrahedron_spacer.py │ │ │ │ │ ├── m4l8.py │ │ │ │ │ ├── m6l12_cube.py │ │ │ │ │ ├── m6l2l3_prism.py │ │ │ │ │ └── m8l6_cube.py │ │ │ │ ├── three_plus_four │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── six_plus_eight.py │ │ │ │ ├── three_plus_three │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── four_plus_four.py │ │ │ │ │ ├── one_plus_one.py │ │ │ │ │ └── two_plus_two.py │ │ │ │ ├── two_plus_five │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── twelve_plus_thirty.py │ │ │ │ ├── two_plus_four │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── eight_plus_sixteen.py │ │ │ │ │ ├── five_plus_ten.py │ │ │ │ │ ├── four_plus_eight.py │ │ │ │ │ ├── six_plus_twelve.py │ │ │ │ │ ├── ten_plus_twenty.py │ │ │ │ │ ├── three_plus_six.py │ │ │ │ │ └── two_plus_four.py │ │ │ │ └── two_plus_three │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── eight_plus_twelve.py │ │ │ │ │ ├── four_plus_six.py │ │ │ │ │ ├── four_plus_six_2.py │ │ │ │ │ ├── six_plus_nine.py │ │ │ │ │ ├── twenty_plus_thirty.py │ │ │ │ │ └── two_plus_three.py │ │ │ ├── cof │ │ │ │ ├── __init__.py │ │ │ │ ├── cof.py │ │ │ │ ├── hexagonal.py │ │ │ │ ├── honeycomb.py │ │ │ │ ├── kagome.py │ │ │ │ ├── linkerless_honeycomb.py │ │ │ │ ├── periodic_hexagonal.py │ │ │ │ ├── periodic_honeycomb.py │ │ │ │ ├── periodic_kagome.py │ │ │ │ ├── periodic_linkerless_honeycomb.py │ │ │ │ ├── periodic_square.py │ │ │ │ └── square.py │ │ │ ├── host_guest │ │ │ │ ├── __init__.py │ │ │ │ ├── complex.py │ │ │ │ └── host_guest.py │ │ │ ├── macrocycle │ │ │ │ ├── __init__.py │ │ │ │ └── macrocycle.py │ │ │ ├── metal_complex │ │ │ │ ├── __init__.py │ │ │ │ ├── metal_complex.py │ │ │ │ ├── octahedral │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── octahedral.py │ │ │ │ │ ├── octahedral_delta.py │ │ │ │ │ └── octahedral_lambda.py │ │ │ │ ├── paddlewheel │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── paddlewheel.py │ │ │ │ ├── porphyrin │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── porphyrin.py │ │ │ │ └── square_planar │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── bidentate_square_planar.py │ │ │ │ │ ├── cis_protected_square_planar.py │ │ │ │ │ └── square_planar.py │ │ │ ├── polymer │ │ │ │ ├── __init__.py │ │ │ │ ├── linear.py │ │ │ │ └── polymer.py │ │ │ ├── position_matrices │ │ │ │ ├── building_block0.npy │ │ │ │ ├── building_block1.npy │ │ │ │ ├── building_block2.npy │ │ │ │ ├── building_block3.npy │ │ │ │ ├── building_block4.npy │ │ │ │ ├── building_block5.npy │ │ │ │ ├── building_block6.npy │ │ │ │ ├── cage_eight_plus_sixteen0.npy │ │ │ │ ├── cage_eight_plus_twelve0.npy │ │ │ │ ├── cage_eight_plus_twelve1.npy │ │ │ │ ├── cage_five_plus_ten0.npy │ │ │ │ ├── cage_four_plus_eight0.npy │ │ │ │ ├── cage_four_plus_four0.npy │ │ │ │ ├── cage_four_plus_six0.npy │ │ │ │ ├── cage_four_plus_six_20.npy │ │ │ │ ├── cage_four_plus_six_21.npy │ │ │ │ ├── cage_one_plus_one0.npy │ │ │ │ ├── cage_six_plus_eight0.npy │ │ │ │ ├── cage_six_plus_eight1.npy │ │ │ │ ├── cage_six_plus_nine0.npy │ │ │ │ ├── cage_six_plus_twelve0.npy │ │ │ │ ├── cage_ten_plus_twenty0.npy │ │ │ │ ├── cage_three_plus_six0.npy │ │ │ │ ├── cage_twelve_plus_thirty0.npy │ │ │ │ ├── cage_twenty_plus_thirty0.npy │ │ │ │ ├── cage_two_plus_four0.npy │ │ │ │ ├── cage_two_plus_three0.npy │ │ │ │ ├── cage_two_plus_two0.npy │ │ │ │ ├── cof_hexagonal0.npy │ │ │ │ ├── cof_hexagonal1.npy │ │ │ │ ├── cof_hexagonal2.npy │ │ │ │ ├── cof_hexagonal3.npy │ │ │ │ ├── cof_hexagonal4.npy │ │ │ │ ├── cof_honeycomb0.npy │ │ │ │ ├── cof_honeycomb1.npy │ │ │ │ ├── cof_honeycomb2.npy │ │ │ │ ├── cof_kagome0.npy │ │ │ │ ├── cof_linkerless_honeycomb0.npy │ │ │ │ ├── cof_periodic_hexagonal0.npy │ │ │ │ ├── cof_periodic_hexagonal1.npy │ │ │ │ ├── cof_periodic_honeycomb0.npy │ │ │ │ ├── cof_periodic_honeycomb1.npy │ │ │ │ ├── cof_periodic_kagome0.npy │ │ │ │ ├── cof_periodic_kagome1.npy │ │ │ │ ├── cof_periodic_linkerless_honeycomb0.npy │ │ │ │ ├── cof_periodic_linkerless_honeycomb1.npy │ │ │ │ ├── cof_periodic_square0.npy │ │ │ │ ├── cof_periodic_square1.npy │ │ │ │ ├── cof_square0.npy │ │ │ │ ├── host_guest_complex0.npy │ │ │ │ ├── host_guest_complex1.npy │ │ │ │ ├── host_guest_complex2.npy │ │ │ │ ├── host_guest_complex3.npy │ │ │ │ ├── macrocycle_macrocycle0.npy │ │ │ │ ├── macrocycle_macrocycle1.npy │ │ │ │ ├── metal_cage_m12l240.npy │ │ │ │ ├── metal_cage_m24l480.npy │ │ │ │ ├── metal_cage_m2l4_lantern0.npy │ │ │ │ ├── metal_cage_m2l4_lantern1.npy │ │ │ │ ├── metal_cage_m3l3_triangle0.npy │ │ │ │ ├── metal_cage_m3l3_triangle1.npy │ │ │ │ ├── metal_cage_m3l3_triangle2.npy │ │ │ │ ├── metal_cage_m3l3_triangle3.npy │ │ │ │ ├── metal_cage_m3l3_triangle4.npy │ │ │ │ ├── metal_cage_m3l60.npy │ │ │ │ ├── metal_cage_m3l61.npy │ │ │ │ ├── metal_cage_m4l4_square0.npy │ │ │ │ ├── metal_cage_m4l4_square1.npy │ │ │ │ ├── metal_cage_m4l4_square2.npy │ │ │ │ ├── metal_cage_m4l4_square3.npy │ │ │ │ ├── metal_cage_m4l4_tetrahedron0.npy │ │ │ │ ├── metal_cage_m4l6_tetrahedron0.npy │ │ │ │ ├── metal_cage_m4l6_tetrahedron_spacer0.npy │ │ │ │ ├── metal_cage_m4l80.npy │ │ │ │ ├── metal_cage_m6l12_cube0.npy │ │ │ │ ├── metal_cage_m6l12_cube1.npy │ │ │ │ ├── metal_cage_m6l2l3_prism0.npy │ │ │ │ ├── metal_cage_m8l6_cube0.npy │ │ │ │ ├── metal_complex_bidentate_square_planar0.npy │ │ │ │ ├── metal_complex_bidentate_square_planar1.npy │ │ │ │ ├── metal_complex_cis_protected_square_planar0.npy │ │ │ │ ├── metal_complex_cis_protected_square_planar1.npy │ │ │ │ ├── metal_complex_octahedral0.npy │ │ │ │ ├── metal_complex_octahedral1.npy │ │ │ │ ├── metal_complex_octahedral_delta0.npy │ │ │ │ ├── metal_complex_octahedral_delta1.npy │ │ │ │ ├── metal_complex_octahedral_lambda0.npy │ │ │ │ ├── metal_complex_octahedral_lambda1.npy │ │ │ │ ├── metal_complex_paddlewheel0.npy │ │ │ │ ├── metal_complex_paddlewheel1.npy │ │ │ │ ├── metal_complex_paddlewheel2.npy │ │ │ │ ├── metal_complex_porphyrin0.npy │ │ │ │ ├── metal_complex_porphyrin1.npy │ │ │ │ ├── metal_complex_square_planar0.npy │ │ │ │ ├── metal_complex_square_planar1.npy │ │ │ │ ├── polymer_linear0.npy │ │ │ │ ├── polymer_linear1.npy │ │ │ │ ├── polymer_linear2.npy │ │ │ │ ├── polymer_linear3.npy │ │ │ │ └── rotaxane_nrotaxane0.npy │ │ │ ├── rotaxane │ │ │ │ ├── __init__.py │ │ │ │ ├── nrotaxane.py │ │ │ │ └── rotaxane.py │ │ │ └── small │ │ │ │ ├── __init__.py │ │ │ │ ├── ncore.py │ │ │ │ └── small.py │ │ ├── get_atoms │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── get_atoms_1 │ │ │ │ ├── __init__.py │ │ │ │ ├── case_data.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_get_atoms.py │ │ │ └── get_atoms_2 │ │ │ │ ├── __init__.py │ │ │ │ └── test_get_atoms.py │ │ ├── get_bonds │ │ │ ├── __init__.py │ │ │ ├── case_data.py │ │ │ ├── conftest.py │ │ │ └── test_get_bonds.py │ │ ├── get_canonical_atom_ids │ │ │ ├── __init__.py │ │ │ ├── case_data.py │ │ │ ├── conftest.py │ │ │ └── test_get_canonical_atom_ids.py │ │ ├── get_centroid │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_get_centroid.py │ │ │ └── test_get_centroid_helper.py │ │ ├── get_direction │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_get_direction.py │ │ │ └── test_get_direction_helper.py │ │ ├── get_maximum_diameter │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_get_maximum_diameter.py │ │ │ ├── test_get_maximum_diameter_helper.py │ │ │ └── utilities.py │ │ ├── get_num_atoms │ │ │ ├── __init__.py │ │ │ ├── get_num_atoms_1 │ │ │ │ ├── __init__.py │ │ │ │ ├── case_data.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_get_num_atoms.py │ │ │ └── get_num_atoms_2 │ │ │ │ ├── __init__.py │ │ │ │ └── test_get_num_atoms.py │ │ ├── get_num_bonds │ │ │ ├── __init__.py │ │ │ ├── get_num_bonds_1 │ │ │ │ ├── __init__.py │ │ │ │ ├── case_data.py │ │ │ │ ├── conftest.py │ │ │ │ └── test_get_num_bonds.py │ │ │ └── get_num_bonds_2 │ │ │ │ ├── __init__.py │ │ │ │ └── test_get_num_bonds.py │ │ ├── get_plane_normal │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_get_plane_normal.py │ │ │ ├── test_get_plane_normal_helper.py │ │ │ └── utilities.py │ │ ├── test_clone.py │ │ ├── test_dump_molecular_structures.py │ │ ├── test_get_atomic_positions.py │ │ ├── test_get_position_matrix.py │ │ ├── test_to_rdkit_mol.py │ │ ├── test_with_position_matrix.py │ │ ├── utilities.py │ │ ├── with_canonical_atom_ordering │ │ │ ├── __init__.py │ │ │ ├── case_data.py │ │ │ ├── conftest.py │ │ │ └── test_with_canonical_atom_ordering.py │ │ ├── with_centroid │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_centroid.py │ │ ├── with_displacement │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_displacement.py │ │ ├── with_rotation_about_axis │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_rotation_about_axis.py │ │ ├── with_rotation_between_vectors │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_rotation_between_vectors.py │ │ ├── with_rotation_to_minimize_angle │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_with_rotation_to_minimize_angle.py │ │ ├── with_structure_from_file │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── with_structure_from_file_1 │ │ │ │ ├── __init__.py │ │ │ │ └── test_with_structure_from_file.py │ │ │ └── with_structure_from_file_2 │ │ │ │ ├── __init__.py │ │ │ │ ├── case_data.py │ │ │ │ ├── conftest.py │ │ │ │ ├── test_with_structure_from_file.py │ │ │ │ └── test_with_structure_from_file │ │ │ │ ├── NCCN.coord │ │ │ │ ├── NCCN.mae │ │ │ │ ├── NCCN.mol │ │ │ │ ├── NCCN.pdb │ │ │ │ ├── NCCN.xyz │ │ │ │ ├── NCCN_with_cell.pdb │ │ │ │ ├── NCCN_with_cell1.coord │ │ │ │ └── NCCN_with_cell2.coord │ │ └── write │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ └── test_write.py │ └── utilities │ │ ├── __init__.py │ │ ├── building_block.py │ │ ├── constructed_molecule.py │ │ ├── molecule.py │ │ └── utilities.py ├── periodic_info │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_clone.py │ ├── test_get_a.py │ ├── test_get_alpha.py │ ├── test_get_b.py │ ├── test_get_beta.py │ ├── test_get_c.py │ ├── test_get_cell_matrix.py │ └── test_get_gamma.py ├── reactions │ ├── __init__.py │ ├── reaction │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── dative_reaction.py │ │ │ ├── one_one_reaction.py │ │ │ ├── one_two_reaction.py │ │ │ └── two_two_reaction.py │ │ ├── test_get_deleted_atoms.py │ │ ├── test_get_deleted_bonds.py │ │ ├── test_get_new_atoms.py │ │ ├── test_get_new_bonds.py │ │ └── utilities.py │ └── reaction_factory │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── fixtures │ │ ├── __init__.py │ │ ├── dative_reaction.py │ │ ├── one_one_reaction.py │ │ ├── one_two_reaction.py │ │ ├── two_two_reaction.py │ │ └── utilities.py │ │ └── test_get_reaction.py ├── topology_graphs │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── construction_state │ │ ├── __init__.py │ │ ├── conftest.py │ │ ├── test_clone.py │ │ ├── test_with_vertices.py │ │ ├── utilities.py │ │ └── with_placement_results │ │ │ ├── __init__.py │ │ │ ├── check_atom_infos.py │ │ │ ├── check_atoms.py │ │ │ ├── check_bond_infos.py │ │ │ ├── check_bonds.py │ │ │ ├── check_building_block_counts.py │ │ │ ├── check_building_blocks.py │ │ │ ├── check_edge_functional_groups.py │ │ │ ├── check_edges.py │ │ │ ├── check_position_matrix.py │ │ │ ├── check_vertex_edges.py │ │ │ ├── check_vertices.py │ │ │ └── test_with_placement_results.py │ ├── edge │ │ ├── __init__.py │ │ ├── case_data.py │ │ ├── conftest.py │ │ ├── test_clone.py │ │ ├── test_get_id.py │ │ ├── test_get_periodicity.py │ │ ├── test_get_vertex1_id.py │ │ ├── test_get_vertex2_id.py │ │ ├── test_get_vertex_ids.py │ │ ├── test_is_periodic.py │ │ ├── utilities.py │ │ └── with_scale │ │ │ ├── __init__.py │ │ │ ├── case_data.py │ │ │ ├── conftest.py │ │ │ └── test_with_scale.py │ └── vertex │ │ ├── __init__.py │ │ ├── _test_clone.py │ │ ├── _test_get_cell.py │ │ ├── _test_get_id.py │ │ ├── _test_get_position.py │ │ ├── _test_with_position.py │ │ ├── _test_with_scale.py │ │ ├── case_data.py │ │ ├── cases │ │ ├── __init__.py │ │ ├── cage │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── cof │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── cof1.py │ │ │ │ ├── cof2.py │ │ │ │ └── cof3.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── host_guest │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── macrocycle │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── metal_complex │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── polymer │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── rotaxane │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ └── small │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_clone.py │ │ │ ├── test_get_cell.py │ │ │ ├── test_get_id.py │ │ │ ├── test_get_position.py │ │ │ ├── test_with_position.py │ │ │ └── test_with_scale.py │ │ ├── conftest.py │ │ ├── placement │ │ ├── __init__.py │ │ ├── _test_placement.py │ │ ├── case_data.py │ │ └── cases │ │ │ ├── __init__.py │ │ │ ├── cage │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── angled.py │ │ │ │ ├── linear.py │ │ │ │ ├── nonlinear.py │ │ │ │ └── unaligning.py │ │ │ └── test_placement.py │ │ │ ├── cof │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── linear.py │ │ │ │ ├── nonlinear.py │ │ │ │ └── unaligning.py │ │ │ └── test_placement.py │ │ │ ├── host_guest │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── guest.py │ │ │ │ └── host.py │ │ │ └── test_placement.py │ │ │ ├── linear │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── center.py │ │ │ │ ├── head_1.py │ │ │ │ ├── head_2.py │ │ │ │ ├── head_3.py │ │ │ │ ├── tail_1.py │ │ │ │ ├── tail_2.py │ │ │ │ ├── tail_3.py │ │ │ │ └── utilities.py │ │ │ └── test_placement.py │ │ │ ├── macrocycle │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── flip.py │ │ │ │ ├── no_flip.py │ │ │ │ └── utilities.py │ │ │ └── test_placement.py │ │ │ ├── metal_complex │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ │ ├── __init__.py │ │ │ │ ├── bidentate.py │ │ │ │ ├── metal.py │ │ │ │ └── monodentate.py │ │ │ └── test_placement.py │ │ │ └── rotaxane │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fixtures │ │ │ ├── __init__.py │ │ │ ├── axle.py │ │ │ └── cycle.py │ │ │ └── test_placement.py │ │ └── utilities.py └── writers │ ├── __init__.py │ ├── mdl_mol │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_to_string.py │ └── test_write.py │ ├── pdb │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_to_string.py │ └── test_write.py │ ├── turbomole │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_to_string.py │ └── test_write.py │ └── xyz │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ ├── test_to_string.py │ └── test_write.py ├── mongo-config.json ├── serialization ├── __init__.py └── json │ ├── __init__.py │ ├── from_json │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ └── test_from_json.py │ └── to_json │ ├── __init__.py │ ├── case_data.py │ ├── conftest.py │ └── test_to_json.py └── utilities ├── __init__.py └── molecular ├── __init__.py ├── constructed_molecule.py ├── molecule.py └── utilities.py /.github/workflows/publish_release.yml: -------------------------------------------------------------------------------- 1 | name: Publish release 2 | on: 3 | push: 4 | tags: 5 | - 'v[0-9]+.[0-9]+.[0-9]+.[0-9]+' 6 | jobs: 7 | publish-release: 8 | runs-on: ubuntu-22.04 9 | env: 10 | VERSION: ${{ github.ref_name }} 11 | steps: 12 | - uses: actions/checkout@v3 13 | - uses: actions/setup-python@v4 14 | with: 15 | python-version: "3.11" 16 | cache: "pip" 17 | - run: pip install -e '.[dev]' 18 | - run: python -m build 19 | - name: Publish 20 | run: 21 | twine upload 22 | -u __token__ 23 | -p ${{ secrets.PYPI_API_TOKEN }} 24 | dist/* 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /build 3 | src/stk.egg-info 4 | src/stk/_version.py 5 | /.coverage 6 | docs/source/_autosummary 7 | 8 | **/__pycache__/ 9 | 10 | **/.cache 11 | .mypy_cache 12 | *.ipynb_checkpoints 13 | **/.vscode 14 | 15 | # Some folders get created by tests. 16 | **/tests_output 17 | docs/build 18 | tests/failures.txt 19 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: "ubuntu-22.04" 5 | tools: 6 | python: "3.11" 7 | 8 | sphinx: 9 | configuration: "docs/source/conf.py" 10 | 11 | python: 12 | install: 13 | - method: "pip" 14 | path: . 15 | extra_requirements: 16 | - "dev" 17 | -------------------------------------------------------------------------------- /benchmarks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/benchmarks/__init__.py -------------------------------------------------------------------------------- /benchmarks/cof/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/benchmarks/cof/__init__.py -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = -W --keep-going 6 | SPHINXBUILD = python -msphinx 7 | SPHINXPROJ = stk 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/source/_static/stk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/docs/source/_static/stk.png -------------------------------------------------------------------------------- /docs/source/cof.rst: -------------------------------------------------------------------------------- 1 | Covalent Organic Frameworks 2 | =========================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Overview and Examples <_autosummary/stk.cof.Cof> 8 | Hexagonal <_autosummary/stk.cof.Hexagonal> 9 | Honeycomb <_autosummary/stk.cof.Honeycomb> 10 | Kagome <_autosummary/stk.cof.Kagome> 11 | Linkerless Honeycomb <_autosummary/stk.cof.LinkerlessHoneycomb> 12 | Square <_autosummary/stk.cof.Square> 13 | Periodic Hexagonal <_autosummary/stk.cof.PeriodicHexagonal> 14 | Periodic Honeycomb <_autosummary/stk.cof.PeriodicHoneycomb> 15 | Periodic Kagome <_autosummary/stk.cof.PeriodicKagome> 16 | Periodic Linkerless Honeycomb <_autosummary/stk.cof.PeriodicLinkerlessHoneycomb> 17 | Periodic Square <_autosummary/stk.cof.PeriodicSquare> 18 | -------------------------------------------------------------------------------- /docs/source/constructed_molecule_databases.rst: -------------------------------------------------------------------------------- 1 | Constructed Molecule Databases 2 | ============================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Constructed Molecule Database <_autosummary/stk.ConstructedMoleculeDatabase> 8 | Constructed Molecule MongoDB <_autosummary/stk.ConstructedMoleculeMongoDb> 9 | -------------------------------------------------------------------------------- /docs/source/crossover.rst: -------------------------------------------------------------------------------- 1 | Crossover 2 | ========= 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | Molecule <_autosummary/stk.MoleculeCrosser> 9 | Random Crosser <_autosummary/stk.RandomCrosser> 10 | Genetic Recombination <_autosummary/stk.GeneticRecombination> 11 | -------------------------------------------------------------------------------- /docs/source/fitness_calculators.rst: -------------------------------------------------------------------------------- 1 | Fitness Calculators 2 | =================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Fitness Calculator <_autosummary/stk.FitnessCalculator> 8 | Fitness Function <_autosummary/stk.FitnessFunction> 9 | Property Vector <_autosummary/stk.PropertyVector> 10 | -------------------------------------------------------------------------------- /docs/source/fitness_normalizers.rst: -------------------------------------------------------------------------------- 1 | Fitness Normalizers 2 | =================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Fitness Normalizer <_autosummary/stk.FitnessNormalizer> 8 | Add <_autosummary/stk.Add> 9 | Divide By Mean <_autosummary/stk.DivideByMean> 10 | Multiply <_autosummary/stk.Multiply> 11 | Normalizer Sequence <_autosummary/stk.NormalizerSequence> 12 | Null Fitness Normalizer <_autosummary/stk.NullFitnessNormalizer> 13 | Power <_autosummary/stk.Power> 14 | Replace Fitness <_autosummary/stk.ReplaceFitness> 15 | Shift Up <_autosummary/stk.ShiftUp> 16 | Sum <_autosummary/stk.Sum> 17 | -------------------------------------------------------------------------------- /docs/source/graph_components.rst: -------------------------------------------------------------------------------- 1 | Topology Graph Components 2 | ========================= 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | TopologyGraph <_autosummary/stk.TopologyGraph> 9 | Vertex <_autosummary/stk.Vertex> 10 | Edge <_autosummary/stk.Edge> -------------------------------------------------------------------------------- /docs/source/host_guest.rst: -------------------------------------------------------------------------------- 1 | Host Guest Complexes 2 | ==================== 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | Complex <_autosummary/stk.host_guest.Complex> 9 | Guest <_autosummary/stk.host_guest.Guest> -------------------------------------------------------------------------------- /docs/source/key_makers.rst: -------------------------------------------------------------------------------- 1 | Key Makers 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Molecule Key Maker <_autosummary/stk.MoleculeKeyMaker> 8 | InChI <_autosummary/stk.Inchi> 9 | InChIKey <_autosummary/stk.InchiKey> 10 | SMILES <_autosummary/stk.Smiles> 11 | -------------------------------------------------------------------------------- /docs/source/metal_complex.rst: -------------------------------------------------------------------------------- 1 | Metal Complexes 2 | =============== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Overview and Examples <_autosummary/stk.metal_complex.MetalComplex> 8 | Paddlewheel <_autosummary/stk.metal_complex.Paddlewheel> 9 | Porphyrin <_autosummary/stk.metal_complex.Porphyrin> 10 | Octahedral <_autosummary/stk.metal_complex.Octahedral> 11 | Octahedral Lambda <_autosummary/stk.metal_complex.OctahedralLambda> 12 | Octahedral Delta <_autosummary/stk.metal_complex.OctahedralDelta> 13 | Square Planar <_autosummary/stk.metal_complex.SquarePlanar> 14 | Bidentate Square Planar <_autosummary/stk.metal_complex.BidentateSquarePlanar> 15 | Cis Protected Square Planar <_autosummary/stk.metal_complex.CisProtectedSquarePlanar> 16 | -------------------------------------------------------------------------------- /docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | Modules 2 | ======= 3 | 4 | .. autosummary:: 5 | :toctree: _autosummary 6 | :template: module.rst 7 | :recursive: 8 | 9 | stk 10 | -------------------------------------------------------------------------------- /docs/source/molecule_databases.rst: -------------------------------------------------------------------------------- 1 | Molecule Databases 2 | ================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Molecule Database <_autosummary/stk.MoleculeDatabase> 8 | Molecule MongoDB <_autosummary/stk.MoleculeMongoDb> 9 | -------------------------------------------------------------------------------- /docs/source/mutation.rst: -------------------------------------------------------------------------------- 1 | Mutation 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Molecule <_autosummary/stk.MoleculeMutator> 8 | Random Mutator <_autosummary/stk.RandomMutator> 9 | Random Building Block <_autosummary/stk.RandomBuildingBlock> 10 | Similar Building Block <_autosummary/stk.SimilarBuildingBlock> 11 | Random Topology Graph <_autosummary/stk.RandomTopologyGraph> 12 | -------------------------------------------------------------------------------- /docs/source/optimizers.rst: -------------------------------------------------------------------------------- 1 | Optimizers 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Optimizer <_autosummary/stk.Optimizer> 8 | Collapser <_autosummary/stk.Collapser> 9 | Periodic Collapser <_autosummary/stk.PeriodicCollapser> 10 | MCHammer <_autosummary/stk.MCHammer> 11 | Spinner <_autosummary/stk.Spinner> 12 | NullOptimizer <_autosummary/stk.NullOptimizer> 13 | -------------------------------------------------------------------------------- /docs/source/plotters.rst: -------------------------------------------------------------------------------- 1 | Plotters 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Progress <_autosummary/stk.ProgressPlotter> 8 | Selection <_autosummary/stk.SelectionPlotter> 9 | -------------------------------------------------------------------------------- /docs/source/polymer.rst: -------------------------------------------------------------------------------- 1 | Polymers 2 | ======== 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | Linear <_autosummary/stk.polymer.Linear> -------------------------------------------------------------------------------- /docs/source/reaction_factories.rst: -------------------------------------------------------------------------------- 1 | Reaction Factories 2 | ================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Overview and Examples <_autosummary/stk.ReactionFactory> 8 | Generic Reaction Factory <_autosummary/stk.GenericReactionFactory> 9 | Dative Reaction Factory <_autosummary/stk.DativeReactionFactory> 10 | -------------------------------------------------------------------------------- /docs/source/reactions.rst: -------------------------------------------------------------------------------- 1 | Reactions 2 | ========= 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Overview and Examples <_autosummary/stk.Reaction> 8 | One One Reaction <_autosummary/stk.OneOneReaction> 9 | One Two Reaction <_autosummary/stk.OneTwoReaction> 10 | Ring Amine Reaction <_autosummary/stk.RingAmineReaction> 11 | Two Two Reaction <_autosummary/stk.TwoTwoReaction> 12 | Dative Reaction <_autosummary/stk.DativeReaction> 13 | -------------------------------------------------------------------------------- /docs/source/selection.rst: -------------------------------------------------------------------------------- 1 | Selection 2 | ========= 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | Selector <_autosummary/stk.Selector> 8 | Above Average <_autosummary/stk.AboveAverage> 9 | Best <_autosummary/stk.Best> 10 | Filter Batches <_autosummary/stk.FilterBatches> 11 | Filter Molecules <_autosummary/stk.FilterMolecules> 12 | Remove Batches <_autosummary/stk.RemoveBatches> 13 | Remove Molecules <_autosummary/stk.RemoveMolecules> 14 | Roulette <_autosummary/stk.Roulette> 15 | Stochastic Universal Sampling <_autosummary/stk.StochasticUniversalSampling> 16 | Tournament <_autosummary/stk.Tournament> 17 | Worst <_autosummary/stk.Worst> 18 | -------------------------------------------------------------------------------- /docs/source/small.rst: -------------------------------------------------------------------------------- 1 | Small Molecules 2 | =============== 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | NCore <_autosummary/stk.small.NCore> -------------------------------------------------------------------------------- /docs/source/value_databases.rst: -------------------------------------------------------------------------------- 1 | Value Databases 2 | =============== 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | Value Database <_autosummary/stk.ValueDatabase> 9 | Value MongoDB <_autosummary/stk.ValueMongoDb> 10 | -------------------------------------------------------------------------------- /docs/source/writers.rst: -------------------------------------------------------------------------------- 1 | Molecular Writers 2 | ================= 3 | 4 | 5 | .. toctree:: 6 | :maxdepth: 1 7 | 8 | MDL Mol <_autosummary/stk.MolWriter> 9 | PDB <_autosummary/stk.PdbWriter> 10 | Turbomole <_autosummary/stk.TurbomoleWriter> 11 | XYZ <_autosummary/stk.XyzWriter> 12 | -------------------------------------------------------------------------------- /src/stk/_internal/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/construction_result/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/construction_state/__init__.py: -------------------------------------------------------------------------------- 1 | from .construction_state import ConstructionState # noqa 2 | -------------------------------------------------------------------------------- /src/stk/_internal/construction_state/molecule_state/__init__.py: -------------------------------------------------------------------------------- 1 | from .molecule_state import MoleculeState # noqa 2 | -------------------------------------------------------------------------------- /src/stk/_internal/construction_state/molecule_state/placements_summary/__init__.py: -------------------------------------------------------------------------------- 1 | from .placements_summary import _PlacementsSummary # noqa 2 | -------------------------------------------------------------------------------- /src/stk/_internal/construction_state/molecule_state/reactions_summary/__init__.py: -------------------------------------------------------------------------------- 1 | from .reactions_summary import _ReactionsSummary # noqa 2 | -------------------------------------------------------------------------------- /src/stk/_internal/databases/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/databases/mongo_db/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/crossover/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/evolutionary_algorithm/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/evolutionary_algorithm/implementations/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/evolutionary_algorithm/implementations/serial.py: -------------------------------------------------------------------------------- 1 | """ 2 | Serial Evolutionary Algorithm 3 | ============================= 4 | 5 | """ 6 | 7 | from .implementation import Implementation 8 | 9 | 10 | class Serial(Implementation): 11 | """ 12 | A serial implementation of the default evolutionary algorithm. 13 | 14 | """ 15 | 16 | def get_generations(self, num_generations): 17 | yield from self._get_generations(num_generations, map) 18 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/fitness_calculators/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/fitness_normalizers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/fitness_normalizers/null.py: -------------------------------------------------------------------------------- 1 | import typing 2 | from typing import Any 3 | 4 | from .fitness_normalizer import FitnessNormalizer 5 | 6 | T = typing.TypeVar("T") 7 | 8 | 9 | class NullFitnessNormalizer(FitnessNormalizer[T]): 10 | """ 11 | Does nothing. 12 | 13 | This normalizer just yields the molecule records passed to it, 14 | without changing them in any way. 15 | """ 16 | 17 | def normalize(self, fitness_values: dict[T, Any]) -> dict[T, Any]: 18 | return fitness_values 19 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/mutation/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/plotters/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Plotters 3 | ======== 4 | 5 | #. :class:`.ProgressPlotter` 6 | #. :class:`.SelectionPlotter` 7 | 8 | 9 | The are multiple different plotters, but they are not related by an 10 | inheritance hierarchy. Each plotter has its own distinct API, according 11 | to its needs. 12 | 13 | """ 14 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/selection/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/ea/selection/selectors/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/functional_group_factories/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/functional_groups/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/json_serde/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/key_makers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/optimizers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/optimizers/null.py: -------------------------------------------------------------------------------- 1 | """ 2 | Null Optimizer 3 | ============== 4 | 5 | """ 6 | 7 | from .optimizer import Optimizer 8 | 9 | 10 | class NullOptimizer(Optimizer): 11 | """ 12 | Does not perform an optimization. 13 | 14 | """ 15 | 16 | def optimize(self, state): 17 | return state 18 | -------------------------------------------------------------------------------- /src/stk/_internal/optimizers/optimizer.py: -------------------------------------------------------------------------------- 1 | from stk._internal.construction_state.construction_state import ( 2 | ConstructionState, 3 | ) 4 | 5 | 6 | class Optimizer: 7 | """ 8 | An abstract base class for optimizers. 9 | 10 | An optimizer is used to change the structure of the molecule under 11 | construction to be more realistic. 12 | 13 | """ 14 | 15 | def optimize(self, state: ConstructionState) -> ConstructionState: 16 | """ 17 | Optimize the structure of a molecule under construction. 18 | 19 | Parameters: 20 | state: 21 | The molecule being constructed. 22 | 23 | Returns: 24 | The optimized construction state. 25 | 26 | """ 27 | 28 | raise NotImplementedError() 29 | -------------------------------------------------------------------------------- /src/stk/_internal/reaction_factories/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/reactions/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/reactions/dative_reaction/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/reactions/dative_reaction/utilities.py: -------------------------------------------------------------------------------- 1 | """ 2 | Dative Reaction Utilities 3 | ========================= 4 | 5 | """ 6 | 7 | from itertools import chain 8 | 9 | 10 | def is_metal(atom): 11 | """ 12 | Check if `atom` is a metal atom. 13 | 14 | Parameters 15 | ---------- 16 | atom : :class:`.Atom` 17 | An atom. 18 | 19 | Returns 20 | ------- 21 | :class:`bool` 22 | ``True`` if `atom` is a metal atom. 23 | 24 | """ 25 | 26 | metal_atomic_numbers = chain( 27 | range(21, 31), 28 | range(39, 49), 29 | range(72, 81), 30 | ) 31 | return atom.get_atomic_number() in metal_atomic_numbers 32 | -------------------------------------------------------------------------------- /src/stk/_internal/reactions/reaction/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/cage/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/cof/__init__.py: -------------------------------------------------------------------------------- 1 | from .cof import * # noqa 2 | from .hexagonal import * # noqa 3 | from .honeycomb import * # noqa 4 | from .kagome import * # noqa 5 | from .linkerless_honeycomb import * # noqa 6 | from .periodic_hexagonal import * # noqa 7 | from .periodic_honeycomb import * # noqa 8 | from .periodic_kagome import * # noqa 9 | from .periodic_linkerless_honeycomb import * # noqa 10 | from .periodic_square import * # noqa 11 | from .square import * # noqa 12 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/host_guest/__init__.py: -------------------------------------------------------------------------------- 1 | from . import vertices # noqa 2 | from .complex import * # noqa 3 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/macrocycle/__init__.py: -------------------------------------------------------------------------------- 1 | from . import vertices # noqa 2 | from .macrocycle import * # noqa 3 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/metal_complex/__init__.py: -------------------------------------------------------------------------------- 1 | from . import vertices # noqa 2 | from .metal_complex import * # noqa 3 | from .octahedral import * # noqa 4 | from .paddlewheel import * # noqa 5 | from .porphyrin import * # noqa 6 | from .square_planar import * # noqa 7 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/polymer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/src/stk/_internal/topology_graphs/polymer/__init__.py -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/rotaxane/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Rotaxane 3 | ======== 4 | 5 | #. :class:`.NRotaxane` 6 | 7 | """ 8 | 9 | from . import vertices # noqa 10 | from .nrotaxane import * # noqa 11 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/small/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/src/stk/_internal/topology_graphs/small/__init__.py -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/topology_graph/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/topology_graphs/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | from .edge_sorter import _EdgeSorter # noqa 2 | from .functional_group_sorter import _FunctionalGroupSorter # noqa 3 | -------------------------------------------------------------------------------- /src/stk/_internal/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/utilities/updaters/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/utilities/updaters/mae.py: -------------------------------------------------------------------------------- 1 | """ 2 | MAE Updating Utilities 3 | ====================== 4 | 5 | """ 6 | 7 | from stk._internal.utilities.utilities import mol_from_mae_file 8 | 9 | 10 | def _with_structure_from_mae(self, path): 11 | """ 12 | Change structure to match an ``.mae`` file. 13 | 14 | Parameters 15 | ---------- 16 | path : :class:`str` 17 | The full path of the ``.mae`` file from which the structure 18 | should be updated. 19 | 20 | Returns 21 | ------- 22 | :class:`.Molecule` 23 | The molecule. 24 | 25 | """ 26 | 27 | molecule = mol_from_mae_file(path) 28 | return self._with_position_matrix( 29 | position_matrix=molecule.GetConformer().GetPositions() 30 | ) 31 | -------------------------------------------------------------------------------- /src/stk/_internal/utilities/writers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/_internal/writers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/stk/host_guest.py: -------------------------------------------------------------------------------- 1 | from stk._internal.topology_graphs.host_guest.complex import Complex, Guest 2 | from stk._internal.topology_graphs.host_guest.vertices import ( 3 | GuestVertex, 4 | HostVertex, 5 | ) 6 | 7 | __all__ = [ 8 | "Guest", 9 | "Complex", 10 | "HostVertex", 11 | "GuestVertex", 12 | ] 13 | -------------------------------------------------------------------------------- /src/stk/macrocycle.py: -------------------------------------------------------------------------------- 1 | from stk._internal.topology_graphs.macrocycle import Macrocycle 2 | from stk._internal.topology_graphs.macrocycle.vertices import CycleVertex 3 | 4 | __all__ = [ 5 | "Macrocycle", 6 | "CycleVertex", 7 | ] 8 | -------------------------------------------------------------------------------- /src/stk/polymer.py: -------------------------------------------------------------------------------- 1 | from stk._internal.topology_graphs.polymer.linear import Linear 2 | from stk._internal.topology_graphs.polymer.vertices import ( 3 | HeadVertex, 4 | LinearVertex, 5 | TailVertex, 6 | TerminalVertex, 7 | UnaligningVertex, 8 | ) 9 | 10 | __all__ = [ 11 | "Linear", 12 | "TerminalVertex", 13 | "HeadVertex", 14 | "TailVertex", 15 | "LinearVertex", 16 | "UnaligningVertex", 17 | ] 18 | -------------------------------------------------------------------------------- /src/stk/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/src/stk/py.typed -------------------------------------------------------------------------------- /src/stk/rotaxane.py: -------------------------------------------------------------------------------- 1 | from stk._internal.topology_graphs.rotaxane.nrotaxane import NRotaxane 2 | from stk._internal.topology_graphs.rotaxane.vertices import ( 3 | AxleVertex, 4 | CycleVertex, 5 | ) 6 | 7 | __all__ = [ 8 | "NRotaxane", 9 | "CycleVertex", 10 | "AxleVertex", 11 | ] 12 | -------------------------------------------------------------------------------- /src/stk/small.py: -------------------------------------------------------------------------------- 1 | from stk._internal.topology_graphs.small.ncore import NCore 2 | from stk._internal.topology_graphs.small.vertices import ( 3 | CoreVertex, 4 | SubstituentVertex, 5 | ) 6 | 7 | __all__ = [ 8 | "NCore", 9 | "CoreVertex", 10 | "SubstituentVertex", 11 | ] 12 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/__init__.py -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import pymongo 2 | import pytest 3 | 4 | 5 | def pytest_addoption(parser): 6 | parser.addoption( 7 | "--mongodb_uri", 8 | action="store", 9 | default="mongodb://localhost:27017/", 10 | ) 11 | 12 | 13 | @pytest.fixture( 14 | scope="session", 15 | ) 16 | def mongo_client(pytestconfig): 17 | return pymongo.MongoClient(pytestconfig.getoption("mongodb_uri")) 18 | -------------------------------------------------------------------------------- /tests/databases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/__init__.py -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/constructed_molecule/__init__.py -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures need to be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=(lazy_fixture("constructed_molecule_mongo_db"),), 12 | ) 13 | def case_data(request) -> CaseData: 14 | return request.param 15 | -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .constructed_molecule_mongo_db import * # noqa 2 | -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/get_all/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/constructed_molecule/get_all/__init__.py -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/get_all/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures need to be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=(lazy_fixture("constructed_molecule_mongo_db"),), 12 | ) 13 | def case_data(request) -> CaseData: 14 | return request.param 15 | -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/get_all/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .constructed_molecule_mongo_db import * # noqa 2 | -------------------------------------------------------------------------------- /tests/databases/constructed_molecule/mongo_db/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/constructed_molecule/mongo_db/__init__.py -------------------------------------------------------------------------------- /tests/databases/molecule/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/molecule/__init__.py -------------------------------------------------------------------------------- /tests/databases/molecule/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures need to be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=(lazy_fixture("molecule_mongo_db"),), 10 | ) 11 | def case_data(request): 12 | return request.param 13 | -------------------------------------------------------------------------------- /tests/databases/molecule/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .molecule_mongo_db import * # noqa 2 | -------------------------------------------------------------------------------- /tests/databases/molecule/get_all/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/molecule/get_all/__init__.py -------------------------------------------------------------------------------- /tests/databases/molecule/get_all/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures need to be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=(lazy_fixture("molecule_mongo_db"),), 12 | ) 13 | def case_data(request) -> CaseData: 14 | return request.param 15 | -------------------------------------------------------------------------------- /tests/databases/molecule/get_all/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .molecule_mongo_db import * # noqa 2 | -------------------------------------------------------------------------------- /tests/databases/molecule/mongo_db/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/molecule/mongo_db/__init__.py -------------------------------------------------------------------------------- /tests/databases/molecule/mongo_db/utilities.py: -------------------------------------------------------------------------------- 1 | from collections import Counter 2 | 3 | from ...utilities import DatabaseState, get_entry 4 | 5 | 6 | def get_database_state(database): 7 | """ 8 | Get the state of a :class:`.ValueMongoDb`. 9 | 10 | Parameters 11 | ---------- 12 | database : :class:`.ValueMongoDb` 13 | The database whose state is wanted. 14 | 15 | Returns 16 | ------- 17 | :class:`.DatabaseState` 18 | The current state of `database`. 19 | 20 | """ 21 | 22 | entries = Counter() 23 | entries.update(map(get_entry, database._molecules.find({}))) 24 | entries.update(map(get_entry, database._position_matrices.find({}))) 25 | return DatabaseState(entries) 26 | -------------------------------------------------------------------------------- /tests/databases/value/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/value/__init__.py -------------------------------------------------------------------------------- /tests/databases/value/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures must be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=(lazy_fixture("mongo_db"),), 10 | ) 11 | def case_data(request): 12 | return request.param 13 | -------------------------------------------------------------------------------- /tests/databases/value/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .mongo_db import * # noqa 2 | -------------------------------------------------------------------------------- /tests/databases/value/mongo_db/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/databases/value/mongo_db/__init__.py -------------------------------------------------------------------------------- /tests/databases/value/mongo_db/utilities.py: -------------------------------------------------------------------------------- 1 | from collections import Counter 2 | 3 | from ...utilities import DatabaseState, get_entry 4 | 5 | 6 | def get_database_state(database): 7 | """ 8 | Get the state of a :class:`.ValueMongoDb`. 9 | 10 | Parameters 11 | ---------- 12 | database : :class:`.ValueMongoDb` 13 | The database whose state is wanted. 14 | 15 | Returns 16 | ------- 17 | :class:`.DatabaseState` 18 | The current state of `database`. 19 | 20 | """ 21 | 22 | entries = Counter() 23 | entries.update(map(get_entry, database._values.find({}))) 24 | return DatabaseState(entries) 25 | -------------------------------------------------------------------------------- /tests/drop_test_database.py: -------------------------------------------------------------------------------- 1 | """ 2 | A utility for dropping the databases created by running the tests. 3 | 4 | This script is not part of the test suite. It is meant to be run 5 | manually by developers when they feel the need to. 6 | 7 | """ 8 | 9 | import pymongo 10 | 11 | 12 | def main(): 13 | databases_to_drop = ( 14 | "_stk_pytest_database", 15 | "_stk_test_database_for_testing", 16 | ) 17 | client = pymongo.MongoClient() 18 | for database in databases_to_drop: 19 | client.drop_database(database) 20 | 21 | 22 | if __name__ == "__main__": 23 | main() 24 | -------------------------------------------------------------------------------- /tests/ea/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/__init__.py -------------------------------------------------------------------------------- /tests/ea/crossover/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/crossover/__init__.py -------------------------------------------------------------------------------- /tests/ea/crossover/crossers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/crossover/crossers/__init__.py -------------------------------------------------------------------------------- /tests/ea/crossover/crossers/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures must be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("genetic_recombination"), 11 | lazy_fixture("random_crosser"), 12 | ), 13 | ) 14 | def case_data(request): 15 | return request.param 16 | -------------------------------------------------------------------------------- /tests/ea/crossover/crossers/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .genetic_recombination import * # noqa 2 | from .random import * # noqa 3 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/fitness_calculator/__init__.py -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_caching/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/fitness_calculator/test_caching/__init__.py -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_caching/case_data.py: -------------------------------------------------------------------------------- 1 | import typing 2 | from dataclasses import dataclass 3 | 4 | import stk 5 | 6 | 7 | @dataclass(frozen=True, slots=True) 8 | class CaseData: 9 | fitness_calculator: stk.FitnessCalculator 10 | record: stk.MoleculeRecord 11 | fitness_value: typing.Any 12 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_caching/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures must be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=( 12 | lazy_fixture("fitness_function"), 13 | lazy_fixture("property_vector"), 14 | ), 15 | ) 16 | def case_data(request: pytest.FixtureRequest) -> CaseData: 17 | return request.param 18 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_caching/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .fitness_function import * # noqa 2 | from .property_vector import * # noqa 3 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_caching/fixtures/utilities.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | 4 | class Counter: 5 | def __init__(self) -> None: 6 | self._count = 0 7 | 8 | def get_count(self, *args: typing.Any, **kwargs: typing.Any) -> int: 9 | """ 10 | Return the number of times this method was called. 11 | 12 | Returns: 13 | The number of times the method was called. 14 | """ 15 | self._count += 1 16 | return self._count 17 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_caching/test_caching.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | import stk 4 | 5 | from .case_data import CaseData 6 | 7 | 8 | def test_caching(case_data: CaseData) -> None: 9 | """ 10 | Test that a :class:`.FitnessCalculator` returns cached values. 11 | """ 12 | 13 | _test_caching( 14 | fitness_calculator=case_data.fitness_calculator, 15 | record=case_data.record, 16 | fitness_value=case_data.fitness_value, 17 | ) 18 | 19 | 20 | def _test_caching( 21 | fitness_calculator: stk.FitnessCalculator, 22 | record: stk.MoleculeRecord, 23 | fitness_value: typing.Any, 24 | ): 25 | assert fitness_calculator.get_fitness_value(record) is fitness_value 26 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_get_fitness_value/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/fitness_calculator/test_get_fitness_value/__init__.py -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_get_fitness_value/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures must be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("fitness_function"), 11 | lazy_fixture("property_vector"), 12 | ), 13 | ) 14 | def case_data(request): 15 | return request.param 16 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_get_fitness_value/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .fitness_function import * # noqa 2 | from .property_vector import * # noqa 3 | -------------------------------------------------------------------------------- /tests/ea/fitness_calculator/test_get_fitness_value/fixtures/fitness_function.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import CaseData 5 | 6 | 7 | @pytest.fixture( 8 | scope="session", 9 | params=( 10 | lambda: CaseData( 11 | fitness_calculator=stk.FitnessFunction( 12 | fitness_function=stk.Molecule.get_num_atoms, 13 | ), 14 | molecule=stk.BuildingBlock("BrCCBr"), 15 | fitness_value=8, 16 | ), 17 | ), 18 | ) 19 | def fitness_function(request) -> CaseData: 20 | return request.param() 21 | -------------------------------------------------------------------------------- /tests/ea/fitness_normalizer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/fitness_normalizer/__init__.py -------------------------------------------------------------------------------- /tests/ea/fitness_normalizer/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures must be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=( 12 | lazy_fixture("add"), 13 | lazy_fixture("divide_by_mean"), 14 | lazy_fixture("multiply"), 15 | lazy_fixture("null"), 16 | lazy_fixture("power"), 17 | lazy_fixture("replace_fitness"), 18 | lazy_fixture("sequence"), 19 | lazy_fixture("shift_up"), 20 | lazy_fixture("sum"), 21 | ), 22 | ) 23 | def case_data(request: pytest.FixtureRequest) -> CaseData: 24 | return request.param 25 | -------------------------------------------------------------------------------- /tests/ea/fitness_normalizer/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .add import * # noqa 2 | from .divide_by_mean import * # noqa 3 | from .multiply import * # noqa 4 | from .null import * # noqa 5 | from .power import * # noqa 6 | from .replace_fitness import * # noqa 7 | from .sequence import * # noqa 8 | from .shift_up import * # noqa 9 | from .sum import * # noqa 10 | -------------------------------------------------------------------------------- /tests/ea/mutation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/mutation/__init__.py -------------------------------------------------------------------------------- /tests/ea/mutation/mutator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/mutation/mutator/__init__.py -------------------------------------------------------------------------------- /tests/ea/mutation/mutator/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures must be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("random_building_block"), 11 | lazy_fixture("random_topology_graph"), 12 | lazy_fixture("similar_building_block"), 13 | lazy_fixture("random_mutator"), 14 | ), 15 | ) 16 | def case_data(request): 17 | return request.param 18 | -------------------------------------------------------------------------------- /tests/ea/mutation/mutator/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .random import * # noqa 2 | from .random_building_block import * # noqa 3 | from .random_topology_graph import * # noqa 4 | from .similar_building_block import * # noqa 5 | -------------------------------------------------------------------------------- /tests/ea/plotters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/plotters/__init__.py -------------------------------------------------------------------------------- /tests/ea/plotters/progress/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/plotters/progress/__init__.py -------------------------------------------------------------------------------- /tests/ea/plotters/progress/case_data.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | import pandas as pd 4 | import stk 5 | 6 | 7 | @dataclass(frozen=True, slots=True) 8 | class CaseData: 9 | plotter: stk.ProgressPlotter 10 | plot_data: pd.DataFrame 11 | -------------------------------------------------------------------------------- /tests/ea/plotters/progress/test_progress_plotter.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | 3 | import pandas as pd 4 | import stk 5 | 6 | from .case_data import CaseData 7 | 8 | 9 | def test_progress_plotter(tmp_path: pathlib.Path, case_data: CaseData) -> None: 10 | _test_progress_plotter( 11 | plotter=case_data.plotter, 12 | path=tmp_path / "plot.png", 13 | plot_data=case_data.plot_data, 14 | ) 15 | 16 | 17 | def _test_progress_plotter( 18 | plotter: stk.ProgressPlotter, 19 | path: pathlib.Path, 20 | plot_data: pd.DataFrame, 21 | ) -> None: 22 | plotter.write(path) 23 | assert plotter.get_plot_data().equals(plot_data) 24 | -------------------------------------------------------------------------------- /tests/ea/plotters/selection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/plotters/selection/__init__.py -------------------------------------------------------------------------------- /tests/ea/plotters/selection/case_data.py: -------------------------------------------------------------------------------- 1 | import typing 2 | from dataclasses import dataclass 3 | 4 | import stk 5 | 6 | T = typing.TypeVar("T", bound=stk.MoleculeRecord) 7 | 8 | 9 | @dataclass(frozen=True, slots=True) 10 | class CaseData(typing.Generic[T]): 11 | selector: stk.Selector[T] 12 | population: dict[T, float] 13 | -------------------------------------------------------------------------------- /tests/ea/plotters/selection/test_selection_plotter.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | import typing 3 | 4 | import stk 5 | 6 | from .case_data import CaseData 7 | 8 | T = typing.TypeVar("T", bound=stk.MoleculeRecord) 9 | 10 | 11 | def test_selection_plotter( 12 | tmp_path: pathlib.Path, 13 | case_data: CaseData, 14 | ) -> None: 15 | _test_selection_plotter( 16 | selector=case_data.selector, 17 | population=case_data.population, 18 | filename=tmp_path / "selection", 19 | ) 20 | 21 | 22 | def _test_selection_plotter( 23 | selector: stk.Selector[T], 24 | population: dict[T, float], 25 | filename: pathlib.Path, 26 | ) -> None: 27 | stk.SelectionPlotter(filename, selector) 28 | tuple(selector.select(population)) 29 | -------------------------------------------------------------------------------- /tests/ea/selection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/selection/__init__.py -------------------------------------------------------------------------------- /tests/ea/selection/selector/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/selection/selector/__init__.py -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/selection/selector/select/__init__.py -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/selection/selector/select/select_1/__init__.py -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_1/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures must be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=( 12 | lazy_fixture("above_average"), 13 | lazy_fixture("best"), 14 | lazy_fixture("filter_batches"), 15 | lazy_fixture("filter_molecules"), 16 | lazy_fixture("remove_batches"), 17 | lazy_fixture("remove_molecules"), 18 | lazy_fixture("worst"), 19 | ), 20 | ) 21 | def case_data(request: pytest.FixtureRequest) -> CaseData: 22 | return request.param 23 | -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_1/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .above_average import * # noqa 2 | from .best import * # noqa 3 | from .filter_batches import * # noqa 4 | from .filter_molecules import * # noqa 5 | from .remove_batches import * # noqa 6 | from .remove_molecules import * # noqa 7 | from .worst import * # noqa 8 | -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_1/fixtures/utilities.py: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | T = typing.TypeVar("T") 4 | 5 | 6 | def get_rank_fitness(population: dict[T, float]) -> dict[T, float]: 7 | sorted_population = sorted( 8 | zip(population.values(), population.keys()), 9 | reverse=True, 10 | ) 11 | return { 12 | record: 1 / rank 13 | for rank, (_, record) in enumerate(sorted_population, 1) 14 | } 15 | -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/ea/selection/selector/select/select_2/__init__.py -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_2/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from .case_data import CaseData 5 | 6 | # Fixtures must be visible for lazy_fixture() calls. 7 | from .fixtures import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=( 12 | lazy_fixture("roulette"), 13 | lazy_fixture("stochastic_universal_sampling"), 14 | lazy_fixture("tournament"), 15 | ), 16 | ) 17 | def case_data(request: pytest.FixtureRequest) -> CaseData: 18 | return request.param 19 | -------------------------------------------------------------------------------- /tests/ea/selection/selector/select/select_2/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .roulette import * # noqa 2 | from .stochastic_universal_sampling import * # noqa 3 | from .tournament import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/atom/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/atoms/atom/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/atom/test_clone.py: -------------------------------------------------------------------------------- 1 | from .utilities import is_equivalent_atom 2 | 3 | 4 | def test_clone(atom): 5 | """ 6 | Test :meth:`.Atom.clone`. 7 | 8 | Parameters 9 | ---------- 10 | atom : :class:`.Atom` 11 | The atom to be cloned. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | clone = atom.clone() 20 | is_equivalent_atom(atom, clone) 21 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom/test_get_charge.py: -------------------------------------------------------------------------------- 1 | def test_get_charge(case_data): 2 | """ 3 | Test :meth:`.Atom.get_charge`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | The test case. Holds the atom to test and its correct charge. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.atom.get_charge() == case_data.charge 17 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom/test_get_id.py: -------------------------------------------------------------------------------- 1 | def test_get_id(case_data): 2 | """ 3 | Test :meth:`.Atom.get_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`case_data` 8 | A test case. Holds the atom to test and its correct id. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.atom.get_id() == case_data.id 17 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom/test_repr.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from .utilities import is_equivalent_atom 4 | 5 | 6 | def test_repr(atom): 7 | """ 8 | Test :meth:`.Atom.__repr__`. 9 | 10 | Parameters 11 | ---------- 12 | atom : :class:`.Atom` 13 | The atom, whose representation should be tested. 14 | 15 | Returns 16 | ------- 17 | None : :class:`NoneType` 18 | 19 | """ 20 | 21 | other = eval(repr(atom), dict(stk.__dict__)) 22 | is_equivalent_atom(other, atom) 23 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom/utilities.py: -------------------------------------------------------------------------------- 1 | import rdkit.Chem.AllChem as rdkit 2 | import stk 3 | 4 | 5 | def is_equivalent_atom(atom1, atom2): 6 | assert atom1 is not atom2 7 | assert atom1.__class__ is atom2.__class__ 8 | assert atom1.get_id() == atom2.get_id() 9 | assert atom1.get_charge() == atom2.get_charge() 10 | assert atom1.get_atomic_number() == atom2.get_atomic_number() 11 | 12 | 13 | _periodic_table = rdkit.GetPeriodicTable() 14 | 15 | atomic_numbers = { 16 | stk.__dict__[ 17 | _periodic_table.GetElementSymbol(atomic_number) 18 | ]: atomic_number 19 | for atomic_number in range(1, 119) 20 | } 21 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom_info/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/atoms/atom_info/__init__.py -------------------------------------------------------------------------------- /tests/molecular/atoms/atom_info/test_get_atom.py: -------------------------------------------------------------------------------- 1 | def test_get_atom(case_data): 2 | """ 3 | Test :meth:`.AtomInfo.get_atom`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the atom info to test and the correct atom. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.atom_info.get_atom() is case_data.atom 17 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom_info/test_get_building_block.py: -------------------------------------------------------------------------------- 1 | def test_get_building_block(case_data): 2 | """ 3 | Test :meth:`.AtomInfo.get_building_block`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the atom info to test and the building block 9 | it should be holding. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.atom_info.get_building_block() is case_data.building_block 18 | -------------------------------------------------------------------------------- /tests/molecular/atoms/atom_info/test_get_building_block_id.py: -------------------------------------------------------------------------------- 1 | def test_get_building_block_id(case_data): 2 | """ 3 | Test :meth:`.AtomInfo.get_building_block_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the atom info to test and the correct 9 | building block id. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert ( 18 | case_data.atom_info.get_building_block_id() 19 | == case_data.building_block_id 20 | ) 21 | -------------------------------------------------------------------------------- /tests/molecular/bonds/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/bonds/__init__.py -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/bonds/bond/__init__.py -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/test_clone.py: -------------------------------------------------------------------------------- 1 | def test_clone(bond): 2 | """ 3 | Test :meth:`.Bond.clone`. 4 | 5 | Parameters 6 | ---------- 7 | bond : :class:`.Bond` 8 | The bond to test. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | clone = bond.clone() 17 | 18 | assert clone.get_atom1() is bond.get_atom1() 19 | assert clone.get_atom2() is bond.get_atom2() 20 | assert clone.get_periodicity() is bond.get_periodicity() 21 | assert clone.get_order() is bond.get_order() 22 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/test_get_atom1.py: -------------------------------------------------------------------------------- 1 | def test_get_atom1(case_data): 2 | """ 3 | Test :meth:`.Bond.get_atom1`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the bond to test and the correct *atom1*. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.bond.get_atom1() is case_data.atom1 17 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/test_get_atom2.py: -------------------------------------------------------------------------------- 1 | def test_get_atom2(case_data): 2 | """ 3 | Test :meth:`.Bond.get_atom2`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the bond to test and the correct *atom2*. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.bond.get_atom2() is case_data.atom2 17 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/test_get_order.py: -------------------------------------------------------------------------------- 1 | def test_get_order(case_data): 2 | """ 3 | Test :meth:`.Bond.get_order`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the bond to test and the correct bond order. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.bond.get_order() == case_data.order 17 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/test_get_periodicity.py: -------------------------------------------------------------------------------- 1 | def test_get_periodicity(case_data): 2 | """ 3 | Test :meth:`.Bond.get_periodicity`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the bond to test and the correct 9 | periodicity. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.bond.get_periodicity() == case_data.periodicity 18 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/test_repr.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from .utilities import is_equivalent_atom 4 | 5 | 6 | def test_repr(bond): 7 | """ 8 | Test :meth:`.Bond.__repr__`. 9 | 10 | Parameters 11 | ---------- 12 | bond : :class:`.Bond` 13 | The bond whose representation is tested. 14 | 15 | Returns 16 | ------- 17 | None : :class:`NoneType` 18 | 19 | """ 20 | 21 | other = eval(repr(bond), dict(stk.__dict__)) 22 | is_equivalent_atom(other.get_atom1(), bond.get_atom1()) 23 | is_equivalent_atom(other.get_atom2(), bond.get_atom2()) 24 | assert other.get_order() == bond.get_order() 25 | assert other.get_periodicity() == bond.get_periodicity() 26 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/utilities.py: -------------------------------------------------------------------------------- 1 | def is_equivalent_atom(atom1, atom2): 2 | assert atom1.get_id() == atom2.get_id() 3 | assert atom1.get_charge() == atom2.get_charge() 4 | assert atom1.__class__ is atom2.__class__ 5 | assert atom1.get_atomic_number() == atom2.get_atomic_number() 6 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/with_atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/bonds/bond/with_atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/bonds/bond/with_ids/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/bonds/bond/with_ids/__init__.py -------------------------------------------------------------------------------- /tests/molecular/bonds/bond_info/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/bonds/bond_info/__init__.py -------------------------------------------------------------------------------- /tests/molecular/bonds/bond_info/test_get_bond.py: -------------------------------------------------------------------------------- 1 | def test_get_bond(case_data): 2 | """ 3 | Test :meth:`.BondInfo.get_bond`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the bond info to test and the bond it 9 | should be holding. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.bond_info.get_bond() is case_data.bond 18 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond_info/test_get_building_block.py: -------------------------------------------------------------------------------- 1 | def test_get_building_block(case_data): 2 | """ 3 | Test :meth:`.BondInfo.get_building_block`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData 8 | A test case. Holds the bond info to test and the building 9 | block it should be holding. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.bond_info.get_building_block() is case_data.building_block 18 | -------------------------------------------------------------------------------- /tests/molecular/bonds/bond_info/test_get_building_block_id.py: -------------------------------------------------------------------------------- 1 | def test_get_building_block_id(case_data): 2 | """ 3 | Test :meth:`.BondInfo.get_building_block_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the bond info to test and the building 9 | block id it should be holding. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert ( 18 | case_data.bond_info.get_building_block_id() 19 | == case_data.building_block_id 20 | ) 21 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .alcohol import * # noqa 2 | from .aldehyde import * # noqa 3 | from .alkene import * # noqa 4 | from .alkyne import * # noqa 5 | from .amide import * # noqa 6 | from .boronic_acid import * # noqa 7 | from .bromo import * # noqa 8 | from .carboxylic_acid import * # noqa 9 | from .dibromo import * # noqa 10 | from .difluoro import * # noqa 11 | from .diol import * # noqa 12 | from .fluoro import * # noqa 13 | from .iodo import * # noqa 14 | from .primary_amino import * # noqa 15 | from .ring_amine import * # noqa 16 | from .secondary_amino import * # noqa 17 | from .single_atom import * # noqa 18 | from .thioacid import * # noqa 19 | from .thiol import * # noqa 20 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/alcohol.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import GenericCaseData 5 | 6 | 7 | @pytest.fixture 8 | def alcohol(get_atom_ids): 9 | a, b, c = get_atom_ids(3) 10 | return _alcohol(stk.O(a), stk.H(b), stk.C(c)) 11 | 12 | 13 | def _alcohol(oxygen, hydrogen, atom): 14 | bonders = (oxygen,) 15 | deleters = (hydrogen,) 16 | return GenericCaseData( 17 | functional_group=stk.Alcohol( 18 | oxygen=oxygen, 19 | hydrogen=hydrogen, 20 | atom=atom, 21 | bonders=bonders, 22 | deleters=deleters, 23 | ), 24 | atoms=(oxygen, hydrogen, atom), 25 | bonders=bonders, 26 | deleters=deleters, 27 | ) 28 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/bromo.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import GenericCaseData 5 | 6 | 7 | @pytest.fixture 8 | def bromo(get_atom_ids): 9 | a, b = get_atom_ids(2) 10 | return _bromo(stk.Br(a), stk.C(b)) 11 | 12 | 13 | def _bromo(bromine, atom): 14 | bonders = (atom,) 15 | deleters = (bromine,) 16 | return GenericCaseData( 17 | functional_group=stk.Bromo( 18 | bromine=bromine, 19 | atom=atom, 20 | bonders=bonders, 21 | deleters=deleters, 22 | ), 23 | atoms=(bromine, atom), 24 | bonders=bonders, 25 | deleters=deleters, 26 | ) 27 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/fluoro.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import GenericCaseData 5 | 6 | 7 | @pytest.fixture 8 | def fluoro(get_atom_ids): 9 | a, b = get_atom_ids(2) 10 | return _fluoro(stk.F(a), stk.C(b)) 11 | 12 | 13 | def _fluoro(fluorine, atom): 14 | bonders = (atom,) 15 | deleters = (fluorine,) 16 | return GenericCaseData( 17 | functional_group=stk.Fluoro( 18 | fluorine=fluorine, 19 | atom=atom, 20 | bonders=bonders, 21 | deleters=deleters, 22 | ), 23 | atoms=(fluorine, atom), 24 | bonders=bonders, 25 | deleters=deleters, 26 | ) 27 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/iodo.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import GenericCaseData 5 | 6 | 7 | @pytest.fixture 8 | def iodo(get_atom_ids): 9 | a, b = get_atom_ids(2) 10 | return _iodo(stk.I(a), stk.C(b)) 11 | 12 | 13 | def _iodo(iodine, atom): 14 | bonders = (atom,) 15 | deleters = (iodine,) 16 | return GenericCaseData( 17 | functional_group=stk.Iodo( 18 | iodine=iodine, 19 | atom=atom, 20 | bonders=bonders, 21 | deleters=deleters, 22 | ), 23 | atoms=(iodine, atom), 24 | bonders=bonders, 25 | deleters=deleters, 26 | ) 27 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/single_atom.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import GenericCaseData 5 | 6 | 7 | @pytest.fixture 8 | def single_atom(get_atom_ids): 9 | (a,) = get_atom_ids(1) 10 | return _single_atom(stk.N(a)) 11 | 12 | 13 | def _single_atom(atom): 14 | atoms = (atom,) 15 | deleters = () 16 | return GenericCaseData( 17 | functional_group=stk.SingleAtom(atom=atom), 18 | atoms=atoms, 19 | bonders=atoms, 20 | deleters=deleters, 21 | ) 22 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/fixtures/thiol.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ..case_data import GenericCaseData 5 | 6 | 7 | @pytest.fixture 8 | def thiol(get_atom_ids): 9 | a, b, c = get_atom_ids(3) 10 | return _thiol(stk.S(a), stk.H(b), stk.C(c)) 11 | 12 | 13 | def _thiol(sulfur, hydrogen, atom): 14 | bonders = () 15 | deleters = () 16 | return GenericCaseData( 17 | functional_group=stk.Thiol( 18 | sulfur=sulfur, 19 | hydrogen=hydrogen, 20 | atom=atom, 21 | bonders=bonders, 22 | deleters=deleters, 23 | ), 24 | atoms=(sulfur, hydrogen, atom), 25 | bonders=bonders, 26 | deleters=deleters, 27 | ) 28 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/functional_group/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/functional_group/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/functional_group/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..utilities import is_clone_functional_group 2 | 3 | 4 | def test_clone(functional_group): 5 | """ 6 | Test :meth:`.FunctionalGroup.clone`. 7 | 8 | Parameters 9 | ---------- 10 | functional_group : :class:`.FunctionalGroup` 11 | The functional group to clone. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | clone = functional_group.clone() 20 | is_clone_functional_group(functional_group, clone) 21 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/functional_group/test_repr.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from ..utilities import is_equivalent_functional_group 4 | 5 | 6 | def test_repr(functional_group): 7 | """ 8 | Test :meth:`.FunctionalGroup.__repr__`. 9 | 10 | Parameters 11 | ---------- 12 | functional_group : :class:`.FunctionalGroup` 13 | The functional group whose representation is tested. 14 | 15 | Returns 16 | ------- 17 | None : :class:`NoneType` 18 | 19 | """ 20 | 21 | other = eval(repr(functional_group), dict(stk.__dict__)) 22 | is_equivalent_functional_group(functional_group, other) 23 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/functional_group/with_atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/functional_group/with_atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/functional_group/with_ids/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/functional_group/with_ids/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/generic_functional_group/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/generic_functional_group/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/generic_functional_group/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..utilities import is_clone_generic_functional_group 2 | 3 | 4 | def test_clone(generic_functional_group): 5 | """ 6 | Test :meth:`.GenericFunctionalGroup.clone`. 7 | 8 | Parameters 9 | ---------- 10 | generic_functional_group : :class:`.GenericFunctionalGroup` 11 | The functional group to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | clone = generic_functional_group.clone() 20 | is_clone_generic_functional_group(generic_functional_group, clone) 21 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/generic_functional_group/test_repr.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from ..utilities import is_equivalent_generic_functional_group 4 | 5 | 6 | def test_repr(generic_functional_group): 7 | """ 8 | Test :meth:`.GenericFunctionalGroup.__repr__`. 9 | 10 | Parameters 11 | ---------- 12 | generic_functional_group : :class:`.GenericFunctionalGroup` 13 | The functional group, whose representation should be tested. 14 | 15 | Returns 16 | ------- 17 | None : :class:`NoneType` 18 | 19 | """ 20 | 21 | other = eval(repr(generic_functional_group), dict(stk.__dict__)) 22 | is_equivalent_generic_functional_group( 23 | functional_group1=generic_functional_group, 24 | functional_group2=other, 25 | ) 26 | -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/generic_functional_group/with_atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/generic_functional_group/with_atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group/generic_functional_group/with_ids/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group/generic_functional_group/with_ids/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group_factory/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group_factory/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group_factory/functional_group_factory/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group_factory/functional_group_factory/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group_factory/generic_functional_group_factory/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/functional_groups/functional_group_factory/generic_functional_group_factory/__init__.py -------------------------------------------------------------------------------- /tests/molecular/functional_groups/functional_group_factory/utilities.py: -------------------------------------------------------------------------------- 1 | import itertools as it 2 | 3 | 4 | def atom_id(atom): 5 | return atom.get_id() 6 | 7 | 8 | def are_same_id_sequences(ids1, ids2): 9 | for id1, id2 in it.zip_longest(ids1, ids2): 10 | assert id1 == id2 11 | 12 | 13 | def are_clone_sequences(atoms1, atoms2): 14 | """ 15 | Test if `atoms1` and `atoms2` are clones of each other. 16 | 17 | """ 18 | 19 | for a1, a2 in it.zip_longest(atoms1, atoms2): 20 | assert a1 is not a2 21 | assert a1.get_id() == a2.get_id() 22 | assert a1.get_charge() == a2.get_charge() 23 | assert a1.__class__ is a2.__class__ 24 | -------------------------------------------------------------------------------- /tests/molecular/key_makers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/key_makers/__init__.py -------------------------------------------------------------------------------- /tests/molecular/key_makers/test_get_key_name.py: -------------------------------------------------------------------------------- 1 | def test_get_key_name(case_data): 2 | """ 3 | Test :meth:`.get_key_name`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the key maker to test and the correct name. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.key_maker.get_key_name() == case_data.key_name 17 | -------------------------------------------------------------------------------- /tests/molecular/molecules/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/building_block/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/building_block/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/building_block/case_data.py: -------------------------------------------------------------------------------- 1 | import stk 2 | from dataclasses import dataclass 3 | from collections.abc import Sequence 4 | 5 | 6 | @dataclass(slots=True, frozen=True) 7 | class CaseData: 8 | building_block: stk.BuildingBlock 9 | functional_groups: Sequence[stk.FunctionalGroup] 10 | known_repr: str 11 | core_atom_ids: Sequence[int] 12 | placer_ids: Sequence[int] 13 | -------------------------------------------------------------------------------- /tests/molecular/molecules/building_block/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .default_init import * # noqa 2 | from .init import * # noqa 3 | from .init_from_file import * # noqa 4 | from .init_from_molecule import * # noqa 5 | from .init_from_rdkit_mol import * # noqa 6 | -------------------------------------------------------------------------------- /tests/molecular/molecules/building_block/test_get_core_atom_ids.py: -------------------------------------------------------------------------------- 1 | import itertools as it 2 | 3 | from .case_data import CaseData 4 | 5 | 6 | def test_get_core_atom_ids(case_data: CaseData) -> None: 7 | """ 8 | Test :meth:`.BuildingBlock.get_core_atom_ids`. 9 | 10 | Parameters: 11 | case_data: 12 | A test case. Holds the building block to test and the correct 13 | core atom ids. 14 | 15 | """ 16 | 17 | for id1, id2 in it.zip_longest( 18 | case_data.building_block.get_core_atom_ids(), 19 | case_data.core_atom_ids, 20 | ): 21 | assert id1 == id2 22 | -------------------------------------------------------------------------------- /tests/molecular/molecules/building_block/test_get_num_functional_groups.py: -------------------------------------------------------------------------------- 1 | from .case_data import CaseData 2 | 3 | 4 | def test_get_num_functional_groups(case_data: CaseData) -> None: 5 | """ 6 | Test :meth:`.BuildingBlock.get_num_functional_groups`. 7 | 8 | Parameters: 9 | case_data: 10 | A test case. Holds the building block to test and the correct 11 | functional groups. 12 | 13 | """ 14 | 15 | assert case_data.building_block.get_num_functional_groups() == len( 16 | case_data.functional_groups 17 | ) 18 | -------------------------------------------------------------------------------- /tests/molecular/molecules/constructed_molecule/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/constructed_molecule/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/constructed_molecule/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures need to be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("linear"), 11 | lazy_fixture("cof"), 12 | ), 13 | ) 14 | def case_data(request): 15 | return request.param 16 | 17 | 18 | @pytest.fixture 19 | def constructed_molecule(case_data): 20 | return case_data.constructed_molecule 21 | -------------------------------------------------------------------------------- /tests/molecular/molecules/constructed_molecule/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .cof import * # noqa 2 | from .linear import * # noqa 3 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .cage import * # noqa 2 | from .cof import * # noqa 3 | from .host_guest import * # noqa 4 | from .macrocycle import * # noqa 5 | from .metal_complex import * # noqa 6 | from .polymer import * # noqa 7 | from .rotaxane import * # noqa 8 | from .small import * # noqa 9 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/__init__.py: -------------------------------------------------------------------------------- 1 | from .cage import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/metal_topologies/__init__.py: -------------------------------------------------------------------------------- 1 | from .m2l4_lantern import * # noqa 2 | from .m3l3_triangle import * # noqa 3 | from .m3l6 import * # noqa 4 | from .m4l4_square import * # noqa 5 | from .m4l4_tetrahedron import * # noqa 6 | from .m4l6_tetrahedron import * # noqa 7 | from .m4l6_tetrahedron_spacer import * # noqa 8 | from .m4l8 import * # noqa 9 | from .m6l2l3_prism import * # noqa 10 | from .m6l12_cube import * # noqa 11 | from .m8l6_cube import * # noqa 12 | from .m12l24 import * # noqa 13 | from .m24l48 import * # noqa 14 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/three_plus_four/__init__.py: -------------------------------------------------------------------------------- 1 | from .six_plus_eight import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/three_plus_three/__init__.py: -------------------------------------------------------------------------------- 1 | from .four_plus_four import * # noqa 2 | from .one_plus_one import * # noqa 3 | from .two_plus_two import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/two_plus_five/__init__.py: -------------------------------------------------------------------------------- 1 | from .twelve_plus_thirty import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/two_plus_four/__init__.py: -------------------------------------------------------------------------------- 1 | from .eight_plus_sixteen import * # noqa 2 | from .five_plus_ten import * # noqa 3 | from .four_plus_eight import * # noqa 4 | from .six_plus_twelve import * # noqa 5 | from .ten_plus_twenty import * # noqa 6 | from .three_plus_six import * # noqa 7 | from .two_plus_four import * # noqa 8 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cage/two_plus_three/__init__.py: -------------------------------------------------------------------------------- 1 | from .eight_plus_twelve import * # noqa 2 | from .four_plus_six import * # noqa 3 | from .four_plus_six_2 import * # noqa 4 | from .six_plus_nine import * # noqa 5 | from .twenty_plus_thirty import * # noqa 6 | from .two_plus_three import * # noqa 7 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/cof/__init__.py: -------------------------------------------------------------------------------- 1 | from .cof import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/host_guest/__init__.py: -------------------------------------------------------------------------------- 1 | from .host_guest import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/host_guest/host_guest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures need to be visible for lazy_fixture() calls. 5 | from .complex import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=(lazy_fixture("host_guest_complex"),), 10 | ) 11 | def host_guest(request): 12 | return request.param 13 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/macrocycle/__init__.py: -------------------------------------------------------------------------------- 1 | from .macrocycle import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/metal_complex/__init__.py: -------------------------------------------------------------------------------- 1 | from .metal_complex import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/metal_complex/octahedral/__init__.py: -------------------------------------------------------------------------------- 1 | from .octahedral import * # noqa 2 | from .octahedral_delta import * # noqa 3 | from .octahedral_lambda import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/metal_complex/paddlewheel/__init__.py: -------------------------------------------------------------------------------- 1 | from .paddlewheel import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/metal_complex/porphyrin/__init__.py: -------------------------------------------------------------------------------- 1 | from .porphyrin import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/metal_complex/square_planar/__init__.py: -------------------------------------------------------------------------------- 1 | from .bidentate_square_planar import * # noqa 2 | from .cis_protected_square_planar import * # noqa 3 | from .square_planar import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/polymer/__init__.py: -------------------------------------------------------------------------------- 1 | from .polymer import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/polymer/polymer.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from ...case_data import CaseData 5 | 6 | # Fixtures need to be visible for lazy_fixture() calls. 7 | from .linear import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=(lazy_fixture("polymer_linear"),), 12 | ) 13 | def polymer(request: pytest.FixtureRequest) -> CaseData: 14 | return request.param 15 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block3.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block4.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block4.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block5.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block5.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/building_block6.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/building_block6.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_eight_plus_sixteen0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_eight_plus_sixteen0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_eight_plus_twelve0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_eight_plus_twelve0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_eight_plus_twelve1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_eight_plus_twelve1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_five_plus_ten0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_five_plus_ten0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_eight0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_eight0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_four0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_four0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_six0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_six0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_six_20.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_six_20.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_six_21.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_four_plus_six_21.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_one_plus_one0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_one_plus_one0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_eight0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_eight0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_eight1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_eight1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_nine0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_nine0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_twelve0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_six_plus_twelve0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_ten_plus_twenty0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_ten_plus_twenty0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_three_plus_six0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_three_plus_six0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_twelve_plus_thirty0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_twelve_plus_thirty0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_twenty_plus_thirty0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_twenty_plus_thirty0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_two_plus_four0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_two_plus_four0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_two_plus_three0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_two_plus_three0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cage_two_plus_two0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cage_two_plus_two0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal3.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal4.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_hexagonal4.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_honeycomb2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_kagome0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_kagome0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_linkerless_honeycomb0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_linkerless_honeycomb0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_hexagonal1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_honeycomb1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_kagome1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_linkerless_honeycomb1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_periodic_square1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/cof_square0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/cof_square0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/host_guest_complex3.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/macrocycle_macrocycle0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/macrocycle_macrocycle0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/macrocycle_macrocycle1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/macrocycle_macrocycle1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m12l240.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m12l240.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m24l480.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m24l480.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m2l4_lantern0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m2l4_lantern0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m2l4_lantern1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m2l4_lantern1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle3.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle4.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l3_triangle4.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l60.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l60.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l61.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m3l61.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_square3.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_tetrahedron0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l4_tetrahedron0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l6_tetrahedron0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l6_tetrahedron0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l6_tetrahedron_spacer0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l6_tetrahedron_spacer0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l80.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m4l80.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m6l12_cube0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m6l12_cube0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m6l12_cube1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m6l12_cube1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m6l2l3_prism0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m6l2l3_prism0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m8l6_cube0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_cage_m8l6_cube0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_bidentate_square_planar0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_bidentate_square_planar0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_bidentate_square_planar1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_bidentate_square_planar1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_cis_protected_square_planar0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_cis_protected_square_planar0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_cis_protected_square_planar1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_cis_protected_square_planar1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_delta0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_delta0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_delta1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_delta1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_lambda0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_lambda0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_lambda1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_octahedral_lambda1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_paddlewheel0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_paddlewheel0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_paddlewheel1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_paddlewheel1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_paddlewheel2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_paddlewheel2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_porphyrin0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_porphyrin0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_porphyrin1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_porphyrin1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_square_planar0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_square_planar0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_square_planar1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/metal_complex_square_planar1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear1.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear1.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear2.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear2.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear3.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/polymer_linear3.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/position_matrices/rotaxane_nrotaxane0.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/fixtures/position_matrices/rotaxane_nrotaxane0.npy -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/rotaxane/__init__.py: -------------------------------------------------------------------------------- 1 | from .rotaxane import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/rotaxane/rotaxane.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures must be visible for lazy_fixture() calls. 5 | from .nrotaxane import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=(lazy_fixture("rotaxane_nrotaxane"),), 10 | ) 11 | def rotaxane(request): 12 | return request.param 13 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/small/__init__.py: -------------------------------------------------------------------------------- 1 | from .small import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/fixtures/small/small.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | from ...case_data import CaseData 5 | 6 | # Fixtures need to be visible for lazy_fixture() calls. 7 | from .ncore import * # noqa 8 | 9 | 10 | @pytest.fixture( 11 | params=(lazy_fixture("small_ncore"),), 12 | ) 13 | def small(request: pytest.FixtureRequest) -> CaseData: 14 | return request.param 15 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_atoms/conftest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_atoms/conftest.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_atoms/get_atoms_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_atoms/get_atoms_1/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_atoms/get_atoms_1/case_data.py: -------------------------------------------------------------------------------- 1 | class CaseData: 2 | """ 3 | A test case. 4 | 5 | Attributes 6 | ---------- 7 | molecule : :class:`.Molecule` 8 | The molecule to test. 9 | 10 | atoms : :class:`tuple` 11 | The correct atoms of the molecule. 12 | 13 | """ 14 | 15 | def __init__(self, molecule, atoms): 16 | """ 17 | Initialize a :class:`.CaseData` instance. 18 | 19 | Parameters 20 | ---------- 21 | molecule : :class:`.Molecule` 22 | The molecule to test. 23 | 24 | atoms : :class:`.Atom` 25 | The correct atoms of the molecule. 26 | 27 | """ 28 | 29 | self.molecule = molecule 30 | self.atoms = atoms 31 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_atoms/get_atoms_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_atoms/get_atoms_2/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_bonds/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_bonds/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_bonds/case_data.py: -------------------------------------------------------------------------------- 1 | class CaseData: 2 | """ 3 | A test case. 4 | 5 | Attributes 6 | ---------- 7 | molecule : :class:`.Molecule` 8 | The molecule to test. 9 | 10 | bonds : :class:`tuple` of :class:`.Bond` 11 | The correct bonds of :attr:`.molecule`. 12 | 13 | """ 14 | 15 | def __init__(self, molecule, bonds): 16 | """ 17 | Initialize a :class:`.CaseData` instance. 18 | 19 | Parameters 20 | ---------- 21 | molecule : :class:`.Molecule` 22 | The molecule to test. 23 | 24 | bonds : :class:`tuple` of :class:`.Bond` 25 | The correct bonds of `molecule`. 26 | 27 | """ 28 | 29 | self.molecule = molecule 30 | self.bonds = bonds 31 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_canonical_atom_ids/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_canonical_atom_ids/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_canonical_atom_ids/test_get_canonical_atom_ids.py: -------------------------------------------------------------------------------- 1 | def test_get_canonical_atom_ids(case_data): 2 | """ 3 | Test :meth:`.Molecule.get_canonical_atom_ids`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the molecule to test and the expected 9 | canonical atom ids. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | _test_get_canonical_atom_ordering( 18 | molecule=case_data.molecule, 19 | canonical_atom_ids=case_data.canonical_atom_ids, 20 | ) 21 | 22 | 23 | def _test_get_canonical_atom_ordering(molecule, canonical_atom_ids): 24 | assert molecule.get_canonical_atom_ids() == canonical_atom_ids 25 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_centroid/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_centroid/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_direction/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_direction/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_maximum_diameter/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_maximum_diameter/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_maximum_diameter/utilities.py: -------------------------------------------------------------------------------- 1 | from scipy.spatial.distance import euclidean 2 | 3 | 4 | def get_maximum_diameter(position_matrix, atom_ids): 5 | atomic_positions = position_matrix[atom_ids, :] 6 | return float( 7 | euclidean( 8 | atomic_positions.min(axis=0), 9 | atomic_positions.max(axis=0), 10 | ) 11 | ) 12 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_atoms/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_num_atoms/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_atoms/get_num_atoms_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_num_atoms/get_num_atoms_1/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_atoms/get_num_atoms_1/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from .case_data import CaseData 5 | 6 | 7 | @pytest.fixture( 8 | params=( 9 | lambda: CaseData( 10 | molecule=stk.BuildingBlock("NCCN"), 11 | num_atoms=12, 12 | ), 13 | ), 14 | ) 15 | def case_data(request) -> CaseData: 16 | return request.param() 17 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_atoms/get_num_atoms_1/test_get_num_atoms.py: -------------------------------------------------------------------------------- 1 | def test_get_num_atoms(case_data): 2 | """ 3 | Test :meth:`.Molecule.get_num_atoms`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the molecule to test and the number of atoms 9 | it should have. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.molecule.get_num_atoms() == case_data.num_atoms 18 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_atoms/get_num_atoms_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_num_atoms/get_num_atoms_2/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_bonds/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_num_bonds/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_1/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_1/case_data.py: -------------------------------------------------------------------------------- 1 | class CaseData: 2 | """ 3 | A test case. 4 | 5 | Attributes 6 | ---------- 7 | molecule : :class:`.Molecule 8 | The molecule to test. 9 | 10 | num_bonds : :class:`int` 11 | The correct number of bonds of :attr:`.molecule`. 12 | 13 | """ 14 | 15 | def __init__(self, molecule, num_bonds): 16 | """ 17 | Initialize a :class:`.CaseData` instance. 18 | 19 | Parameters 20 | ---------- 21 | molecule : :class:`.Molecule` 22 | The molecule to test. 23 | 24 | num_bonds : :class:`int` 25 | The correct number of bonds of `molecule`. 26 | 27 | """ 28 | 29 | self.molecule = molecule 30 | self.num_bonds = num_bonds 31 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_1/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from .case_data import CaseData 5 | 6 | 7 | @pytest.fixture( 8 | params=( 9 | lambda: CaseData(molecule=stk.BuildingBlock("NCCN"), num_bonds=11), 10 | ), 11 | ) 12 | def case_data(request) -> CaseData: 13 | """ 14 | A :class:`.CaseData` instance. 15 | 16 | """ 17 | 18 | return request.param() 19 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_1/test_get_num_bonds.py: -------------------------------------------------------------------------------- 1 | def test_get_num_bonds(case_data): 2 | """ 3 | Test :meth:`.Molecule.get_num_bonds`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the molecule to test and the correct number 9 | of bonds. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.molecule.get_num_bonds() == case_data.num_bonds 18 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_num_bonds/get_num_bonds_2/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_plane_normal/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/get_plane_normal/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/get_plane_normal/utilities.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | from ..utilities import get_centroid 4 | 5 | 6 | def get_plane_normal(position_matrix, atom_ids): 7 | # In this case, Molecule.get_plane_normal should raise the error, 8 | # so this should should just fail silently, and the explicit 9 | # failure of Molecule.get_plane_normal will be caught. 10 | if len(atom_ids) == 0: 11 | return 12 | 13 | atomic_positions = position_matrix[atom_ids, :] 14 | centroid = get_centroid(position_matrix, atom_ids) 15 | return np.around( 16 | a=np.linalg.svd(atomic_positions - centroid)[-1][2, :], 17 | decimals=14, 18 | ) 19 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..utilities import has_same_structure, is_clone 2 | 3 | 4 | def test_clone(molecule): 5 | """ 6 | Test :meth:`.Molecule.clone`. 7 | 8 | Parameters 9 | ---------- 10 | molecule : :class:`.Molecule` 11 | The molecule to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | clone = molecule.clone() 20 | has_same_structure(molecule, clone) 21 | is_clone(molecule, clone) 22 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/test_get_position_matrix.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_position_matrix(case_data): 5 | """ 6 | Test :meth:`.Molecule.get_position_matrix`. 7 | 8 | Parameters 9 | ---------- 10 | case_data : :class:`.CaseData 11 | A test case. Holds the molecule to test and the correct 12 | position matrix. 13 | 14 | Returns 15 | ------- 16 | None : :class:`NoneType` 17 | 18 | """ 19 | 20 | assert np.allclose( 21 | a=case_data.position_matrix, 22 | b=case_data.molecule.get_position_matrix(), 23 | atol=1e-6, 24 | ) 25 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_canonical_atom_ordering/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_canonical_atom_ordering/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_centroid/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_centroid/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_displacement/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_displacement/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_displacement/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | 4 | @pytest.fixture 5 | def displacement(origin): 6 | return origin 7 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_rotation_about_axis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_rotation_about_axis/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_rotation_about_axis/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | 4 | 5 | @pytest.fixture( 6 | params=[ 7 | -np.pi / 2, 8 | np.pi / 2, 9 | ], 10 | ) 11 | def angle(request): 12 | return request.param 13 | 14 | 15 | @pytest.fixture( 16 | params=[ 17 | np.array([0, 1, 0]), 18 | np.array([1, 0, 0]), 19 | np.array([1 / np.sqrt(3), 1 / np.sqrt(3), 1 / np.sqrt(3)]), 20 | ], 21 | ) 22 | def axis(request): 23 | return np.array(request.param) 24 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_rotation_between_vectors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_rotation_between_vectors/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_rotation_to_minimize_angle/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_rotation_to_minimize_angle/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_structure_from_file/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import pytest 4 | 5 | 6 | @pytest.fixture( 7 | params=[ 8 | "molecule.mol", 9 | "molecule.xyz", 10 | ], 11 | ) 12 | def path(request, tmpdir): 13 | return os.path.join(tmpdir, request.param) 14 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_1/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_1/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/case_data.py: -------------------------------------------------------------------------------- 1 | class CaseData: 2 | """ 3 | A test case. 4 | 5 | Attributes 6 | ---------- 7 | molecule : :class:`.Molecule` 8 | The molecule to test. 9 | 10 | path : :class:`str` 11 | The name of the structure file to use for the test. 12 | 13 | """ 14 | 15 | def __init__(self, molecule, path): 16 | """ 17 | Initialize a :class:`.CaseData` instance. 18 | 19 | Parameters 20 | ---------- 21 | molecule : :class:`.Molecule` 22 | The molecule to test. 23 | 24 | path : :class:`str` 25 | The name of the structure file to use for the test. 26 | 27 | """ 28 | 29 | self.molecule = molecule 30 | self.path = path 31 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/test_with_structure_from_file/NCCN.coord: -------------------------------------------------------------------------------- 1 | $coord angs 2 | -20.3789 -0.7953 0.3238 N 3 | -0.698 0.4411 0.5929 C 4 | 0.4802 0.6365 -0.3568 C 5 | 1.4531 -0.3716 -0.2778 N 6 | -1.8591 -0.7562 -0.6012 H 7 | -0.732 -1.6254 0.3496 H 8 | -0.3501 0.4675 1.6463 H 9 | -1.414 1.2621 0.3731 H 10 | 0.0242 0.6054 -1.388 H 11 | 0.9168 1.6345 -0.1926 H 12 | 1.468 -1.1058 -0.9708 H 13 | 2.0898 -0.3929 0.5016 H 14 | $end 15 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/test_with_structure_from_file/NCCN.xyz: -------------------------------------------------------------------------------- 1 | 12 2 | 3 | N -9.30347 -1.29349 1.80765 4 | C -8.62259 -0.05711 2.07680 5 | C 0.48023 0.63651 -0.35681 6 | N 1.45306 -0.37158 -0.27781 7 | H -9.78362 -1.25438 0.88260 8 | H -8.65656 -2.12363 1.83345 9 | H -8.27469 -0.03069 3.13012 10 | H -9.33861 0.76394 1.85698 11 | H -7.90034 0.10714 0.09581 12 | H 0.91683 1.63453 -0.19265 13 | H 1.46801 -1.10578 -0.97079 14 | H 2.08981 -0.39293 0.50159 15 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/test_with_structure_from_file/NCCN_with_cell1.coord: -------------------------------------------------------------------------------- 1 | $lattice angs 2 | 3.153833580 1.115048556 1.931320751 3 | 0.000000000 3.345145667 1.931320751 4 | 0.000000000 0.000000000 3.862641503 5 | $periodic 3 6 | $coord angs 7 | -20.3789 -0.7953 0.3238 N 8 | -0.698 0.4411 0.5929 C 9 | 0.4802 0.6365 -0.3568 C 10 | 1.4531 -0.3716 -0.2778 N 11 | -1.8591 -0.7562 -0.6012 H 12 | -0.732 -1.6254 0.3496 H 13 | -0.3501 0.4675 1.6463 H 14 | -1.414 1.2621 0.3731 H 15 | 0.0242 0.6054 -1.388 H 16 | 0.9168 1.6345 -0.1926 H 17 | 1.468 -1.1058 -0.9708 H 18 | 2.0898 -0.3929 0.5016 H 19 | $end 20 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/with_structure_from_file/with_structure_from_file_2/test_with_structure_from_file/NCCN_with_cell2.coord: -------------------------------------------------------------------------------- 1 | $coord angs 2 | -20.3789 -0.7953 0.3238 N 3 | -0.698 0.4411 0.5929 C 4 | 0.4802 0.6365 -0.3568 C 5 | 1.4531 -0.3716 -0.2778 N 6 | -1.8591 -0.7562 -0.6012 H 7 | -0.732 -1.6254 0.3496 H 8 | -0.3501 0.4675 1.6463 H 9 | -1.414 1.2621 0.3731 H 10 | 0.0242 0.6054 -1.388 H 11 | 0.9168 1.6345 -0.1926 H 12 | 1.468 -1.1058 -0.9708 H 13 | 2.0898 -0.3929 0.5016 H 14 | $periodic 3 15 | $cell angs 16 | 3.570 3.570 3.570 90 90 90 17 | $end 18 | -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/write/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/molecules/molecule/write/__init__.py -------------------------------------------------------------------------------- /tests/molecular/molecules/molecule/write/conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pathlib 3 | 4 | import pytest 5 | 6 | 7 | @pytest.fixture( 8 | params=[ 9 | "molecule.mol", 10 | "molecule.xyz", 11 | pathlib.Path("molecule-path.mol"), 12 | pathlib.Path("molecule-path.xyz"), 13 | ], 14 | ) 15 | def path(request, tmpdir): 16 | return os.path.join(tmpdir, request.param) 17 | -------------------------------------------------------------------------------- /tests/molecular/molecules/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | from .building_block import * # noqa 2 | from .constructed_molecule import * # noqa 3 | from .molecule import * # noqa 4 | from .utilities import * # noqa 5 | -------------------------------------------------------------------------------- /tests/molecular/molecules/utilities/constructed_molecule.py: -------------------------------------------------------------------------------- 1 | from tests.utilities import is_equivalent_constructed_molecule 2 | 3 | 4 | def is_clone_constructed_molecule( 5 | constructed_molecule1, 6 | constructed_molecule2, 7 | ): 8 | assert constructed_molecule1 is not constructed_molecule2 9 | is_equivalent_constructed_molecule( 10 | constructed_molecule1=constructed_molecule1, 11 | constructed_molecule2=constructed_molecule2, 12 | ) 13 | -------------------------------------------------------------------------------- /tests/molecular/molecules/utilities/molecule.py: -------------------------------------------------------------------------------- 1 | from tests.utilities import is_equivalent_molecule 2 | 3 | 4 | def is_clone_molecule(molecule1, molecule2): 5 | assert molecule1 is not molecule2 6 | is_equivalent_molecule(molecule1, molecule2) 7 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/periodic_info/__init__.py -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_a.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_a(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_a`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | assert np.isclose( 20 | periodic_case.a, 21 | periodic_case.periodic_info.get_a(), 22 | atol=1e-6, 23 | ) 24 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_alpha.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_alpha(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_alpha`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | assert np.isclose( 20 | periodic_case.alpha, 21 | periodic_case.periodic_info.get_alpha(), 22 | atol=1e-6, 23 | ) 24 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_b.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_b(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_b`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | assert np.isclose( 20 | periodic_case.b, 21 | periodic_case.periodic_info.get_b(), 22 | atol=1e-6, 23 | ) 24 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_beta.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_beta(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_beta`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | assert np.isclose( 20 | periodic_case.beta, 21 | periodic_case.periodic_info.get_beta(), 22 | atol=1e-6, 23 | ) 24 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_c.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_c(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_c`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | assert np.isclose( 20 | periodic_case.c, 21 | periodic_case.periodic_info.get_c(), 22 | atol=1e-6, 23 | ) 24 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_cell_matrix.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_cell_matrix(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_cell_matrix`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | test = np.array( 20 | ( 21 | periodic_case.vector_1, 22 | periodic_case.vector_2, 23 | periodic_case.vector_3, 24 | ) 25 | ) 26 | original = np.array(periodic_case.periodic_info.get_cell_matrix()) 27 | 28 | assert np.all(np.allclose(test, original, atol=1e-6)) 29 | -------------------------------------------------------------------------------- /tests/molecular/periodic_info/test_get_gamma.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def test_get_gamma(periodic_case): 5 | """ 6 | Test :meth:`.PeriodicInfo.get_gamma`. 7 | 8 | Parameters 9 | ---------- 10 | periodic_case : :class:`.CaseData` 11 | The periodic case to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | assert np.isclose( 20 | periodic_case.gamma, 21 | periodic_case.periodic_info.get_gamma(), 22 | atol=1e-6, 23 | ) 24 | -------------------------------------------------------------------------------- /tests/molecular/reactions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/reactions/__init__.py -------------------------------------------------------------------------------- /tests/molecular/reactions/reaction/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/reactions/reaction/__init__.py -------------------------------------------------------------------------------- /tests/molecular/reactions/reaction/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .dative_reaction import * # noqa 2 | from .one_one_reaction import * # noqa 3 | from .one_two_reaction import * # noqa 4 | from .two_two_reaction import * # noqa 5 | -------------------------------------------------------------------------------- /tests/molecular/reactions/reaction_factory/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/reactions/reaction_factory/__init__.py -------------------------------------------------------------------------------- /tests/molecular/reactions/reaction_factory/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .dative_reaction import * # noqa 2 | from .one_one_reaction import * # noqa 3 | from .one_two_reaction import * # noqa 4 | from .two_two_reaction import * # noqa 5 | -------------------------------------------------------------------------------- /tests/molecular/reactions/reaction_factory/fixtures/utilities.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | 4 | class MockGraphState(stk.GraphState): 5 | def __init__(self, edges): 6 | self._edges = edges 7 | 8 | 9 | class MockConstructionState(stk.ConstructionState): 10 | def __init__( 11 | self, 12 | edges, 13 | edge_functional_groups, 14 | position_matrix=None, 15 | ): 16 | self._molecule_state = stk.MoleculeState() 17 | self._molecule_state._position_matrix = position_matrix 18 | self._molecule_state._edge_functional_groups = edge_functional_groups 19 | self._graph_state = MockGraphState(edges) 20 | 21 | 22 | class MockEdge(stk.Edge): 23 | def __init__(self, id, periodicity): 24 | self._id = id 25 | self._periodicity = periodicity 26 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/conftest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/conftest.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/construction_state/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/test_clone.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from .utilities import is_clone 4 | 5 | 6 | @pytest.mark.skip 7 | def test_clone(construction_state): 8 | clone = construction_state.clone() 9 | is_clone(construction_state, clone) 10 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/with_placement_results/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/construction_state/with_placement_results/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/with_placement_results/check_building_blocks.py: -------------------------------------------------------------------------------- 1 | def check_building_blocks(old_state, new_state): 2 | assert old_state.get_num_vertices() == new_state.get_num_vertices() 3 | for vertex_id in range(old_state.get_num_vertices()): 4 | assert old_state.get_building_block( 5 | vertex_id 6 | ) is new_state.get_building_block(vertex_id) 7 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/with_placement_results/check_edges.py: -------------------------------------------------------------------------------- 1 | def check_edges(old_state, new_state): 2 | assert old_state.get_num_edges() == new_state.get_num_edges() 3 | for edge_id in range(old_state.get_num_edges()): 4 | assert old_state.get_edge(edge_id) is new_state.get_edge(edge_id) 5 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/with_placement_results/check_position_matrix.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def check_position_matrix(old_state, new_state, placement_results): 5 | assert np.all( 6 | np.equal( 7 | get_expected_position_matrix(old_state, placement_results), 8 | new_state.get_position_matrix(), 9 | ) 10 | ) 11 | 12 | 13 | def get_expected_position_matrix(old_state, placement_results): 14 | return np.vstack( 15 | [ 16 | old_state.get_position_matrix(), 17 | *(result.position_matrix for result in placement_results), 18 | ] 19 | ) 20 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/with_placement_results/check_vertex_edges.py: -------------------------------------------------------------------------------- 1 | def check_vertex_edges(old_state, new_state): 2 | for vertex_id in range(old_state.get_num_vertices()): 3 | assert old_state.get_edges(vertex_id) == new_state.get_edges(vertex_id) 4 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/construction_state/with_placement_results/check_vertices.py: -------------------------------------------------------------------------------- 1 | def check_vertices(old_state, new_state): 2 | assert old_state.get_num_vertices() == new_state.get_num_vertices() 3 | for vertex_id in range(old_state.get_num_vertices()): 4 | assert old_state.get_vertex(vertex_id) is new_state.get_vertex( 5 | vertex_id 6 | ) 7 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/edge/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_clone.py: -------------------------------------------------------------------------------- 1 | from .utilities import is_clone 2 | 3 | 4 | def test_clone(edge): 5 | """ 6 | Test :meth:`.Edge.clone`. 7 | 8 | Parameters 9 | ---------- 10 | edge : :class:`.Edge` 11 | The edge to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | """ 18 | 19 | clone = edge.clone() 20 | is_clone(edge, clone) 21 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_get_id.py: -------------------------------------------------------------------------------- 1 | def test_get_id(case_data): 2 | """ 3 | Test :meth:`.Edge.get_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the edge to test and the correct id. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.edge.get_id() == case_data.id 17 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_get_periodicity.py: -------------------------------------------------------------------------------- 1 | def test_get_periodicity(case_data): 2 | """ 3 | Test :meth:`.Edge.get_periodicity`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the edge to test and the correct 9 | periodicity. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.edge.get_periodicity() == case_data.periodicity 18 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_get_vertex1_id.py: -------------------------------------------------------------------------------- 1 | def test_get_vertex1_id(case_data): 2 | """ 3 | Test :meth:`.Edge.get_vertex1_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the edge to test and the correct id of the 9 | first vertex. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.edge.get_vertex1_id() == case_data.vertex1_id 18 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_get_vertex2_id.py: -------------------------------------------------------------------------------- 1 | def test_get_vertex2_id(case_data): 2 | """ 3 | Test :meth:`.Edge.get_vertex2_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the edge to test and the correct id of the 9 | second vertex. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.edge.get_vertex2_id() == case_data.vertex2_id 18 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_get_vertex_ids.py: -------------------------------------------------------------------------------- 1 | def test_get_vertex_ids(case_data): 2 | """ 3 | Test :meth:`.Edge.get_vertex_ids`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the edge to test and the correct vertex ids. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | id1, id2 = case_data.edge.get_vertex_ids() 17 | assert id1 == case_data.vertex1_id 18 | assert id2 == case_data.vertex2_id 19 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/test_is_periodic.py: -------------------------------------------------------------------------------- 1 | def test_is_periodic(case_data): 2 | """ 3 | Test :meth:`.Edge.is_periodic`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the edge to test and the truth about its 9 | periodicity. 10 | 11 | Returns 12 | ------- 13 | None : :class:`NoneType` 14 | 15 | """ 16 | 17 | assert case_data.edge.is_periodic() == case_data.is_periodic 18 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/utilities.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def is_clone(edge1, edge2): 5 | assert edge1.get_vertex1_id() == edge2.get_vertex1_id() 6 | assert edge1.get_vertex2_id() == edge2.get_vertex2_id() 7 | assert np.all(np.equal(edge1.get_position(), edge2.get_position())) 8 | assert edge1.get_periodicity() == edge2.get_periodicity() 9 | assert edge1.get_id() == edge2.get_id() 10 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/edge/with_scale/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/edge/with_scale/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/_test_clone.py: -------------------------------------------------------------------------------- 1 | from .utilities import is_clone 2 | 3 | 4 | def test_clone(vertex): 5 | """ 6 | Test :meth:`.Vertex.clone`. 7 | 8 | Parameters 9 | ---------- 10 | vertex : :class:`.Vertex` 11 | The vertex to test. 12 | 13 | Returns 14 | ------- 15 | None : :class:`NoneType` 16 | 17 | 18 | """ 19 | 20 | clone = vertex.clone() 21 | is_clone(vertex, clone) 22 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/_test_get_id.py: -------------------------------------------------------------------------------- 1 | def test_get_id(case_data): 2 | """ 3 | Test :meth:`.Vertex.get_id`. 4 | 5 | Parameters 6 | ---------- 7 | case_data : :class:`.CaseData` 8 | A test case. Holds the vertex to test and the correct id. 9 | 10 | Returns 11 | ------- 12 | None : :class:`NoneType` 13 | 14 | """ 15 | 16 | assert case_data.vertex.get_id() == case_data.id 17 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/cage/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cage/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/cof/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .cof1 import * # noqa 2 | from .cof2 import * # noqa 3 | from .cof3 import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/fixtures/cof1.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from ....case_data import CaseData 5 | 6 | 7 | @pytest.fixture 8 | def cof1(cls, id, position, aligner_edge, cell): 9 | return CaseData( 10 | vertex=cls( 11 | id=id, 12 | position=position, 13 | aligner_edge=aligner_edge, 14 | cell=cell, 15 | ), 16 | id=id, 17 | cell=cell, 18 | position=position, 19 | ) 20 | 21 | 22 | @pytest.fixture( 23 | params=( 24 | stk.cof.LinearVertex, 25 | stk.cof.NonLinearVertex, 26 | stk.cof.UnaligningVertex, 27 | ), 28 | ) 29 | def cls(request): 30 | return request.param 31 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/cof/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/host_guest/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/host_guest/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/macrocycle/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | from ...case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lambda: CaseData( 11 | vertex=stk.macrocycle.CycleVertex( 12 | id=0, 13 | position=(1, 2, 3), 14 | flip=True, 15 | angle=np.pi, 16 | ), 17 | id=0, 18 | position=np.array([1, 2, 3], dtype=np.float64), 19 | cell=np.array([0, 0, 0]), 20 | ), 21 | ), 22 | ) 23 | def case_data(request) -> CaseData: 24 | return request.param() 25 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/macrocycle/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/metal_complex/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/metal_complex/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/polymer/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/polymer/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/rotaxane/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | from ...case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lambda: CaseData( 11 | vertex=stk.rotaxane.AxleVertex(0, (1, 2, 3)), 12 | id=0, 13 | position=np.array([1, 2, 3], dtype=np.float64), 14 | cell=np.array([0, 0, 0]), 15 | ), 16 | lambda: CaseData( 17 | vertex=stk.rotaxane.CycleVertex(0, (3, 4, 5), True), 18 | id=0, 19 | position=np.array([3, 4, 5], dtype=np.float64), 20 | cell=np.array([0, 0, 0]), 21 | ), 22 | ), 23 | ) 24 | def case_data(request) -> CaseData: 25 | return request.param() 26 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/rotaxane/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/cases/small/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/test_clone.py: -------------------------------------------------------------------------------- 1 | from ..._test_clone import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/test_get_cell.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_cell import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/test_get_id.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_id import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/test_get_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_get_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/test_with_position.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_position import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/cases/small/test_with_scale.py: -------------------------------------------------------------------------------- 1 | from ..._test_with_scale import * # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/cage/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cage/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures need to be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("linear"), 11 | lazy_fixture("nonlinear"), 12 | lazy_fixture("unaligning"), 13 | lazy_fixture("angled"), 14 | ), 15 | ) 16 | def case_data(request): 17 | return request.param 18 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cage/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .angled import * # noqa 2 | from .linear import * # noqa 3 | from .nonlinear import * # noqa 4 | from .unaligning import * # noqa 5 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cage/fixtures/unaligning.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | from ....case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lambda: CaseData( 11 | vertex=stk.cage.UnaligningVertex( 12 | id=0, 13 | position=(1, 2, 3), 14 | ), 15 | edges=(), 16 | building_block=stk.BuildingBlock( 17 | smiles="[Fe]", 18 | position_matrix=([0, 0, 0],), 19 | ), 20 | position=np.array([1, 2, 3], dtype=np.float64), 21 | alignment_tests={}, 22 | functional_group_edges={}, 23 | ), 24 | ), 25 | ) 26 | def unaligning(request) -> CaseData: 27 | return request.param() 28 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cage/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cof/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/cof/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cof/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures need to be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("linear"), 11 | lazy_fixture("nonlinear"), 12 | lazy_fixture("unaligning"), 13 | ), 14 | ) 15 | def case_data(request): 16 | return request.param 17 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cof/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .linear import * # noqa 2 | from .nonlinear import * # noqa 3 | from .unaligning import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cof/fixtures/unaligning.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | from ....case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lambda: CaseData( 11 | vertex=stk.cof.UnaligningVertex( 12 | id=0, 13 | position=(1, 2, 3), 14 | ), 15 | edges=(), 16 | building_block=stk.BuildingBlock( 17 | smiles="[Fe]", 18 | position_matrix=([0, 0, 0],), 19 | ), 20 | position=np.array([1, 2, 3], dtype=np.float64), 21 | alignment_tests={}, 22 | functional_group_edges={}, 23 | ), 24 | ), 25 | ) 26 | def unaligning(request) -> CaseData: 27 | return request.param() 28 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/cof/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/host_guest/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/host_guest/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/host_guest/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures need to be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("host"), 11 | lazy_fixture("guest"), 12 | ), 13 | ) 14 | def case_data(request): 15 | """ 16 | A :class:`.CaseData` instance. 17 | 18 | """ 19 | 20 | return request.param 21 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/host_guest/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .guest import * # noqa 2 | from .host import * # noqa 3 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/host_guest/fixtures/host.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | from ....case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lambda: CaseData( 11 | vertex=stk.host_guest.HostVertex( 12 | id=0, 13 | position=(1, 2, 3), 14 | ), 15 | edges=(), 16 | building_block=stk.BuildingBlock("NCCN"), 17 | position=np.array([1, 2, 3], dtype=np.float64), 18 | alignment_tests={}, 19 | functional_group_edges={}, 20 | ), 21 | ), 22 | ) 23 | def host(request) -> CaseData: 24 | return request.param() 25 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/host_guest/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/linear/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/linear/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/linear/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .center import * # noqa 2 | from .head_1 import * # noqa 3 | from .head_2 import * # noqa 4 | from .head_3 import * # noqa 5 | from .tail_1 import * # noqa 6 | from .tail_2 import * # noqa 7 | from .tail_3 import * # noqa 8 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/linear/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/macrocycle/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/macrocycle/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/macrocycle/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .flip import * # noqa 2 | from .no_flip import * # noqa 3 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/macrocycle/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/metal_complex/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/metal_complex/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/metal_complex/conftest.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | from pytest_lazyfixture import lazy_fixture 4 | 5 | # Fixtures need to be visible for lazy_fixture() calls. 6 | from .fixtures import * # noqa 7 | 8 | 9 | @pytest.fixture( 10 | params=( 11 | lazy_fixture("metal"), 12 | lazy_fixture("monodentate"), 13 | lazy_fixture("bidentate"), 14 | ), 15 | ) 16 | def case_data(request): 17 | """ 18 | A :class:`.CaseData` instance. 19 | 20 | """ 21 | 22 | return request.param 23 | 24 | 25 | @pytest.fixture( 26 | params=([1, 2, -20],), 27 | ) 28 | def position(request): 29 | """ 30 | The `position` of a vertex. 31 | 32 | """ 33 | 34 | return np.array(request.param, dtype=np.float64) 35 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/metal_complex/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .bidentate import * # noqa 2 | from .metal import * # noqa 3 | from .monodentate import * # noqa 4 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/metal_complex/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/__init__.py -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from pytest_lazyfixture import lazy_fixture 3 | 4 | # Fixtures must be visible for lazy_fixture() calls. 5 | from .fixtures import * # noqa 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lazy_fixture("axle"), 11 | lazy_fixture("cycle"), 12 | ), 13 | ) 14 | def case_data(request): 15 | return request.param 16 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | from .axle import * # noqa 2 | from .cycle import * # noqa 3 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/fixtures/axle.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pytest 3 | import stk 4 | 5 | from ....case_data import CaseData 6 | 7 | 8 | @pytest.fixture( 9 | params=( 10 | lambda: CaseData( 11 | vertex=stk.rotaxane.AxleVertex(0, (1, 2, 3)), 12 | edges=(), 13 | building_block=stk.BuildingBlock("BrCCBr"), 14 | position=np.array([1, 2, 3], dtype=np.float64), 15 | alignment_tests={}, 16 | functional_group_edges={}, 17 | ), 18 | ), 19 | ) 20 | def axle(request) -> CaseData: 21 | return request.param() 22 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/placement/cases/rotaxane/test_placement.py: -------------------------------------------------------------------------------- 1 | from ..._test_placement import test_placement # noqa 2 | -------------------------------------------------------------------------------- /tests/molecular/topology_graphs/vertex/utilities.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def is_clone(vertex, clone): 5 | assert np.all( 6 | np.equal( 7 | vertex.get_position(), 8 | clone.get_position(), 9 | ) 10 | ) 11 | assert vertex.get_id() == clone.get_id() 12 | assert np.all(np.equal(vertex.get_cell(), clone.get_cell())) 13 | -------------------------------------------------------------------------------- /tests/molecular/writers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/writers/__init__.py -------------------------------------------------------------------------------- /tests/molecular/writers/mdl_mol/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/writers/mdl_mol/__init__.py -------------------------------------------------------------------------------- /tests/molecular/writers/mdl_mol/case_data.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from dataclasses import dataclass 4 | 5 | 6 | @dataclass(slots=True, frozen=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | writer: stk.MolWriter 10 | string: str 11 | -------------------------------------------------------------------------------- /tests/molecular/writers/pdb/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/writers/pdb/__init__.py -------------------------------------------------------------------------------- /tests/molecular/writers/pdb/case_data.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from dataclasses import dataclass 4 | 5 | 6 | @dataclass(slots=True, frozen=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | writer: stk.PdbWriter 10 | string: str 11 | periodic_info: stk.PeriodicInfo | None 12 | -------------------------------------------------------------------------------- /tests/molecular/writers/turbomole/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/writers/turbomole/__init__.py -------------------------------------------------------------------------------- /tests/molecular/writers/turbomole/case_data.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from dataclasses import dataclass 4 | 5 | 6 | @dataclass(slots=True, frozen=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | writer: stk.TurbomoleWriter 10 | string: str 11 | periodic_info: stk.PeriodicInfo | None 12 | -------------------------------------------------------------------------------- /tests/molecular/writers/xyz/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/molecular/writers/xyz/__init__.py -------------------------------------------------------------------------------- /tests/molecular/writers/xyz/case_data.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from dataclasses import dataclass 4 | 5 | 6 | @dataclass(slots=True, frozen=True) 7 | class CaseData: 8 | molecule: stk.Molecule 9 | writer: stk.XyzWriter 10 | string: str 11 | -------------------------------------------------------------------------------- /tests/molecular/writers/xyz/conftest.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import stk 3 | 4 | from .case_data import CaseData 5 | 6 | 7 | @pytest.fixture( 8 | params=( 9 | lambda: CaseData( 10 | molecule=stk.BuildingBlock("BrCCBr", [stk.BromoFactory()]), 11 | writer=stk.XyzWriter(), 12 | string=( 13 | "8\n\nBr -1.423838 1.561473 0.322335\nC -0.740543 -0.2" 14 | "57311 0.127980\nC 0.714791 -0.115704 -0.338259\nBr 1." 15 | "626726 0.889555 1.068701\nH -1.351758 -0.807456 -0.59" 16 | "3854\nH -0.776931 -0.696380 1.144036\nH 0.769475 0.52" 17 | "7986 -1.238698\nH 1.182078 -1.102163 -0.492240\n" 18 | ), 19 | ), 20 | ), 21 | ) 22 | def case_data(request) -> CaseData: 23 | return request.param() 24 | -------------------------------------------------------------------------------- /tests/mongo-config.json: -------------------------------------------------------------------------------- 1 | { "url": "mongodb://localhost:27017" 2 | , "moleculeKey": "SMILES" 3 | , "database": "_stk_pytest_database" 4 | , "moleculeCollection": "molecules" 5 | , "constructedMoleculeCollection": "constructed_molecules" 6 | , "positionMatrixCollection": "position_matrices" 7 | , "buildingBlockPositionMatrixCollection": "building_block_position_matrices" 8 | , "numEntriesPerPage": 34 9 | , "selectBuildingBlocks": true 10 | , "selectConstructedMolecules": true 11 | , "twoDViewer": false 12 | , "threeDViewer": true 13 | } 14 | -------------------------------------------------------------------------------- /tests/serialization/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/serialization/__init__.py -------------------------------------------------------------------------------- /tests/serialization/json/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/serialization/json/__init__.py -------------------------------------------------------------------------------- /tests/serialization/json/from_json/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/serialization/json/from_json/__init__.py -------------------------------------------------------------------------------- /tests/serialization/json/to_json/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lukasturcani/stk/fd2068e3477560d34d286e6db6f7668f84219919/tests/serialization/json/to_json/__init__.py -------------------------------------------------------------------------------- /tests/utilities/__init__.py: -------------------------------------------------------------------------------- 1 | from .molecular import * # noqa 2 | -------------------------------------------------------------------------------- /tests/utilities/molecular/__init__.py: -------------------------------------------------------------------------------- 1 | from .constructed_molecule import * # noqa 2 | from .molecule import * # noqa 3 | from .utilities import * # noqa 4 | -------------------------------------------------------------------------------- /tests/utilities/molecular/utilities.py: -------------------------------------------------------------------------------- 1 | import stk 2 | 3 | from .constructed_molecule import is_equivalent_constructed_molecule 4 | from .molecule import is_equivalent_molecule 5 | 6 | 7 | def is_equivalent(molecule1, molecule2): 8 | is_constructed_molecule1 = isinstance( 9 | molecule1, 10 | stk.ConstructedMolecule, 11 | ) 12 | is_constructed_molecule2 = isinstance( 13 | molecule2, 14 | stk.ConstructedMolecule, 15 | ) 16 | if is_constructed_molecule1 and is_constructed_molecule2: 17 | is_equivalent_constructed_molecule(molecule1, molecule2) 18 | return 19 | 20 | is_equivalent_molecule(molecule1, molecule2) 21 | --------------------------------------------------------------------------------