structuretoolkit 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. structuretoolkit-0.0.1/LICENSE +29 -0
  2. structuretoolkit-0.0.1/MANIFEST.in +3 -0
  3. structuretoolkit-0.0.1/PKG-INFO +21 -0
  4. structuretoolkit-0.0.1/README.md +51 -0
  5. structuretoolkit-0.0.1/setup.cfg +11 -0
  6. structuretoolkit-0.0.1/setup.py +44 -0
  7. structuretoolkit-0.0.1/structuretoolkit/__init__.py +42 -0
  8. structuretoolkit-0.0.1/structuretoolkit/_version.py +21 -0
  9. structuretoolkit-0.0.1/structuretoolkit/analyse/__init__.py +0 -0
  10. structuretoolkit-0.0.1/structuretoolkit/analyse/distance.py +59 -0
  11. structuretoolkit-0.0.1/structuretoolkit/analyse/neighbors.py +1239 -0
  12. structuretoolkit-0.0.1/structuretoolkit/analyse/phonopy.py +41 -0
  13. structuretoolkit-0.0.1/structuretoolkit/analyse/pyscal.py +314 -0
  14. structuretoolkit-0.0.1/structuretoolkit/analyse/spatial.py +631 -0
  15. structuretoolkit-0.0.1/structuretoolkit/analyse/strain.py +245 -0
  16. structuretoolkit-0.0.1/structuretoolkit/analyse/symmetry.py +404 -0
  17. structuretoolkit-0.0.1/structuretoolkit/build/__init__.py +0 -0
  18. structuretoolkit-0.0.1/structuretoolkit/build/aimsgb.py +99 -0
  19. structuretoolkit-0.0.1/structuretoolkit/build/compound.py +209 -0
  20. structuretoolkit-0.0.1/structuretoolkit/build/sqs.py +154 -0
  21. structuretoolkit-0.0.1/structuretoolkit/build/surface.py +164 -0
  22. structuretoolkit-0.0.1/structuretoolkit/helper.py +220 -0
  23. structuretoolkit-0.0.1/structuretoolkit/visualize.py +739 -0
  24. structuretoolkit-0.0.1/structuretoolkit.egg-info/PKG-INFO +21 -0
  25. structuretoolkit-0.0.1/structuretoolkit.egg-info/SOURCES.txt +37 -0
  26. structuretoolkit-0.0.1/structuretoolkit.egg-info/dependency_links.txt +1 -0
  27. structuretoolkit-0.0.1/structuretoolkit.egg-info/requires.txt +9 -0
  28. structuretoolkit-0.0.1/structuretoolkit.egg-info/top_level.txt +1 -0
  29. structuretoolkit-0.0.1/tests/test_aimsgb.py +25 -0
  30. structuretoolkit-0.0.1/tests/test_analyse.py +205 -0
  31. structuretoolkit-0.0.1/tests/test_compound.py +93 -0
  32. structuretoolkit-0.0.1/tests/test_high_index_surface.py +56 -0
  33. structuretoolkit-0.0.1/tests/test_neighbors.py +416 -0
  34. structuretoolkit-0.0.1/tests/test_pyscal.py +300 -0
  35. structuretoolkit-0.0.1/tests/test_strain.py +47 -0
  36. structuretoolkit-0.0.1/tests/test_symmetry.py +163 -0
  37. structuretoolkit-0.0.1/tests/test_visualize.py +26 -0
  38. structuretoolkit-0.0.1/versioneer.py +1822 -0
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2018, Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ include versioneer.py
2
+ include structuretoolkit/_version.py
3
+ include LICENSE
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.1
2
+ Name: structuretoolkit
3
+ Version: 0.0.1
4
+ Summary: structuretoolkit - to analyse, build and visualise atomistic structures.
5
+ Home-page: https://github.com/pyiron/structuretoolkit
6
+ Author: Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
7
+ Author-email: janssen@mpie.de
8
+ License: BSD
9
+ Keywords: pyiron
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Topic :: Scientific/Engineering :: Physics
12
+ Classifier: License :: OSI Approved :: BSD License
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ License-File: LICENSE
20
+
21
+ http://pyiron.org
@@ -0,0 +1,51 @@
1
+ # structuretoolkit
2
+ Originally developed as part of the `pyiron_atomistics` module the `structuretoolkit` was release as standalone library
3
+ for analysing, building and visualising atomistic structures. Internally it uses the `ase.atoms.Atoms` class to
4
+ represent atomistic structures in python. The `structuretoolkit` is integrated inside `pyiron_atomistics`.
5
+
6
+ ## Disclaimer
7
+ The `structuretoolkit` is currently under development.
8
+
9
+ ## Example
10
+ ```python
11
+ import structuretoolkit as stk
12
+ from ase.build import bulk
13
+
14
+ structure = bulk("Al", cubic=True)
15
+ stk.analyse_cna_adaptive(structure)
16
+ stk.plot3d(structure)
17
+ ```
18
+
19
+ ## Features
20
+ ### Analysis
21
+ * `get_neighbors`
22
+ * `get_neighborhood`
23
+ * `analyse_phonopy_equivalent_atoms`
24
+ * `get_steinhardt_parameter_structure`
25
+ * `analyse_centro_symmetry`
26
+ * `analyse_diamond_structure`
27
+ * `analyse_cna_adaptive`
28
+ * `analyse_voronoi_volume`
29
+ * `analyse_find_solids`
30
+ * `get_mean_positions`
31
+ * `get_average_of_unique_labels`
32
+ * `get_interstitials`
33
+ * `get_layers`
34
+ * `get_voronoi_vertices`
35
+ * `get_voronoi_neighbors`
36
+ * `get_delaunay_neighbors`
37
+ * `cluster_positions`
38
+ * `get_strain`
39
+
40
+ ### Build
41
+ * `grainboundary_build`
42
+ * `grainboundary_info`
43
+ * `get_sqs_structures`
44
+ * `B2`
45
+ * `C14`
46
+ * `C15`
47
+ * `C36`
48
+ * `D03`
49
+
50
+ ### Visualize
51
+ * `plot3d`
@@ -0,0 +1,11 @@
1
+ [versioneer]
2
+ VCS = git
3
+ style = pep440-pre
4
+ versionfile_source = structuretoolkit/_version.py
5
+ tag_prefix = structuretoolkit-
6
+ parentdir_prefix = structuretoolkit
7
+
8
+ [egg_info]
9
+ tag_build =
10
+ tag_date = 0
11
+
@@ -0,0 +1,44 @@
1
+ """
2
+ Setuptools based setup module
3
+ """
4
+ from setuptools import setup, find_packages
5
+ import versioneer
6
+
7
+ setup(
8
+ name='structuretoolkit',
9
+ version=versioneer.get_version(),
10
+ description='structuretoolkit - to analyse, build and visualise atomistic structures.',
11
+ long_description='http://pyiron.org',
12
+
13
+ url='https://github.com/pyiron/structuretoolkit',
14
+ author='Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department',
15
+ author_email='janssen@mpie.de',
16
+ license='BSD',
17
+
18
+ classifiers=[
19
+ 'Development Status :: 5 - Production/Stable',
20
+ 'Topic :: Scientific/Engineering :: Physics',
21
+ 'License :: OSI Approved :: BSD License',
22
+ 'Intended Audience :: Science/Research',
23
+ 'Operating System :: OS Independent',
24
+ 'Programming Language :: Python :: 3.8',
25
+ 'Programming Language :: Python :: 3.9',
26
+ 'Programming Language :: Python :: 3.10',
27
+ 'Programming Language :: Python :: 3.11'
28
+ ],
29
+
30
+ keywords='pyiron',
31
+ packages=find_packages(exclude=["*tests*", "*docs*", "*binder*", "*conda*", "*notebooks*", "*.ci_support*"]),
32
+ install_requires=[
33
+ 'aimsgb>=0.1.1',
34
+ 'ase>=3.22.1',
35
+ 'matplotlib>=3.7.0',
36
+ 'numpy>=1.24.2',
37
+ 'phonopy>=2.17.1',
38
+ 'pymatgen>=2022.11.7',
39
+ 'scipy>=1.10.0',
40
+ 'scikit-learn>=1.2.1',
41
+ 'spglib>=2.0.2',
42
+ ],
43
+ cmdclass=versioneer.get_cmdclass(),
44
+ )
@@ -0,0 +1,42 @@
1
+ # Analyse
2
+ from structuretoolkit.analyse.distance import get_distances_array, find_mic
3
+ from structuretoolkit.analyse.neighbors import get_neighbors, get_neighborhood
4
+ from structuretoolkit.analyse.phonopy import analyse_phonopy_equivalent_atoms
5
+ from structuretoolkit.analyse.pyscal import (
6
+ get_steinhardt_parameter_structure,
7
+ analyse_centro_symmetry,
8
+ analyse_diamond_structure,
9
+ analyse_cna_adaptive,
10
+ analyse_voronoi_volume,
11
+ analyse_find_solids,
12
+ )
13
+ from structuretoolkit.analyse.spatial import (
14
+ get_mean_positions,
15
+ get_average_of_unique_labels,
16
+ get_interstitials,
17
+ get_layers,
18
+ get_voronoi_vertices,
19
+ get_voronoi_neighbors,
20
+ get_delaunay_neighbors,
21
+ cluster_positions,
22
+ )
23
+ from structuretoolkit.analyse.strain import get_strain
24
+ from structuretoolkit.analyse.symmetry import get_symmetry
25
+
26
+ # Build
27
+ from structuretoolkit.build.aimsgb import grainboundary_build, grainboundary_info
28
+ from structuretoolkit.build.compound import B2, C14, C15, C36, D03
29
+ from structuretoolkit.build.sqs import get_sqs_structures
30
+ from structuretoolkit.build.surface import high_index_surface, high_index_surface_info
31
+
32
+ # Other
33
+ from structuretoolkit.helper import (
34
+ get_atomic_numbers,
35
+ get_extended_positions,
36
+ get_vertical_length,
37
+ get_wrapped_coordinates,
38
+ select_index,
39
+ center_coordinates_in_unit_cell,
40
+ apply_strain,
41
+ )
42
+ from structuretoolkit.visualize import plot3d
@@ -0,0 +1,21 @@
1
+
2
+ # This file was generated by 'versioneer.py' (0.18) from
3
+ # revision-control system data, or from the parent directory name of an
4
+ # unpacked source archive. Distribution tarballs contain a pre-generated copy
5
+ # of this file.
6
+
7
+ import json
8
+
9
+ version_json = '''
10
+ {
11
+ "date": "2023-03-27T17:01:19-0600",
12
+ "dirty": true,
13
+ "error": null,
14
+ "full-revisionid": "02120876560fcd96d15bf7f7c77b8120151fbbbe",
15
+ "version": "0.0.1"
16
+ }
17
+ ''' # END VERSION_JSON
18
+
19
+
20
+ def get_versions():
21
+ return json.loads(version_json)
@@ -0,0 +1,59 @@
1
+ import numpy as np
2
+
3
+
4
+ def get_distances_array(structure, p1=None, p2=None, mic=True, vectors=False):
5
+ """
6
+ Return distance matrix of every position in p1 with every position in
7
+ p2. If p2 is not set, it is assumed that distances between all
8
+ positions in p1 are desired. p2 will be set to p1 in this case. If both
9
+ p1 and p2 are not set, the distances between all atoms in the box are
10
+ returned.
11
+
12
+ Args:
13
+ p1 (numpy.ndarray/list): Nx3 array of positions
14
+ p2 (numpy.ndarray/list): Nx3 array of positions
15
+ mic (bool): minimum image convention
16
+ vectors (bool): return vectors instead of distances
17
+ Returns:
18
+ numpy.ndarray: NxN if vector=False and NxNx3 if vector=True
19
+
20
+ """
21
+ if p1 is None and p2 is not None:
22
+ p1 = p2
23
+ p2 = None
24
+ if p1 is None:
25
+ p1 = structure.positions
26
+ if p2 is None:
27
+ p2 = structure.positions
28
+ p1 = np.asarray(p1)
29
+ p2 = np.asarray(p2)
30
+ diff_relative = (
31
+ p2.reshape(-1, 3)[np.newaxis, :, :] - p1.reshape(-1, 3)[:, np.newaxis, :]
32
+ )
33
+ diff_relative = diff_relative.reshape(p1.shape[:-1] + p2.shape[:-1] + (3,))
34
+ if not mic:
35
+ if vectors:
36
+ return diff_relative
37
+ else:
38
+ return np.linalg.norm(diff_relative, axis=-1)
39
+ return find_mic(structure=structure, v=diff_relative, vectors=vectors)
40
+
41
+
42
+ def find_mic(structure, v, vectors=True):
43
+ """
44
+ Find vectors following minimum image convention (mic). In principle this
45
+ function does the same as ase.geometry.find_mic
46
+
47
+ Args:
48
+ v (list/numpy.ndarray): 3d vector or a list/array of 3d vectors
49
+ vectors (bool): Whether to return vectors (distances are returned if False)
50
+
51
+ Returns: numpy.ndarray of the same shape as input with mic
52
+ """
53
+ if any(structure.pbc):
54
+ v = np.einsum("ji,...j->...i", np.linalg.inv(structure.cell), v)
55
+ v[..., structure.pbc] -= np.rint(v)[..., structure.pbc]
56
+ v = np.einsum("ji,...j->...i", structure.cell, v)
57
+ if vectors:
58
+ return np.asarray(v)
59
+ return np.linalg.norm(v, axis=-1)