structuretoolkit 0.0.22__tar.gz → 0.0.23__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 (54) hide show
  1. {structuretoolkit-0.0.22/structuretoolkit.egg-info → structuretoolkit-0.0.23}/PKG-INFO +14 -14
  2. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/pyproject.toml +13 -13
  3. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/__init__.py +2 -0
  4. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/_version.py +3 -3
  5. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/build/__init__.py +2 -1
  6. structuretoolkit-0.0.23/structuretoolkit/build/mesh.py +53 -0
  7. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/common/__init__.py +1 -0
  8. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/common/helper.py +34 -1
  9. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/visualize.py +13 -6
  10. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23/structuretoolkit.egg-info}/PKG-INFO +14 -14
  11. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit.egg-info/SOURCES.txt +3 -0
  12. structuretoolkit-0.0.23/structuretoolkit.egg-info/requires.txt +39 -0
  13. structuretoolkit-0.0.23/tests/test_helpers.py +28 -0
  14. structuretoolkit-0.0.23/tests/test_mesh.py +31 -0
  15. structuretoolkit-0.0.22/structuretoolkit.egg-info/requires.txt +0 -39
  16. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/LICENSE +0 -0
  17. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/MANIFEST.in +0 -0
  18. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/README.md +0 -0
  19. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/setup.cfg +0 -0
  20. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/setup.py +0 -0
  21. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/__init__.py +0 -0
  22. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/distance.py +0 -0
  23. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/dscribe.py +0 -0
  24. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/neighbors.py +0 -0
  25. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/phonopy.py +0 -0
  26. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/pyscal.py +0 -0
  27. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/snap.py +0 -0
  28. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/spatial.py +0 -0
  29. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/strain.py +0 -0
  30. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/analyse/symmetry.py +0 -0
  31. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/build/aimsgb.py +0 -0
  32. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/build/compound.py +0 -0
  33. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/build/random.py +0 -0
  34. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/build/sqs.py +0 -0
  35. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/build/surface.py +0 -0
  36. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/common/error.py +0 -0
  37. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/common/phonopy.py +0 -0
  38. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/common/pymatgen.py +0 -0
  39. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit/common/pyscal.py +0 -0
  40. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit.egg-info/dependency_links.txt +0 -0
  41. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/structuretoolkit.egg-info/top_level.txt +0 -0
  42. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_aimsgb.py +0 -0
  43. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_analyse.py +0 -0
  44. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_compound.py +0 -0
  45. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_dscribe.py +0 -0
  46. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_high_index_surface.py +0 -0
  47. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_neighbors.py +0 -0
  48. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_pymatgen.py +0 -0
  49. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_pyscal.py +0 -0
  50. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_pyxtal.py +0 -0
  51. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_snap.py +0 -0
  52. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_strain.py +0 -0
  53. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_symmetry.py +0 -0
  54. {structuretoolkit-0.0.22 → structuretoolkit-0.0.23}/tests/test_visualize.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: structuretoolkit
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: build, analyse and visualise atomistic structures for materials science
5
5
  Author-email: Jan Janssen <janssen@mpie.de>
6
6
  License: BSD 3-Clause License
@@ -42,41 +42,41 @@ Classifier: Topic :: Scientific/Engineering :: Physics
42
42
  Classifier: License :: OSI Approved :: BSD License
43
43
  Classifier: Intended Audience :: Science/Research
44
44
  Classifier: Operating System :: OS Independent
45
- Classifier: Programming Language :: Python :: 3.8
46
45
  Classifier: Programming Language :: Python :: 3.9
47
46
  Classifier: Programming Language :: Python :: 3.10
48
47
  Classifier: Programming Language :: Python :: 3.11
49
- Requires-Python: >=3.8
48
+ Classifier: Programming Language :: Python :: 3.12
49
+ Requires-Python: <3.13,>=3.9
50
50
  Description-Content-Type: text/markdown
51
51
  License-File: LICENSE
52
52
  Requires-Dist: ase<=3.22.1,>=3.20.1
53
53
  Requires-Dist: numpy<=1.26.4,>=1.23.5
