diff --git a/structuretoolkit/__init__.py b/structuretoolkit/__init__.py index 666658d3d..3a79c0486 100644 --- a/structuretoolkit/__init__.py +++ b/structuretoolkit/__init__.py @@ -1,70 +1,76 @@ # Analyse from structuretoolkit.analyse import ( - get_distances_array, find_mic, - get_neighbors, - get_neighborhood, - get_equivalent_atoms, - get_steinhardt_parameters, - get_centro_symmetry_descriptors, - get_diamond_structure_descriptors, - get_adaptive_cna_descriptors, - get_voronoi_volumes, find_solids, - get_mean_positions, + get_adaptive_cna_descriptors, get_average_of_unique_labels, + get_centro_symmetry_descriptors, + get_cluster_positions, + get_delaunay_neighbors, + get_diamond_structure_descriptors, + get_distances_array, + get_equivalent_atoms, get_interstitials, get_layers, - get_voronoi_vertices, - get_voronoi_neighbors, - get_delaunay_neighbors, - get_cluster_positions, + get_mean_positions, + get_neighborhood, + get_neighbors, + get_steinhardt_parameters, get_strain, get_symmetry, - # for backwards compatibility - get_cluster_positions as cluster_positions, - get_equivalent_atoms as analyse_phonopy_equivalent_atoms, - get_steinhardt_parameters as get_steinhardt_parameter_structure, - get_centro_symmetry_descriptors as analyse_centro_symmetry, - get_diamond_structure_descriptors as analyse_diamond_structure, - get_adaptive_cna_descriptors as analyse_cna_adaptive, - get_voronoi_volumes as analyse_voronoi_volume, - find_solids as analyse_find_solids, + get_voronoi_neighbors, + get_voronoi_vertices, + get_voronoi_volumes, ) # Build from structuretoolkit.build import ( - grainboundary, - get_grainboundary_info, B2, C14, C15, C36, D03, - sqs_structures, - high_index_surface, + get_grainboundary_info, get_high_index_surface_info, - # for backwards compatibility - grainboundary as grainboundary_build, - get_grainboundary_info as grainboundary_info, - sqs_structures as get_sqs_structures, - get_high_index_surface_info as high_index_surface_info, + grainboundary, + high_index_surface, + sqs_structures, ) -# Visualize -from structuretoolkit.visualize import plot3d - # Common from structuretoolkit.common import ( + SymmetryError, + apply_strain, ase_to_pymatgen, - pymatgen_to_ase, ase_to_pyscal, + center_coordinates_in_unit_cell, get_atomic_numbers, get_extended_positions, get_vertical_length, get_wrapped_coordinates, + pymatgen_to_ase, select_index, - center_coordinates_in_unit_cell, - apply_strain, - SymmetryError, +) + +# Visualize +from structuretoolkit.visualize import plot3d + +# Analyse - for backwards compatibility +from structuretoolkit.analyse import ( + find_solids as analyse_find_solids, + get_adaptive_cna_descriptors as analyse_cna_adaptive, + get_centro_symmetry_descriptors as analyse_centro_symmetry, + get_cluster_positions as cluster_positions, + get_diamond_structure_descriptors as analyse_diamond_structure, + get_equivalent_atoms as analyse_phonopy_equivalent_atoms, + get_steinhardt_parameters as get_steinhardt_parameter_structure, + get_voronoi_volumes as analyse_voronoi_volume, +) + +# Build - for backwards compatibility +from structuretoolkit.build import ( + get_grainboundary_info as grainboundary_info, + get_high_index_surface_info as high_index_surface_info, + grainboundary as grainboundary_build, + sqs_structures as get_sqs_structures, ) diff --git a/structuretoolkit/analyse/__init__.py b/structuretoolkit/analyse/__init__.py index 9fa35065c..c4bac13d4 100644 --- a/structuretoolkit/analyse/__init__.py +++ b/structuretoolkit/analyse/__init__.py @@ -1,24 +1,23 @@ -from structuretoolkit.analyse.distance import get_distances_array, find_mic -from structuretoolkit.analyse.neighbors import get_neighbors, get_neighborhood +from structuretoolkit.analyse.distance import find_mic, get_distances_array +from structuretoolkit.analyse.neighbors import get_neighborhood, get_neighbors from structuretoolkit.analyse.phonopy import get_equivalent_atoms from structuretoolkit.analyse.pyscal import ( - get_steinhardt_parameters, + find_solids, + get_adaptive_cna_descriptors, get_centro_symmetry_descriptors, get_diamond_structure_descriptors, - get_adaptive_cna_descriptors, + get_steinhardt_parameters, get_voronoi_volumes, - find_solids, - ase_to_pyscal, ) from structuretoolkit.analyse.spatial import ( - get_mean_positions, get_average_of_unique_labels, + get_cluster_positions, + get_delaunay_neighbors, get_interstitials, get_layers, - get_voronoi_vertices, + get_mean_positions, get_voronoi_neighbors, - get_delaunay_neighbors, - get_cluster_positions, + get_voronoi_vertices, ) from structuretoolkit.analyse.strain import get_strain diff --git a/structuretoolkit/analyse/neighbors.py b/structuretoolkit/analyse/neighbors.py index 1fa9daaeb..0cb06eff6 100644 --- a/structuretoolkit/analyse/neighbors.py +++ b/structuretoolkit/analyse/neighbors.py @@ -2,17 +2,18 @@ # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. +import itertools +import warnings + import numpy as np from scipy.sparse import coo_matrix -from scipy.special import gamma -from scipy.spatial.transform import Rotation -from scipy.special import sph_harm from scipy.spatial import cKDTree -import warnings -import itertools +from scipy.spatial.transform import Rotation +from scipy.special import gamma, sph_harm + from structuretoolkit.common.helper import ( - get_extended_positions, get_average_of_unique_labels, + get_extended_positions, ) __author__ = "Joerg Neugebauer, Sam Waseda" diff --git a/structuretoolkit/analyse/pyscal.py b/structuretoolkit/analyse/pyscal.py index cde8ea2d1..336596b79 100644 --- a/structuretoolkit/analyse/pyscal.py +++ b/structuretoolkit/analyse/pyscal.py @@ -4,6 +4,7 @@ import numpy as np from ase.atoms import Atoms + from structuretoolkit.common.pyscal import ase_to_pyscal __author__ = "Sarath Menon, Jan Janssen" diff --git a/structuretoolkit/analyse/spatial.py b/structuretoolkit/analyse/spatial.py index 05c71eecb..6b97f52a4 100644 --- a/structuretoolkit/analyse/spatial.py +++ b/structuretoolkit/analyse/spatial.py @@ -4,16 +4,15 @@ import numpy as np from scipy.sparse import coo_matrix -from scipy.spatial import Voronoi, Delaunay -from scipy.spatial import ConvexHull +from scipy.spatial import ConvexHull, Delaunay, Voronoi + +from structuretoolkit.analyse.neighbors import get_neighborhood from structuretoolkit.common.helper import ( + get_average_of_unique_labels, get_extended_positions, - get_wrapped_coordinates, get_vertical_length, - get_average_of_unique_labels, + get_wrapped_coordinates, ) -from structuretoolkit.analyse.neighbors import get_neighborhood - __author__ = "Joerg Neugebauer, Sam Waseda" __copyright__ = ( diff --git a/structuretoolkit/analyse/strain.py b/structuretoolkit/analyse/strain.py index 41c407689..3632c9dda 100644 --- a/structuretoolkit/analyse/strain.py +++ b/structuretoolkit/analyse/strain.py @@ -1,5 +1,6 @@ import numpy as np from scipy.spatial.transform import Rotation + from structuretoolkit.analyse.neighbors import get_neighbors from structuretoolkit.analyse.pyscal import get_adaptive_cna_descriptors diff --git a/structuretoolkit/analyse/symmetry.py b/structuretoolkit/analyse/symmetry.py index 3e4d7b653..9fd72b1d2 100644 --- a/structuretoolkit/analyse/symmetry.py +++ b/structuretoolkit/analyse/symmetry.py @@ -2,10 +2,11 @@ # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. +import ast + import numpy as np -from scipy.spatial import cKDTree import spglib -import ast +from scipy.spatial import cKDTree import structuretoolkit.common.helper from structuretoolkit.common.error import SymmetryError diff --git a/structuretoolkit/common/__init__.py b/structuretoolkit/common/__init__.py index 51e3a74f2..41bad76b0 100644 --- a/structuretoolkit/common/__init__.py +++ b/structuretoolkit/common/__init__.py @@ -1,12 +1,12 @@ -from structuretoolkit.common.pymatgen import ase_to_pymatgen, pymatgen_to_ase -from structuretoolkit.common.pyscal import ase_to_pyscal +from structuretoolkit.common.error import SymmetryError from structuretoolkit.common.helper import ( + apply_strain, + center_coordinates_in_unit_cell, get_atomic_numbers, get_extended_positions, get_vertical_length, get_wrapped_coordinates, select_index, - center_coordinates_in_unit_cell, - apply_strain, ) -from structuretoolkit.common.error import SymmetryError +from structuretoolkit.common.pymatgen import ase_to_pymatgen, pymatgen_to_ase +from structuretoolkit.common.pyscal import ase_to_pyscal diff --git a/structuretoolkit/common/helper.py b/structuretoolkit/common/helper.py index bbd34deb0..835ceae0a 100644 --- a/structuretoolkit/common/helper.py +++ b/structuretoolkit/common/helper.py @@ -1,6 +1,6 @@ import numpy as np -from scipy.sparse import coo_matrix from ase.data import atomic_numbers +from scipy.sparse import coo_matrix def get_atomic_numbers(structure): diff --git a/structuretoolkit/visualize.py b/structuretoolkit/visualize.py index 1707981d0..6b7ed9b79 100644 --- a/structuretoolkit/visualize.py +++ b/structuretoolkit/visualize.py @@ -2,9 +2,11 @@ # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. -import numpy as np import warnings + +import numpy as np from scipy.interpolate import interp1d + from structuretoolkit.common.helper import get_atomic_numbers __author__ = "Joerg Neugebauer, Sudarsan Surendralal"