Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions structuretoolkit/analyse/neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Tree:
def __init__(self, ref_structure):
"""
Args:
ref_structure (pyiron_atomistics.atomistics.structure.atoms.Atoms): Reference
ref_structure (ase.atoms.Atoms): Reference
structure.
"""
self._distances = None
Expand Down Expand Up @@ -399,7 +399,7 @@ def get_neighborhood(

Returns:

pyiron.atomistics.structure.atoms.Tree: Neighbors instances with the neighbor indices,
structuretoolkit.analyse.neighbors.Tree: Neighbors instances with the neighbor indices,
distances and vectors

"""
Expand Down Expand Up @@ -799,8 +799,8 @@ def get_shell_matrix(


Example:
from pyiron_atomistics import Project
structure = Project('.').create_structure('Fe', 'bcc', 2.83).repeat(2)
from ase.build import bulk
structure = bulk('Fe', 'bcc', 2.83).repeat(2)
J = -0.1 # Ising parameter
magmoms = 2*np.random.random((len(structure)), 3)-1 # Random magnetic moments between -1 and 1
neigh = structure.get_neighbors(num_neighbors=8) # Iron first shell
Expand Down Expand Up @@ -1126,7 +1126,7 @@ def get_neighbors(

Returns:

pyiron.atomistics.structure.atoms.Neighbors: Neighbors instances with the neighbor
structuretoolkit.analyse.neighbors.Neighbors: Neighbors instances with the neighbor
indices, distances and vectors

"""
Expand Down Expand Up @@ -1218,7 +1218,7 @@ def get_neighborhood(

Returns:

pyiron.atomistics.structure.atoms.Tree: Neighbors instances with the neighbor
structuretoolkit.analyse.neighbors.Tree: Neighbors instances with the neighbor
indices, distances and vectors

"""
Expand Down
20 changes: 10 additions & 10 deletions structuretoolkit/analyse/pyscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_steinhardt_parameter_structure(
numpy.ndarray: (number of q's, number of atoms) shaped array of q parameters
numpy.ndarray: If `clustering=True`, an additional per-atom array of cluster ids is also returned
"""
sys = pyiron_to_pyscal_system(structure)
sys = ase_to_pyscal_system(structure)
q = (4, 6) if q is None else q

sys.find_neighbors(method=neighbor_method, cutoff=cutoff)
Expand Down Expand Up @@ -72,7 +72,7 @@ def analyse_centro_symmetry(structure, num_neighbors=12):
Returns:
csm (list) : list of centrosymmetry parameter
"""
sys = pyiron_to_pyscal_system(structure)
sys = ase_to_pyscal_system(structure)
return np.array(sys.calculate_centrosymmetry(nmax=num_neighbors))


Expand All @@ -93,7 +93,7 @@ def analyse_diamond_structure(structure, mode="total", ovito_compatibility=False
Returns:
(depends on `mode`)
"""
sys = pyiron_to_pyscal_system(structure)
sys = ase_to_pyscal_system(structure)
diamond_dict = sys.identify_diamond()

ovito_identifiers = [
Expand Down Expand Up @@ -183,7 +183,7 @@ def analyse_cna_adaptive(structure, mode="total", ovito_compatibility=False):
Use common neighbor analysis

Args:
structure (pyiron_atomistics.structure.atoms.Atoms): The structure to analyze.
structure (ase.atoms.Atoms): The structure to analyze.
mode ("total"/"numeric"/"str"): Controls the style and level
of detail of the output.
- total : return number of atoms belonging to each structure
Expand All @@ -195,7 +195,7 @@ def analyse_cna_adaptive(structure, mode="total", ovito_compatibility=False):
Returns:
(depends on `mode`)
"""
sys = pyiron_to_pyscal_system(structure)
sys = ase_to_pyscal_system(structure)
if mode not in ["total", "numeric", "str"]:
raise ValueError("Unsupported mode")

Expand Down Expand Up @@ -238,21 +238,21 @@ def analyse_voronoi_volume(structure):
Calculate the Voronoi volume of atoms

Args:
structure : (pyiron_atomistics.structure.atoms.Atoms): The structure to analyze.
structure : (ase.atoms.Atoms): The structure to analyze.
"""
sys = pyiron_to_pyscal_system(structure)
sys = ase_to_pyscal_system(structure)
sys.find_neighbors(method="voronoi")
structure = sys.atoms
return np.array([atom.volume for atom in structure])


def pyiron_to_pyscal_system(structure):
def ase_to_pyscal_system(structure):
"""
Converts atoms to ase atoms and than to a pyscal system.
Also adds the pyscal publication.

Args:
structure (pyiron atoms): Structure to convert.
structure (ase.atoms.Atoms): Structure to convert.

Returns:
Pyscal system: See the pyscal documentation.
Expand Down Expand Up @@ -296,7 +296,7 @@ def analyse_find_solids(
int: number of solids,
pyscal system: pyscal system when return_sys=True
"""
sys = pyiron_to_pyscal_system(structure)
sys = ase_to_pyscal_system(structure)
sys.find_neighbors(method=neighbor_method, cutoff=cutoff)
sys.find_solids(
bonds=bonds,
Expand Down
6 changes: 3 additions & 3 deletions structuretoolkit/analyse/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def neigh(self):
Neighborhood information of each interstitial candidate and their surrounding atoms. E.g.
`class.neigh.distances[0][0]` gives the distance from the first interstitial candidate to
its nearest neighboring atoms. The functionalities of `neigh` follow those of
`pyiron_atomistics.structure.atoms.neighbors`.
`structuretoolkit.analyse.neighbors`.
"""
if self._neigh is None:
self._neigh = get_neighborhood(
Expand Down Expand Up @@ -578,7 +578,7 @@ def cluster_positions(
Example I:

```
analyse = Analyze(some_pyiron_structure)
analyse = Analyze(some_ase_structure)
positions = analyse.cluster_points(eps=2)
```

Expand All @@ -589,7 +589,7 @@ def cluster_positions(
Example II:

```
analyse = Analyze(some_pyiron_structure)
analyse = Analyze(some_ase_structure)
print(analyse.cluster_positions([3*[0.], 3*[1.]], eps=3))
```

Expand Down
4 changes: 2 additions & 2 deletions structuretoolkit/analyse/strain.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def __init__(
"""

Args:
structure (pyiron_atomistics.atomistics.structure.Atoms): Structure to calculate the
structure (ase.atoms.Atoms): Structure to calculate the
strain values.
ref_structure (pyiron_atomistics.atomistics.structure.Atoms): Reference bulk structure
ref_structure (ase.atoms.Atoms): Reference bulk structure
(against which the strain is calculated)
num_neighbors (int): Number of neighbors to take into account to calculate the local
frame. If not specified, it is estimated based on cna analysis (only available if
Expand Down
6 changes: 3 additions & 3 deletions structuretoolkit/analyse/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
):
"""
Args:
structure (:class:`pyiron.atomistics.structure.atoms.Atoms`): reference Atom structure.
structure (:class:`ase.atoms.Atoms`): reference Atom structure.
use_magmoms (bool): Whether to consider magnetic moments (cf.
get_initial_magnetic_moments())
use_elements (bool): If False, chemical elements will be ignored
Expand Down Expand Up @@ -334,7 +334,7 @@ def get_primitive_cell(
use_elements (bool): If False, chemical elements will be ignored

Returns:
(pyiron_atomistics.atomistics.structure.atoms.Atoms): Primitive cell
(ase.atoms.Atoms): Primitive cell

Example (assume `basis` is a primitive cell):

Expand Down Expand Up @@ -391,7 +391,7 @@ def get_symmetry(
angle_tolerance (float): Angle search tolerance

Returns:
symmetry (:class:`pyiron.atomistics.structure.symmetry.Symmetry`): Symmetry class
symmetry (:class:`structuretoolkit.analyse.symmetry.Symmetry`): Symmetry class


"""
Expand Down
2 changes: 1 addition & 1 deletion structuretoolkit/build/aimsgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def grainboundary_build(
axis : Rotational axis for the GB you want to construct (for example, axis=[1,0,0])
sigma (int) : The sigma value of the GB you want to construct (for example, sigma=5)
plane: The grain boundary plane of the GB you want to construct (for example, plane=[2,1,0])
initial_struct : Initial bulk structure from which you want to construct the GB (a pyiron
initial_struct : Initial bulk structure from which you want to construct the GB (a ase
structure object).
delete_layer : To delete layers of the GB. For example, delete_layer='1b0t1b0t'. The first
4 characters is for first grain and the other 4 is for second grain. b means
Expand Down
2 changes: 1 addition & 1 deletion structuretoolkit/build/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def high_index_surface(
vacuum (float): Thickness of vacuum on the top of the slab. default:10

Returns:
slab: pyiron_atomistics.atomistics.structure.atoms.Atoms instance Required surface
slab: ase.atoms.Atoms instance Required surface
"""
basis = bulk(
name=element,
Expand Down
2 changes: 1 addition & 1 deletion structuretoolkit/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def center_coordinates_in_unit_cell(structure, origin=0, eps=1e-4):
eps (float): Tolerance to detect atoms at cell edges

Returns:
:class:`pyiron_atomistics.atomistics.structure.atoms.Atoms`: reference to this structure
:class:`ase.atoms.Atoms`: reference to this structure
"""
if any(structure.pbc):
structure.set_scaled_positions(
Expand Down