54
- Requires-Dist: scipy<=1.13.0,>=1.9.3
54
+ Requires-Dist: scipy<=1.13.1,>=1.9.3
55
55
  Provides-Extra: dscribe
56
56
  Requires-Dist: dscribe==2.1.0; extra == "dscribe"
57
57
  Provides-Extra: grainboundary
58
58
  Requires-Dist: aimsgb<=1.1.1,>=1.0.2; extra == "grainboundary"
59
- Requires-Dist: pymatgen<=2024.3.1,>=2022.2.1; extra == "grainboundary"
59
+ Requires-Dist: pymatgen<=2024.5.1,>=2022.2.1; extra == "grainboundary"
60
60
  Provides-Extra: pyscal
61
61
  Requires-Dist: pyscal2==2.10.18; extra == "pyscal"
62
62
  Provides-Extra: nglview
63
63
  Requires-Dist: nglview<=3.1.2,>=2.7.7; extra == "nglview"
64
64
  Provides-Extra: matplotlib
65
- Requires-Dist: matplotlib==3.8.3; extra == "matplotlib"
65
+ Requires-Dist: matplotlib==3.8.4; extra == "matplotlib"
66
66
  Provides-Extra: plotly
67
- Requires-Dist: plotly<=5.19.0,>=4.14.3; extra == "plotly"
67
+ Requires-Dist: plotly<=5.22.0,>=4.14.3; extra == "plotly"
68
68
  Provides-Extra: clusters
69
- Requires-Dist: scikit-learn==1.4.1.post1; extra == "clusters"
69
+ Requires-Dist: scikit-learn==1.5.0; extra == "clusters"
70
70
  Provides-Extra: symmetry
71
- Requires-Dist: spglib<=2.3.1,>=1.16.5; extra == "symmetry"
71
+ Requires-Dist: spglib<=2.4.0,>=1.16.5; extra == "symmetry"
72
72
  Provides-Extra: surface
73
- Requires-Dist: spglib<=2.3.1,>=1.16.5; extra == "surface"
74
- Requires-Dist: pymatgen<=2024.3.1,>=2022.2.1; extra == "surface"
73
+ Requires-Dist: spglib<=2.4.0,>=1.16.5; extra == "surface"
74
+ Requires-Dist: pymatgen<=2024.5.1,>=2022.2.1; extra == "surface"
75
75
  Provides-Extra: phonopy
76
- Requires-Dist: phonopy<=2.22.1,>=2.16.2; extra == "phonopy"
77
- Requires-Dist: spglib<=2.3.1,>=1.16.5; extra == "phonopy"
76
+ Requires-Dist: phonopy<=2.23.1,>=2.16.2; extra == "phonopy"
77
+ Requires-Dist: spglib<=2.4.0,>=1.16.5; extra == "phonopy"
78
78
  Provides-Extra: pyxtal
79
- Requires-Dist: pyxtal<=0.6.2,>=0.5.5; extra == "pyxtal"
79
+ Requires-Dist: pyxtal<=0.6.6,>=0.5.5; extra == "pyxtal"
80
80
 
81
81
  # structuretoolkit
82
82
 
