From c10088597782646174ba79ab22857edfc5f71a3a Mon Sep 17 00:00:00 2001 From: andrewtarzia Date: Fri, 27 Oct 2023 15:25:43 +0200 Subject: [PATCH] Change to init organisation. --- docs/source/calculators.rst | 3 +- docs/source/molecular.rst | 24 +- docs/source/optimizers.rst | 6 +- pyproject.toml | 3 + src/stko/__init__.py | 239 +++++++++++++++++- src/stko/calculators/__init__.py | 9 - src/stko/calculators/extractors/__init__.py | 3 - .../calculators/extractors/orca_extractor.py | 2 +- .../calculators/extractors/xtb_extractor.py | 2 +- .../calculators/open_babel_calculators.py | 6 +- src/stko/calculators/orca_calculators.py | 4 +- .../planarity_calculators/__init__.py | 1 - .../planarity_calculators.py | 4 +- src/stko/calculators/rdkit_calculators.py | 4 +- src/stko/calculators/results/__init__.py | 8 - .../calculators/results/energy_results.py | 2 +- src/stko/calculators/results/orca_results.py | 4 +- .../calculators/results/planarity_results.py | 2 +- src/stko/calculators/results/rmsd_results.py | 2 +- src/stko/calculators/results/shape_results.py | 2 +- .../calculators/results/torsion_results.py | 7 +- src/stko/calculators/results/xtb_results.py | 4 +- src/stko/calculators/rmsd_calculators.py | 6 +- src/stko/calculators/shape_calculators.py | 4 +- src/stko/calculators/torsion_calculators.py | 11 +- src/stko/calculators/xtb_calculators.py | 9 +- src/stko/molecular/__init__.py | 7 - src/stko/molecular/atoms/__init__.py | 2 - src/stko/molecular/conversion/__init__.py | 2 - src/stko/molecular/conversion/md_analysis.py | 2 +- src/stko/molecular/conversion/z_matrix.py | 2 +- .../molecular/molecule_modifiers/__init__.py | 2 - .../molecule_modifiers/molecule_splitter.py | 2 +- .../molecule_transformer.py | 2 +- src/stko/molecular/networkx/__init__.py | 1 - src/stko/molecular/networkx/network.py | 2 +- src/stko/molecular/periodic/__init__.py | 2 - src/stko/molecular/periodic/unitcell.py | 2 +- .../molecular/topology_extractor/__init__.py | 2 - .../topology_extractor/topology_extractor.py | 4 +- src/stko/molecular/torsion/__init__.py | 2 - src/stko/optimizers/__init__.py | 8 - src/stko/optimizers/aligner.py | 4 +- src/stko/optimizers/collapser.py | 4 +- src/stko/optimizers/gulp.py | 4 +- src/stko/optimizers/macromodel.py | 4 +- src/stko/optimizers/open_babel.py | 4 +- src/stko/optimizers/rdkit.py | 4 +- src/stko/optimizers/xtb.py | 9 +- src/stko/py.typed | 0 src/stko/utilities/__init__.py | 1 - 51 files changed, 321 insertions(+), 128 deletions(-) create mode 100644 src/stko/py.typed diff --git a/docs/source/calculators.rst b/docs/source/calculators.rst index 874e322a..99f51631 100644 --- a/docs/source/calculators.rst +++ b/docs/source/calculators.rst @@ -4,8 +4,7 @@ Calculators .. toctree:: :maxdepth: 1 - Calculator <_autosummary/stko.calculators.Calculator> - + Calculator <_autosummary/stko.Calculator> MMFFEnergy <_autosummary/stko.MMFFEnergy> UFFEnergy <_autosummary/stko.UFFEnergy> OpenBabelEnergy <_autosummary/stko.OpenBabelEnergy> diff --git a/docs/source/molecular.rst b/docs/source/molecular.rst index 9bc5f934..e17ac55d 100644 --- a/docs/source/molecular.rst +++ b/docs/source/molecular.rst @@ -4,15 +4,15 @@ Molecular .. toctree:: :maxdepth: 1 - PositionedAtom <_autosummary/stko.molecular.atoms.PositionedAtom> - dummy atom (Du) <_autosummary/stko.molecular.atoms.Du> - MDAnalysis <_autosummary/stko.molecular.conversion.MDAnalysis> - ZMatrix <_autosummary/stko.molecular.conversion.ZMatrix> - MoleculeSplitter <_autosummary/stko.molecular.molecule_modifiers.MoleculeSplitter> - MoleculeTransformer <_autosummary/stko.molecular.molecule_modifiers.MoleculeTransformer> - Network <_autosummary/stko.molecular.networkx.Network> - UnitCell <_autosummary/stko.molecular.periodic.UnitCell> - TopologyExtractor <_autosummary/stko.molecular.topology_extractor.TopologyExtractor> - TopologyInfo <_autosummary/stko.molecular.topology_extractor.TopologyInfo> - Torsion <_autosummary/stko.molecular.torsion.Torsion> - TorsionInfo <_autosummary/stko.molecular.TorsionInfo> + PositionedAtom <_autosummary/stko.PositionedAtom> + dummy atom (Du) <_autosummary/stko.Du> + MDAnalysis <_autosummary/stko.MDAnalysis> + ZMatrix <_autosummary/stko.ZMatrix> + MoleculeSplitter <_autosummary/stko.MoleculeSplitter> + MoleculeTransformer <_autosummary/stko.MoleculeTransformer> + Network <_autosummary/stko.Network> + UnitCell <_autosummary/stko.UnitCell> + TopologyExtractor <_autosummary/stko.TopologyExtractor> + TopologyInfo <_autosummary/stko.TopologyInfo> + Torsion <_autosummary/stko.Torsion> + TorsionInfo <_autosummary/stko.TorsionInfo> diff --git a/docs/source/optimizers.rst b/docs/source/optimizers.rst index 82859875..c153809c 100644 --- a/docs/source/optimizers.rst +++ b/docs/source/optimizers.rst @@ -4,9 +4,9 @@ Optimizers .. toctree:: :maxdepth: 1 - Optimizer <_autosummary/stko.optimizers.Optimizer> - OptimizerSequence <_autosummary/stko.optimizers.OptimizerSequence> - TryCatchOptimizer <_autosummary/stko.optimizers.TryCatchOptimizer> + Optimizer <_autosummary/stko.Optimizer> + OptimizerSequence <_autosummary/stko.OptimizerSequence> + TryCatchOptimizer <_autosummary/stko.TryCatchOptimizer> Aligner <_autosummary/stko.Aligner> Collapser <_autosummary/stko.Collapser> diff --git a/pyproject.toml b/pyproject.toml index abd084a0..db9f684b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,5 +89,8 @@ module = [ "vabene.*", "setuptools.*", "stk.*", + "networkx.*", + "openbabel.*", + "MDAnalysis.*", ] ignore_missing_imports = true \ No newline at end of file diff --git a/src/stko/__init__.py b/src/stko/__init__.py index 466ee0c7..a4679330 100644 --- a/src/stko/__init__.py +++ b/src/stko/__init__.py @@ -1,4 +1,235 @@ -from .utilities import * # noqa -from .optimizers import * # noqa -from .calculators import * # noqa -from .molecular import * # noqa +from stko.calculators.calculators import Calculator +from stko.calculators.extractors.extractor import Extractor +from stko.calculators.extractors.orca_extractor import OrcaExtractor +from stko.calculators.extractors.xtb_extractor import XTBExtractor +from stko.calculators.open_babel_calculators import ( + ForceFieldSetupError, + OpenBabelEnergy, + OpenBabelError, +) +from stko.calculators.orca_calculators import OrcaEnergy, OrcaOptimizerError +from stko.calculators.planarity_calculators.planarity_calculators import ( + PlanarityCalculator, +) +from stko.calculators.rdkit_calculators import MMFFEnergy, UFFEnergy +from stko.calculators.results.energy_results import EnergyResults +from stko.calculators.results.orca_results import OrcaResults +from stko.calculators.results.planarity_results import PlanarityResults +from stko.calculators.results.results import Results +from stko.calculators.results.rmsd_results import RmsdResults +from stko.calculators.results.shape_results import ShapeResults +from stko.calculators.results.torsion_results import ( + ConstructedMoleculeTorsionResults, + TorsionResults, +) +from stko.calculators.results.xtb_results import XTBResults +from stko.calculators.rmsd_calculators import ( + DifferentAtomException, + DifferentMoleculeException, + RmsdCalculator, + RmsdCalculatorError, + RmsdMappedCalculator, +) +from stko.calculators.shape_calculators import ShapeCalculator +from stko.calculators.torsion_calculators import ( + ConstructedMoleculeTorsionCalculator, + MatchedTorsionCalculator, + TorsionCalculator, +) +from stko.calculators.xtb_calculators import XTBEnergy +from stko.molecular.atoms.dummy_atom import Du +from stko.molecular.atoms.positioned_atom import PositionedAtom +from stko.molecular.conversion.md_analysis import MDAnalysis +from stko.molecular.conversion.z_matrix import ConversionError, ZMatrix +from stko.molecular.molecule_modifiers.molecule_splitter import ( + MoleculeSplitter, +) +from stko.molecular.molecule_modifiers.molecule_transformer import ( + MoleculeTransformer, +) +from stko.molecular.networkx.network import Network +from stko.molecular.periodic.unitcell import UnitCell +from stko.molecular.periodic.utilities import ( + cap_absolute_value, + get_approximate_cell_size, + get_from_parameters, +) +from stko.molecular.topology_extractor.topology_extractor import ( + TopologyExtractor, +) +from stko.molecular.topology_extractor.topology_info import TopologyInfo +from stko.molecular.torsion.torsion import Torsion +from stko.molecular.torsion.torsion_info import TorsionInfo +from stko.optimizers.aligner import ( + Aligner, + AlignmentPotential, +) +from stko.optimizers.collapser import ( + Collapser, + CollapserMC, +) +from stko.optimizers.gulp import ( + ExpectedMetal, + GulpUFFMDOptimizer, + GulpUFFOptimizer, + UFFTyperError, +) +from stko.optimizers.macromodel import ( + MacroModel, + MacroModelConversionError, + MacroModelForceField, + MacroModelForceFieldError, + MacroModelInputError, + MacroModelLewisStructureError, + MacroModelMD, + MacroModelOptimizationError, + MacroModelPathError, +) +from stko.optimizers.open_babel import OpenBabel +from stko.optimizers.optimizers import ( + Optimizer, + OptimizerSequence, + TryCatchOptimizer, +) +from stko.optimizers.rdkit import ETKDG, MMFF, UFF, MetalOptimizer +from stko.optimizers.xtb import ( + XTB, + XTBCREST, + XTBFF, + XTBFFCREST, + CRESTNotCompletedError, + CRESTNotStartedError, + CRESTOptimizerError, + CRESTSettingConflictError, + XTBConvergenceError, + XTBOptimizerError, +) +from stko.utilities.utilities import ( + MAEExtractor, + WrapperNotInstalledException, + XTBInvalidSolventError, + calculate_angle, + calculate_dihedral, + get_atom_distance, + get_atom_maps, + get_long_bond_ids, + get_metal_atoms, + get_metal_bonds, + get_plane_normal, + get_torsion_info_angles, + has_h_atom, + has_metal_atom, + is_inequivalent_atom, + is_valid_xtb_solvent, + metal_atomic_numbers, + mol_from_mae_file, + move_generated_macromodel_files, + to_rdkit_mol_without_metals, + vector_angle, +) + +__all__ = [ + "WrapperNotInstalledException", + "MAEExtractor", + "mol_from_mae_file", + "move_generated_macromodel_files", + "XTBInvalidSolventError", + "is_valid_xtb_solvent", + "is_inequivalent_atom", + "get_plane_normal", + "has_h_atom", + "has_metal_atom", + "metal_atomic_numbers", + "get_metal_atoms", + "get_metal_bonds", + "to_rdkit_mol_without_metals", + "get_atom_distance", + "get_long_bond_ids", + "calculate_dihedral", + "vector_angle", + "calculate_angle", + "get_torsion_info_angles", + "get_atom_maps", + "Aligner", + "AlignmentPotential", + "Collapser", + "CollapserMC", + "ExpectedMetal", + "UFFTyperError", + "GulpUFFMDOptimizer", + "GulpUFFOptimizer", + "MacroModel", + "MacroModelConversionError", + "MacroModelForceField", + "MacroModelForceFieldError", + "MacroModelInputError", + "MacroModelLewisStructureError", + "MacroModelMD", + "MacroModelOptimizationError", + "MacroModelPathError", + "OpenBabel", + "Optimizer", + "OptimizerSequence", + "TryCatchOptimizer", + "MMFF", + "UFF", + "ETKDG", + "MetalOptimizer", + "XTB", + "XTBConvergenceError", + "CRESTNotCompletedError", + "CRESTNotStartedError", + "CRESTOptimizerError", + "CRESTSettingConflictError", + "XTBCREST", + "XTBFF", + "XTBFFCREST", + "XTBOptimizerError", + "PositionedAtom", + "Du", + "MDAnalysis", + "ZMatrix", + "ConversionError", + "MoleculeSplitter", + "MoleculeTransformer", + "Network", + "UnitCell", + "cap_absolute_value", + "get_approximate_cell_size", + "get_from_parameters", + "TopologyExtractor", + "TopologyInfo", + "Torsion", + "TorsionInfo", + "XTBEnergy", + "Calculator", + "TorsionCalculator", + "ConstructedMoleculeTorsionCalculator", + "MatchedTorsionCalculator", + "ShapeCalculator", + "RmsdCalculator", + "RmsdMappedCalculator", + "RmsdCalculatorError", + "DifferentAtomException", + "DifferentMoleculeException", + "MMFFEnergy", + "UFFEnergy", + "OrcaOptimizerError", + "OrcaEnergy", + "OpenBabelEnergy", + "OpenBabelError", + "ForceFieldSetupError", + "PlanarityCalculator", + "XTBResults", + "TorsionResults", + "ConstructedMoleculeTorsionResults", + "ShapeResults", + "RmsdResults", + "Results", + "PlanarityResults", + "OrcaResults", + "EnergyResults", + "XTBExtractor", + "OrcaExtractor", + "Extractor", +] diff --git a/src/stko/calculators/__init__.py b/src/stko/calculators/__init__.py index 4ca82966..e69de29b 100644 --- a/src/stko/calculators/__init__.py +++ b/src/stko/calculators/__init__.py @@ -1,9 +0,0 @@ -from .calculators import * # noqa -from .xtb_calculators import * # noqa -from .rdkit_calculators import * # noqa -from .torsion_calculators import * # noqa -from .shape_calculators import * # noqa -from .orca_calculators import * # noqa -from .open_babel_calculators import * # noqa -from .rmsd_calculators import * # noqa -from .planarity_calculators import * # noqa diff --git a/src/stko/calculators/extractors/__init__.py b/src/stko/calculators/extractors/__init__.py index 9b558cc3..e69de29b 100644 --- a/src/stko/calculators/extractors/__init__.py +++ b/src/stko/calculators/extractors/__init__.py @@ -1,3 +0,0 @@ -from .extractor import * # noqa -from .xtb_extractor import * # noqa -from .orca_extractor import * # noqa diff --git a/src/stko/calculators/extractors/orca_extractor.py b/src/stko/calculators/extractors/orca_extractor.py index 964de856..8051f725 100644 --- a/src/stko/calculators/extractors/orca_extractor.py +++ b/src/stko/calculators/extractors/orca_extractor.py @@ -10,7 +10,7 @@ import re -from .extractor import Extractor +from stko.calculators.extractors.extractor import Extractor class OrcaExtractor(Extractor): diff --git a/src/stko/calculators/extractors/xtb_extractor.py b/src/stko/calculators/extractors/xtb_extractor.py index 0fb96470..c69e90a8 100644 --- a/src/stko/calculators/extractors/xtb_extractor.py +++ b/src/stko/calculators/extractors/xtb_extractor.py @@ -10,7 +10,7 @@ import re -from .extractor import Extractor +from stko.calculators.extractors.extractor import Extractor class XTBExtractor(Extractor): diff --git a/src/stko/calculators/open_babel_calculators.py b/src/stko/calculators/open_babel_calculators.py index 17587a5d..e7aabe42 100644 --- a/src/stko/calculators/open_babel_calculators.py +++ b/src/stko/calculators/open_babel_calculators.py @@ -16,9 +16,9 @@ except ImportError: openbabel = None -from ..utilities import WrapperNotInstalledException -from .calculators import Calculator -from .results import EnergyResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.energy_results import EnergyResults +from stko.utilities.utilities import WrapperNotInstalledException logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/orca_calculators.py b/src/stko/calculators/orca_calculators.py index cd5cbfed..850ecee9 100644 --- a/src/stko/calculators/orca_calculators.py +++ b/src/stko/calculators/orca_calculators.py @@ -15,8 +15,8 @@ import subprocess as sp import uuid -from .calculators import Calculator -from .results import OrcaResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.orca_results import OrcaResults logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/planarity_calculators/__init__.py b/src/stko/calculators/planarity_calculators/__init__.py index caa4108c..e69de29b 100644 --- a/src/stko/calculators/planarity_calculators/__init__.py +++ b/src/stko/calculators/planarity_calculators/__init__.py @@ -1 +0,0 @@ -from .planarity_calculators import * # noqa diff --git a/src/stko/calculators/planarity_calculators/planarity_calculators.py b/src/stko/calculators/planarity_calculators/planarity_calculators.py index 2cd8eb04..9abb3ec2 100644 --- a/src/stko/calculators/planarity_calculators/planarity_calculators.py +++ b/src/stko/calculators/planarity_calculators/planarity_calculators.py @@ -12,8 +12,8 @@ import numpy as np -from ..calculators import Calculator -from ..results import PlanarityResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.planarity_results import PlanarityResults logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/rdkit_calculators.py b/src/stko/calculators/rdkit_calculators.py index fe8b2568..fe748970 100644 --- a/src/stko/calculators/rdkit_calculators.py +++ b/src/stko/calculators/rdkit_calculators.py @@ -13,8 +13,8 @@ from rdkit.Chem import AllChem as rdkit -from .calculators import Calculator -from .results import EnergyResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.energy_results import EnergyResults logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/results/__init__.py b/src/stko/calculators/results/__init__.py index 515794e6..e69de29b 100644 --- a/src/stko/calculators/results/__init__.py +++ b/src/stko/calculators/results/__init__.py @@ -1,8 +0,0 @@ -from .energy_results import * # noqa -from .orca_results import * # noqa -from .rmsd_results import * # noqa -from .planarity_results import * # noqa -from .results import * # noqa -from .shape_results import * # noqa -from .torsion_results import * # noqa -from .xtb_results import * # noqa diff --git a/src/stko/calculators/results/energy_results.py b/src/stko/calculators/results/energy_results.py index 9a5cc715..d551b3ce 100644 --- a/src/stko/calculators/results/energy_results.py +++ b/src/stko/calculators/results/energy_results.py @@ -8,7 +8,7 @@ """ -from .results import Results +from stko.calculators.results.results import Results class EnergyResults(Results): diff --git a/src/stko/calculators/results/orca_results.py b/src/stko/calculators/results/orca_results.py index b479cdc8..a74f3796 100644 --- a/src/stko/calculators/results/orca_results.py +++ b/src/stko/calculators/results/orca_results.py @@ -8,8 +8,8 @@ """ -from ..extractors import OrcaExtractor -from .results import Results +from stko.calculators.extractors.orca_extractor import OrcaExtractor +from stko.calculators.results.results import Results class OrcaResults(Results): diff --git a/src/stko/calculators/results/planarity_results.py b/src/stko/calculators/results/planarity_results.py index 3c4a30f7..c6f358a8 100644 --- a/src/stko/calculators/results/planarity_results.py +++ b/src/stko/calculators/results/planarity_results.py @@ -8,7 +8,7 @@ """ -from .results import Results +from stko.calculators.results.results import Results class PlanarityResults(Results): diff --git a/src/stko/calculators/results/rmsd_results.py b/src/stko/calculators/results/rmsd_results.py index f1048fae..377e84a8 100644 --- a/src/stko/calculators/results/rmsd_results.py +++ b/src/stko/calculators/results/rmsd_results.py @@ -8,7 +8,7 @@ """ -from .results import Results +from stko.calculators.results.results import Results class RmsdResults(Results): diff --git a/src/stko/calculators/results/shape_results.py b/src/stko/calculators/results/shape_results.py index 13f0e417..28a6400d 100644 --- a/src/stko/calculators/results/shape_results.py +++ b/src/stko/calculators/results/shape_results.py @@ -8,7 +8,7 @@ """ -from .results import Results +from stko.calculators.results.results import Results class ShapeResults(Results): diff --git a/src/stko/calculators/results/torsion_results.py b/src/stko/calculators/results/torsion_results.py index 53cd027f..51a20923 100644 --- a/src/stko/calculators/results/torsion_results.py +++ b/src/stko/calculators/results/torsion_results.py @@ -11,9 +11,10 @@ from collections import defaultdict -from ...molecular.torsion import Torsion, TorsionInfo -from ...utilities import calculate_dihedral -from .results import Results +from stko.calculators.results.results import Results +from stko.molecular.torsion.torsion import Torsion +from stko.molecular.torsion.torsion_info import TorsionInfo +from stko.utilities.utilities import calculate_dihedral class TorsionResults(Results): diff --git a/src/stko/calculators/results/xtb_results.py b/src/stko/calculators/results/xtb_results.py index 15853793..dc12ce22 100644 --- a/src/stko/calculators/results/xtb_results.py +++ b/src/stko/calculators/results/xtb_results.py @@ -8,8 +8,8 @@ """ -from ..extractors import XTBExtractor -from .results import Results +from stko.calculators.extractors.xtb_extractor import XTBExtractor +from stko.calculators.results.results import Results class XTBResults(Results): diff --git a/src/stko/calculators/rmsd_calculators.py b/src/stko/calculators/rmsd_calculators.py index d9960d0a..111bde06 100644 --- a/src/stko/calculators/rmsd_calculators.py +++ b/src/stko/calculators/rmsd_calculators.py @@ -15,9 +15,9 @@ import stk from scipy.spatial.distance import cdist -from ..utilities import is_inequivalent_atom -from .calculators import Calculator -from .results import RmsdResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.rmsd_results import RmsdResults +from stko.utilities.utilities import is_inequivalent_atom logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/shape_calculators.py b/src/stko/calculators/shape_calculators.py index af5de2a6..84090c44 100644 --- a/src/stko/calculators/shape_calculators.py +++ b/src/stko/calculators/shape_calculators.py @@ -12,8 +12,8 @@ from rdkit.Chem import Descriptors3D as D3D -from .calculators import Calculator -from .results import ShapeResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.shape_results import ShapeResults logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/torsion_calculators.py b/src/stko/calculators/torsion_calculators.py index f369a2ce..bc1d70e1 100644 --- a/src/stko/calculators/torsion_calculators.py +++ b/src/stko/calculators/torsion_calculators.py @@ -13,10 +13,13 @@ from rdkit.Chem import TorsionFingerprints -from ..molecular.torsion import Torsion -from ..utilities.utilities import get_atom_maps -from .calculators import Calculator -from .results import ConstructedMoleculeTorsionResults, TorsionResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.torsion_results import ( + ConstructedMoleculeTorsionResults, + TorsionResults, +) +from stko.molecular.torsion.torsion import Torsion +from stko.utilities.utilities import get_atom_maps logger = logging.getLogger(__name__) diff --git a/src/stko/calculators/xtb_calculators.py b/src/stko/calculators/xtb_calculators.py index fe70fba4..b34bcbfe 100644 --- a/src/stko/calculators/xtb_calculators.py +++ b/src/stko/calculators/xtb_calculators.py @@ -14,9 +14,12 @@ import subprocess as sp import uuid -from ..utilities import XTBInvalidSolventError, is_valid_xtb_solvent -from .calculators import Calculator -from .results import XTBResults +from stko.calculators.calculators import Calculator +from stko.calculators.results.xtb_results import XTBResults +from stko.utilities.utilities import ( + XTBInvalidSolventError, + is_valid_xtb_solvent, +) logger = logging.getLogger(__name__) diff --git a/src/stko/molecular/__init__.py b/src/stko/molecular/__init__.py index b198efbd..e69de29b 100644 --- a/src/stko/molecular/__init__.py +++ b/src/stko/molecular/__init__.py @@ -1,7 +0,0 @@ -from .atoms import * # noqa -from .conversion import * # noqa -from .molecule_modifiers import * # noqa -from .networkx import * # noqa -from .periodic import * # noqa -from .topology_extractor import * # noqa -from .torsion import * # noqa diff --git a/src/stko/molecular/atoms/__init__.py b/src/stko/molecular/atoms/__init__.py index 96a9d5f0..e69de29b 100644 --- a/src/stko/molecular/atoms/__init__.py +++ b/src/stko/molecular/atoms/__init__.py @@ -1,2 +0,0 @@ -from .dummy_atom import * # noqa -from .positioned_atom import * # noqa diff --git a/src/stko/molecular/conversion/__init__.py b/src/stko/molecular/conversion/__init__.py index 46653346..e69de29b 100644 --- a/src/stko/molecular/conversion/__init__.py +++ b/src/stko/molecular/conversion/__init__.py @@ -1,2 +0,0 @@ -from .z_matrix import * # noqa -from .md_analysis import * # noqa diff --git a/src/stko/molecular/conversion/md_analysis.py b/src/stko/molecular/conversion/md_analysis.py index 9c4eee15..a6718576 100644 --- a/src/stko/molecular/conversion/md_analysis.py +++ b/src/stko/molecular/conversion/md_analysis.py @@ -10,7 +10,7 @@ import logging -from ...utilities import WrapperNotInstalledException +from stko.utilities.utilities import WrapperNotInstalledException try: import MDAnalysis as mda diff --git a/src/stko/molecular/conversion/z_matrix.py b/src/stko/molecular/conversion/z_matrix.py index e9d74a9d..cae28649 100644 --- a/src/stko/molecular/conversion/z_matrix.py +++ b/src/stko/molecular/conversion/z_matrix.py @@ -10,7 +10,7 @@ import logging -from ...utilities.utilities import ( +from stko.utilities.utilities import ( calculate_angle, calculate_dihedral, get_atom_distance, diff --git a/src/stko/molecular/molecule_modifiers/__init__.py b/src/stko/molecular/molecule_modifiers/__init__.py index 07efdfbf..e69de29b 100644 --- a/src/stko/molecular/molecule_modifiers/__init__.py +++ b/src/stko/molecular/molecule_modifiers/__init__.py @@ -1,2 +0,0 @@ -from .molecule_splitter import * # noqa -from .molecule_transformer import * # noqa diff --git a/src/stko/molecular/molecule_modifiers/molecule_splitter.py b/src/stko/molecular/molecule_modifiers/molecule_splitter.py index a1915925..eee20b56 100644 --- a/src/stko/molecular/molecule_modifiers/molecule_splitter.py +++ b/src/stko/molecular/molecule_modifiers/molecule_splitter.py @@ -14,7 +14,7 @@ import stk from rdkit.Chem import AllChem as rdkit -from ..atoms import Du +from stko.molecular.atoms.dummy_atom import Du logger = logging.getLogger(__name__) diff --git a/src/stko/molecular/molecule_modifiers/molecule_transformer.py b/src/stko/molecular/molecule_modifiers/molecule_transformer.py index 806c1c27..28f4f7ec 100644 --- a/src/stko/molecular/molecule_modifiers/molecule_transformer.py +++ b/src/stko/molecular/molecule_modifiers/molecule_transformer.py @@ -13,7 +13,7 @@ import stk from rdkit.Chem import AllChem as rdkit -from ..atoms import Du +from stko.molecular.atoms.dummy_atom import Du logger = logging.getLogger(__name__) diff --git a/src/stko/molecular/networkx/__init__.py b/src/stko/molecular/networkx/__init__.py index 27780268..e69de29b 100644 --- a/src/stko/molecular/networkx/__init__.py +++ b/src/stko/molecular/networkx/__init__.py @@ -1 +0,0 @@ -from .network import * # noqa diff --git a/src/stko/molecular/networkx/network.py b/src/stko/molecular/networkx/network.py index 485959ff..f192f75b 100644 --- a/src/stko/molecular/networkx/network.py +++ b/src/stko/molecular/networkx/network.py @@ -12,7 +12,7 @@ import networkx as nx -from ..atoms import PositionedAtom +from stko.molecular.atoms.positioned_atom import PositionedAtom logger = logging.getLogger(__name__) diff --git a/src/stko/molecular/periodic/__init__.py b/src/stko/molecular/periodic/__init__.py index b5accac5..e69de29b 100644 --- a/src/stko/molecular/periodic/__init__.py +++ b/src/stko/molecular/periodic/__init__.py @@ -1,2 +0,0 @@ -from .unitcell import * # noqa -from .utilities import * # noqa diff --git a/src/stko/molecular/periodic/unitcell.py b/src/stko/molecular/periodic/unitcell.py index 527b7b78..493fcae2 100644 --- a/src/stko/molecular/periodic/unitcell.py +++ b/src/stko/molecular/periodic/unitcell.py @@ -11,7 +11,7 @@ import numpy as np from stk import PeriodicInfo -from .utilities import get_from_parameters +from stko.molecular.periodic.utilities import get_from_parameters logger = logging.getLogger(__name__) diff --git a/src/stko/molecular/topology_extractor/__init__.py b/src/stko/molecular/topology_extractor/__init__.py index ebc12431..e69de29b 100644 --- a/src/stko/molecular/topology_extractor/__init__.py +++ b/src/stko/molecular/topology_extractor/__init__.py @@ -1,2 +0,0 @@ -from .topology_extractor import * # noqa -from .topology_info import * # noqa diff --git a/src/stko/molecular/topology_extractor/topology_extractor.py b/src/stko/molecular/topology_extractor/topology_extractor.py index ff471a58..f69dbd9a 100644 --- a/src/stko/molecular/topology_extractor/topology_extractor.py +++ b/src/stko/molecular/topology_extractor/topology_extractor.py @@ -10,8 +10,8 @@ import logging -from ..networkx import Network -from .topology_info import TopologyInfo +from stko.molecular.networkx.network import Network +from stko.molecular.topology_extractor.topology_info import TopologyInfo logger = logging.getLogger(__name__) diff --git a/src/stko/molecular/torsion/__init__.py b/src/stko/molecular/torsion/__init__.py index f329e570..e69de29b 100644 --- a/src/stko/molecular/torsion/__init__.py +++ b/src/stko/molecular/torsion/__init__.py @@ -1,2 +0,0 @@ -from .torsion import * # noqa -from .torsion_info import * # noqa diff --git a/src/stko/optimizers/__init__.py b/src/stko/optimizers/__init__.py index c704cdef..e69de29b 100644 --- a/src/stko/optimizers/__init__.py +++ b/src/stko/optimizers/__init__.py @@ -1,8 +0,0 @@ -from .aligner import * # noqa -from .optimizers import * # noqa -from .rdkit import * # noqa -from .gulp import * # noqa -from .collapser import * # noqa -from .xtb import * # noqa -from .macromodel import * # noqa -from .open_babel import * # noqa diff --git a/src/stko/optimizers/aligner.py b/src/stko/optimizers/aligner.py index 9891cb77..2958a7ac 100644 --- a/src/stko/optimizers/aligner.py +++ b/src/stko/optimizers/aligner.py @@ -15,8 +15,8 @@ import spindry as spd from scipy.spatial.distance import cdist -from ..calculators import RmsdMappedCalculator -from .optimizers import Optimizer +from stko.calculators.rmsd_calculators import RmsdMappedCalculator +from stko.optimizers.optimizers import Optimizer logger = logging.getLogger(__name__) diff --git a/src/stko/optimizers/collapser.py b/src/stko/optimizers/collapser.py index ba2cb11b..2cc94ca5 100644 --- a/src/stko/optimizers/collapser.py +++ b/src/stko/optimizers/collapser.py @@ -22,8 +22,8 @@ from scipy.spatial.distance import pdist from stk import PdbWriter -from ..utilities import get_atom_distance -from .optimizers import Optimizer +from stko.optimizers.optimizers import Optimizer +from stko.utilities.utilities import get_atom_distance logger = logging.getLogger(__name__) diff --git a/src/stko/optimizers/gulp.py b/src/stko/optimizers/gulp.py index 31ce40d5..0b1ec5dc 100644 --- a/src/stko/optimizers/gulp.py +++ b/src/stko/optimizers/gulp.py @@ -113,14 +113,14 @@ from rdkit.Chem import AllChem as rdkit -from ..utilities import ( +from stko.optimizers.optimizers import Optimizer +from stko.utilities.utilities import ( get_metal_atoms, get_metal_bonds, has_h_atom, has_metal_atom, to_rdkit_mol_without_metals, ) -from .optimizers import Optimizer logger = logging.getLogger(__name__) diff --git a/src/stko/optimizers/macromodel.py b/src/stko/optimizers/macromodel.py index 32b23ef4..2fccd49d 100644 --- a/src/stko/optimizers/macromodel.py +++ b/src/stko/optimizers/macromodel.py @@ -16,12 +16,12 @@ import rdkit.Chem.AllChem as rdkit -from ..utilities import ( +from stko.optimizers.optimizers import Optimizer +from stko.utilities.utilities import ( MAEExtractor, mol_from_mae_file, move_generated_macromodel_files, ) -from .optimizers import Optimizer logger = logging.getLogger(__name__) diff --git a/src/stko/optimizers/open_babel.py b/src/stko/optimizers/open_babel.py index 37102990..4aa1ed28 100644 --- a/src/stko/optimizers/open_babel.py +++ b/src/stko/optimizers/open_babel.py @@ -18,8 +18,8 @@ except ImportError: openbabel = None -from ..utilities import WrapperNotInstalledException -from .optimizers import Optimizer +from stko.optimizers.optimizers import Optimizer +from stko.utilities.utilities import WrapperNotInstalledException logger = logging.getLogger(__name__) diff --git a/src/stko/optimizers/rdkit.py b/src/stko/optimizers/rdkit.py index 5f7de244..93ca0247 100644 --- a/src/stko/optimizers/rdkit.py +++ b/src/stko/optimizers/rdkit.py @@ -35,13 +35,13 @@ import numpy as np import rdkit.Chem.AllChem as rdkit -from ..utilities import ( +from stko.optimizers.optimizers import Optimizer +from stko.utilities.utilities import ( get_metal_atoms, get_metal_bonds, to_rdkit_mol_without_metals, vector_angle, ) -from .optimizers import Optimizer logger = logging.getLogger(__name__) diff --git a/src/stko/optimizers/xtb.py b/src/stko/optimizers/xtb.py index f7cd19b1..5d7075bc 100644 --- a/src/stko/optimizers/xtb.py +++ b/src/stko/optimizers/xtb.py @@ -17,9 +17,12 @@ import subprocess as sp import uuid -from ..calculators.extractors import XTBExtractor -from ..utilities import XTBInvalidSolventError, is_valid_xtb_solvent -from .optimizers import Optimizer +from stko.calculators.extractors.xtb_extractor import XTBExtractor +from stko.optimizers.optimizers import Optimizer +from stko.utilities.utilities import ( + XTBInvalidSolventError, + is_valid_xtb_solvent, +) logger = logging.getLogger(__name__) diff --git a/src/stko/py.typed b/src/stko/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/src/stko/utilities/__init__.py b/src/stko/utilities/__init__.py index b7820125..e69de29b 100644 --- a/src/stko/utilities/__init__.py +++ b/src/stko/utilities/__init__.py @@ -1 +0,0 @@ -from .utilities import * # noqa