@@ -11,22 +11,22 @@ authors = [
11
11
  readme = "README.md"
12
12
  license = { file = "LICENSE" }
13
13
  keywords = ["pyiron"]
14
- requires-python = ">=3.8"
14
+ requires-python = ">=3.9, <3.13"
15
15
  classifiers = [
16
16
  "Development Status :: 5 - Production/Stable",
17
17
  "Topic :: Scientific/Engineering :: Physics",
18
18
  "License :: OSI Approved :: BSD License",
19
19
  "Intended Audience :: Science/Research",
20
20
  "Operating System :: OS Independent",
21
- "Programming Language :: Python :: 3.8",
22
21
  "Programming Language :: Python :: 3.9",
23
22
  "Programming Language :: Python :: 3.10",
24
23
  "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
25
  ]
26
26
  dependencies = [
27
27
  "ase>=3.20.1,<=3.22.1",
28
28
  "numpy>=1.23.5,<=1.26.4",
29
- "scipy>=1.9.3,<=1.13.0",
29
+ "scipy>=1.9.3,<=1.13.1",
30
30
  ]
31
31
  dynamic = ["version"]
32
32
 
@@ -39,23 +39,23 @@ Repository = "https://github.com/pyiron/structuretoolkit"
39
39
  dscribe = ["dscribe==2.1.0"]
40
40
  grainboundary = [
41
41
  "aimsgb>=1.0.2,<=1.1.1",
42
- "pymatgen>=2022.2.1,<=2024.3.1",
42
+ "pymatgen>=2022.2.1,<=2024.5.1",
43
43
  ]
44
44
  pyscal = ["pyscal2==2.10.18"]
45
45
  nglview = ["nglview>=2.7.7,<=3.1.2"]
46
- matplotlib = ["matplotlib==3.8.3"]
47
- plotly = ["plotly>=4.14.3,<=5.19.0"]
48
- clusters = ["scikit-learn==1.4.1.post1"]
49
- symmetry = ["spglib>=1.16.5,<=2.3.1"]
46
+ matplotlib = ["matplotlib==3.8.4"]
47
+ plotly = ["plotly>=4.14.3,<=5.22.0"]
48
+ clusters = ["scikit-learn==1.5.0"]
49
+ symmetry = ["spglib>=1.16.5,<=2.4.0"]
50
50
  surface = [
51
- "spglib>=1.16.5,<=2.3.1",
52
- "pymatgen>=2022.2.1,<=2024.3.1",
51
+ "spglib>=1.16.5,<=2.4.0",
52
+ "pymatgen>=2022.2.1,<=2024.5.1",
53
53
  ]
54
54
  phonopy = [
55
- "phonopy>=2.16.2,<=2.22.1",
56
- "spglib>=1.16.5,<=2.3.1",
55
+ "phonopy>=2.16.2,<=2.23.1",
56
+ "spglib>=1.16.5,<=2.4.0",
57
57
  ]
58
- pyxtal = ["pyxtal>=0.5.5,<=0.6.2"]
58
+ pyxtal = ["pyxtal>=0.5.5,<=0.6.6"]
59
59
 
60
60
  [tool.setuptools.packages.find]
61
61
  include = ["structuretoolkit*"]
@@ -37,6 +37,7 @@ from structuretoolkit.build import (
37
37
  grainboundary,
38
38
  high_index_surface,
39
39
  sqs_structures,
40
+ create_mesh,
40
41
  )
41
42
 
42
43
  # Common
@@ -51,6 +52,7 @@ from structuretoolkit.common import (
51
52
  get_wrapped_coordinates,
52
53
  pymatgen_to_ase,
53
54
  select_index,
55
+ get_cell,
54
56
  )
55
57
 
56
58
  # Visualize
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-04-08T11:30:30-0500",
11
+ "date": "2024-05-23T11:34:35-0500",
12
12
  "dirty": true,
13
13
  "error": null,
14
- "full-revisionid": "cbb00e1ec4efc047fa4f1c31dfd34110952b834c",
15
- "version": "0.0.22"
14
+ "full-revisionid": "d365999a6d980c073a9aad91304db97456d42200",
15
+ "version": "0.0.23"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -8,4 +8,5 @@ from structuretoolkit.build.sqs import sqs_structures
8
8
  from structuretoolkit.build.surface import (
9
9
  high_index_surface,
10
10
  get_high_index_surface_info
11
- )
11
+ )
12
+ from structuretoolkit.build.mesh import create_mesh
@@ -0,0 +1,53 @@
1
+ from __future__ import annotations
2
+
3
+ import numpy as np
4
+ import warnings
5
+ import typing
6
+ from structuretoolkit.common.helper import get_cell
7
+
8
+
9
+ class MeshInputError(ValueError):
10
+ """ Raised when mesh input format is wrong """
11
+
12
+
13
+ def create_mesh(
14
+ cell: typing.Union["ase.atoms.Atoms", np.ndarray, list, float],
15
+ n_mesh: typing.Union[int, list[int, int, int]] = 10,
16
+ density: typing.Optional[float] = None,
17
+ endpoint: bool = False
18
+ ):
19
+ """
20
+ Create a mesh based on a structure cell
21
+
22
+ Args:
23
+ cell (ase.atoms.Atoms|np.ndarray|list|float): ASE Atoms or cell
24
+ n_mesh (int): Number of grid points in each direction. If one number
25
+ is given, it will be repeated in every direction (i.e. n_mesh = 3
26
+ is the same as n_mesh = [3, 3, 3])
27
+ density (float): Density of grid points. Ignored when n_mesh is not
28
+ None
29
+ endpoint (bool): Whether both the edges get separate points or not.
30
+ cf. endpoint in numpy.linspace
31
+
32
+ Returns:
33
+ (3, n, n, n)-array: mesh
34
+ """
35
+ cell = get_cell(cell)
36
+ if n_mesh is None:
37
+ if density is None:
38
+ raise MeshInputError("either n_mesh or density must be specified")
39
+ n_mesh = np.rint(np.linalg.norm(cell, axis=-1) / density).astype(int)
40
+ elif density is not None:
41
+ raise MeshInputError(
42
+ "You cannot set n_mesh at density at the same time. Set one of"
43
+ " them to None"
44
+ )
45
+ n_mesh = np.atleast_1d(n_mesh).astype(int)
46
+ if len(n_mesh) == 1:
47
+ n_mesh = np.repeat(n_mesh, 3)
48
+ elif len(n_mesh) != 3:
49
+ raise MeshInputError("n_mesh must be a 3-dim vector")
50
+ linspace = [np.linspace(0, 1, nn, endpoint=endpoint) for nn in n_mesh]
51
+ x_mesh = np.meshgrid(*linspace, indexing='ij')
52
+ return np.einsum("ixyz,ij->jxyz", x_mesh, cell)
53
+
@@ -6,6 +6,7 @@ from structuretoolkit.common.helper import (
6
6
  get_vertical_length,
7
7
  get_wrapped_coordinates,
8
8
  select_index,
9
+ get_cell,
9
10
  )
10
11
  from structuretoolkit.common.pymatgen import (
11
12
  ase_to_pymatgen,
@@ -2,7 +2,7 @@ import numpy as np
2
2
  from ase.atoms import Atoms
3
3
  from ase.data import atomic_numbers
4
4
  from scipy.sparse import coo_matrix
5
- from typing import Optional
5
+ from typing import Optional, Union
6
6
 
7
7
 
8
8
  def get_extended_positions(
@@ -226,3 +226,36 @@ def apply_strain(
226
226
  structure_copy.set_cell(cell, scale_atoms=True)
227
227
  if return_box:
228
228
  return structure_copy
229
+
230
+
231
+ def get_cell(cell: Union[Atoms, list, tuple, np.ndarray, float]):
232
+ """
233
+ Get cell of an ase structure, or convert a float or a (3,)-array into a
234
+ orthogonal cell.
235
+
236
+ Args:
237
+ cell (Atoms|ndarray|list|float|tuple): Cell
238
+
239
+ Returns:
240
+ (3, 3)-array: Cell
241
+ """
242
+ if isinstance(cell, Atoms):
243
+ return cell.cell
244
+ # Convert float into (3,)-array. No effect if it is (3,3)-array or
245
+ # (3,)-array. Raises error if the shape is not correct
246
+ try:
247
+ cell = cell * np.ones(3)
248
+ except ValueError:
249
+ raise ValueError(
250
+ f"Invalid cell type or shape: {type(cell).__name__}, {np.shape(cell)}"
251
+ )
252
+
253
+ if np.shape(cell) == (3, 3):
254
+ return cell
255
+ # Convert (3,)-array into (3,3)-array. Raises error if the shape is wrong
256
+ try:
257
+ return cell * np.eye(3)
258
+ except ValueError:
259
+ raise ValueError(
260
+ f"Invalid cell type or shape: {type(cell).__name__}, {np.shape(cell)}"
261
+ )
@@ -9,6 +9,8 @@ import numpy as np
9
9
  from typing import Optional
10
10
  from scipy.interpolate import interp1d
11
11
 
12
+ from structuretoolkit.common.helper import get_cell
13
+
12
14
  __author__ = "Joerg Neugebauer, Sudarsan Surendralal"
13
15
  __copyright__ = (
14
16
  "Copyright 2021, Max-Planck-Institut für Eisenforschung GmbH - "
@@ -165,6 +167,16 @@ def _get_box_skeleton(cell: np.ndarray):
165
167
  return all_lines @ cell
166
168
 
167
169
 
170
+ def _draw_box_plotly(fig, structure, px, go):
171
+ cell = get_cell(structure)
172
+ data = fig.data
173
+ for lines in _get_box_skeleton(cell):
174
+ fig = px.line_3d(**{xx: vv for xx, vv in zip(["x", "y", "z"], lines.T)})
175
+ fig.update_traces(line_color="#000000")
176
+ data = fig.data + data
177
+ return go.Figure(data=data)
178
+
179
+
168
180
  def _plot3d_plotly(
169
181
  structure: Atoms,
170
182
  show_cell: bool = True,
@@ -223,12 +235,7 @@ def _plot3d_plotly(
223
235
  ),
224
236
  )
225
237
  if show_cell:
226
- data = fig.data
227
- for lines in _get_box_skeleton(structure.cell):
228
- fig = px.line_3d(**{xx: vv for xx, vv in zip(["x", "y", "z"], lines.T)})
229
- fig.update_traces(line_color="#000000")
230
- data = fig.data + data
231
- fig = go.Figure(data=data)
238
+ fig = _draw_box_plotly(fig, structure, px, go)
232
239
  fig.layout.scene.camera.projection.type = camera
233
240
  rot = _get_orientation(view_plane).T
234
241
  rot[0, :] *= distance_from_camera * 1.25
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: structuretoolkit
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: build, analyse and visualise atomistic structures for materials science
5
5
  Author-email: Jan Janssen <janssen@mpie.de>
6
6
  License: BSD 3-Clause License
@@ -42,41 +42,41 @@ Classifier: Topic :: Scientific/Engineering :: Physics
42
42
  Classifier: License :: OSI Approved :: BSD License
43
43
  Classifier: Intended Audience :: Science/Research
44
44
  Classifier: Operating System :: OS Independent
45
- Classifier: Programming Language :: Python :: 3.8
46
45
  Classifier: Programming Language :: Python :: 3.9
47
46
  Classifier: Programming Language :: Python :: 3.10
48
47
  Classifier: Programming Language :: Python :: 3.11
49
- Requires-Python: >=3.8
48
+ Classifier: Programming Language :: Python :: 3.12
49
+ Requires-Python: <3.13,>=3.9
50
50
  Description-Content-Type: text/markdown
51
51
  License-File: LICENSE
52
52
  Requires-Dist: ase<=3.22.1,>=3.20.1
53
53
  Requires-Dist: numpy<=1.26.4,>=1.23.5
54
- Requires-Dist: scipy<=1.13.0,>=1.9.3
54
+ Requires-Dist: scipy<=1.13.1,>=1.9.3
55
55
  Provides-Extra: dscribe
56
56
  Requires-Dist: dscribe==2.1.0; extra == "dscribe"
57
57
  Provides-Extra: grainboundary
58
58
  Requires-Dist: aimsgb<=1.1.1,>=1.0.2; extra == "grainboundary"
59
- Requires-Dist: pymatgen<=2024.3.1,>=2022.2.1; extra == "grainboundary"
59
+ Requires-Dist: pymatgen<=2024.5.1,>=2022.2.1; extra == "grainboundary"
60
60
  Provides-Extra: pyscal
61
61
  Requires-Dist: pyscal2==2.10.18; extra == "pyscal"
62
62
  Provides-Extra: nglview
63
63
  Requires-Dist: nglview<=3.1.2,>=2.7.7; extra == "nglview"
64
64
  Provides-Extra: matplotlib
65
- Requires-Dist: matplotlib==3.8.3; extra == "matplotlib"
65
+ Requires-Dist: matplotlib==3.8.4; extra == "matplotlib"
66
66
  Provides-Extra: plotly
67
- Requires-Dist: plotly<=5.19.0,>=4.14.3; extra == "plotly"
67
+ Requires-Dist: plotly<=5.22.0,>=4.14.3; extra == "plotly"
68
68
  Provides-Extra: clusters
69
- Requires-Dist: scikit-learn==1.4.1.post1; extra == "clusters"
69
+ Requires-Dist: scikit-learn==1.5.0; extra == "clusters"
70
70
  Provides-Extra: symmetry
71
- Requires-Dist: spglib<=2.3.1,>=1.16.5; extra == "symmetry"
71
+ Requires-Dist: spglib<=2.4.0,>=1.16.5; extra == "symmetry"
72
72
  Provides-Extra: surface
73
- Requires-Dist: spglib<=2.3.1,>=1.16.5; extra == "surface"
74
- Requires-Dist: pymatgen<=2024.3.1,>=2022.2.1; extra == "surface"
73
+ Requires-Dist: spglib<=2.4.0,>=1.16.5; extra == "surface"
74
+ Requires-Dist: pymatgen<=2024.5.1,>=2022.2.1; extra == "surface"
75
75
  Provides-Extra: phonopy
76
- Requires-Dist: phonopy<=2.22.1,>=2.16.2; extra == "phonopy"
77
- Requires-Dist: spglib<=2.3.1,>=1.16.5; extra == "phonopy"
76
+ Requires-Dist: phonopy<=2.23.1,>=2.16.2; extra == "phonopy"
77
+ Requires-Dist: spglib<=2.4.0,>=1.16.5; extra == "phonopy"
78
78
  Provides-Extra: pyxtal
79
- Requires-Dist: pyxtal<=0.6.2,>=0.5.5; extra == "pyxtal"
79
+ Requires-Dist: pyxtal<=0.6.6,>=0.5.5; extra == "pyxtal"
80
80
 
81
81
  # structuretoolkit
82
82
 
@@ -24,6 +24,7 @@ structuretoolkit/analyse/symmetry.py
24
24
  structuretoolkit/build/__init__.py
25
25
  structuretoolkit/build/aimsgb.py
26
26
  structuretoolkit/build/compound.py
27
+ structuretoolkit/build/mesh.py
27
28
  structuretoolkit/build/random.py
28
29
  structuretoolkit/build/sqs.py
29
30
  structuretoolkit/build/surface.py
@@ -37,7 +38,9 @@ tests/test_aimsgb.py
37
38
  tests/test_analyse.py
38
39
  tests/test_compound.py
39
40
  tests/test_dscribe.py
41
+ tests/test_helpers.py
40
42
  tests/test_high_index_surface.py
43
+ tests/test_mesh.py
41
44
  tests/test_neighbors.py
42
45
  tests/test_pymatgen.py
43
46
  tests/test_pyscal.py
@@ -0,0 +1,39 @@
1
+ ase<=3.22.1,>=3.20.1
2
+ numpy<=1.26.4,>=1.23.5
3
+ scipy<=1.13.1,>=1.9.3
4
+
5
+ [clusters]
6
+ scikit-learn==1.5.0
7
+
8
+ [dscribe]
9
+ dscribe==2.1.0
10
+
11
+ [grainboundary]
12
+ aimsgb<=1.1.1,>=1.0.2
13
+ pymatgen<=2024.5.1,>=2022.2.1
14
+
15
+ [matplotlib]
16
+ matplotlib==3.8.4
17
+
18
+ [nglview]
19
+ nglview<=3.1.2,>=2.7.7
20
+
21
+ [phonopy]
22
+ phonopy<=2.23.1,>=2.16.2
23
+ spglib<=2.4.0,>=1.16.5
24
+
25
+ [plotly]
26
+ plotly<=5.22.0,>=4.14.3
27
+
28
+ [pyscal]
29
+ pyscal2==2.10.18
30
+
31
+ [pyxtal]
32
+ pyxtal<=0.6.6,>=0.5.5
33
+
34
+ [surface]
35
+ spglib<=2.4.0,>=1.16.5
36
+ pymatgen<=2024.5.1,>=2022.2.1
37
+
38
+ [symmetry]
39
+ spglib<=2.4.0,>=1.16.5
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
3
+ # Distributed under the terms of "New BSD License", see the LICENSE file.
4
+
5
+ import unittest
6
+ import numpy as np
7
+ from ase.build import bulk
8
+ import structuretoolkit as stk
9
+
10
+
11
+ class TestHelpers(unittest.TestCase):
12
+ def test_get_cell(self):
13
+ self.assertEqual((3 * np.eye(3)).tolist(), stk.get_cell(3).tolist())
14
+ self.assertEqual(
15
+ ([1, 2, 3] * np.eye(3)).tolist(), stk.get_cell([1, 2, 3]).tolist()
16
+ )
17
+ atoms = bulk("Fe")
18
+ self.assertEqual(
19
+ atoms.cell.tolist(), stk.get_cell(atoms).tolist()
20
+ )
21
+ with self.assertRaises(ValueError):
22
+ stk.get_cell(np.arange(4))
23
+ with self.assertRaises(ValueError):
24
+ stk.get_cell(np.ones((4, 3)))
25
+
26
+
27
+ if __name__ == "__main__":
28
+ unittest.main()
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
3
+ # Distributed under the terms of "New BSD License", see the LICENSE file.
4
+
5
+ import unittest
6
+ from ase.build import bulk
7
+ import structuretoolkit as stk
8
+
9
+
10
+ class TestMesh(unittest.TestCase):
11
+ def test_mesh(self):
12
+ structure = bulk("Al", cubic=True)
13
+ self.assertEqual(stk.create_mesh(structure, n_mesh=4).shape, (3, 4, 4, 4))
14
+ with self.assertRaises(stk.build.mesh.MeshInputError):
15
+ stk.create_mesh(structure, n_mesh=None, density=None)
16
+ with self.assertRaises(stk.build.mesh.MeshInputError):
17
+ stk.create_mesh(
18
+ structure, n_mesh=10, density=structure.cell[0, 0] / 4
19
+ )
20
+ self.assertEqual(
21
+ stk.create_mesh(
22
+ structure, n_mesh=None, density=structure.cell[0, 0] / 4
23
+ ).shape,
24
+ (3, 4, 4, 4),
25
+ )
26
+ with self.assertRaises(stk.build.mesh.MeshInputError):
27
+ _ = stk.create_mesh(structure, n_mesh=[1, 2, 3, 4])
28
+
29
+
30
+ if __name__ == "__main__":
31
+ unittest.main()
@@ -1,39 +0,0 @@
1
- ase<=3.22.1,>=3.20.1
2
- numpy<=1.26.4,>=1.23.5
3
- scipy<=1.13.0,>=1.9.3
4
-
5
- [clusters]
6
- scikit-learn==1.4.1.post1
7
-
8
- [dscribe]
9
- dscribe==2.1.0
10
-
11
- [grainboundary]
12
- aimsgb<=1.1.1,>=1.0.2
13
- pymatgen<=2024.3.1,>=2022.2.1
14
-
15
- [matplotlib]
16
- matplotlib==3.8.3
17
-
18
- [nglview]
19
- nglview<=3.1.2,>=2.7.7
20
-
21
- [phonopy]
22
- phonopy<=2.22.1,>=2.16.2
23
- spglib<=2.3.1,>=1.16.5
24
-
25
- [plotly]
26
- plotly<=5.19.0,>=4.14.3
27
-
28
- [pyscal]
29
- pyscal2==2.10.18
30
-
31
- [pyxtal]
32
- pyxtal<=0.6.2,>=0.5.5
33
-
34
- [surface]
35
- spglib<=2.3.1,>=1.16.5
36
- pymatgen<=2024.3.1,>=2022.2.1
37
-
38
- [symmetry]
39
- spglib<=2.3.1,>=1.16.5