Skip to content

Commit

Permalink
use updated API
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed May 16, 2023
1 parent ecc0c7e commit 52d5840
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 32 deletions.
4 changes: 2 additions & 2 deletions pyiron_atomistics/atomistics/job/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import random
import warnings
import itertools
from structuretoolkit import get_sqs_structures
from structuretoolkit.build import sqs_structures
from pyiron_atomistics.atomistics.job.atomistic import AtomisticGenericJob
from pyiron_base import state, DataContainer, GenericParameters, ImportAlarm
from pyiron_atomistics.atomistics.structure.atoms import Atoms, ase_to_pyiron
Expand Down Expand Up @@ -238,7 +238,7 @@ def _number_of_structures(self):

# This function is executed
def run_static(self):
structure_lst, decmp, iterations, cycle_time = get_sqs_structures(
structure_lst, decmp, iterations, cycle_time = sqs_structures(
structure=self.structure,
mole_fractions={k: v for k, v in self.input.mole_fractions.items()},
weights=self.input.weights,
Expand Down
2 changes: 1 addition & 1 deletion pyiron_atomistics/atomistics/structure/_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Distributed under the terms of "New BSD License", see the LICENSE file.

import numpy as np
from structuretoolkit import plot3d
from structuretoolkit.visualize import plot3d

__author__ = "Joerg Neugebauer, Sudarsan Surendralal"
__copyright__ = (
Expand Down
6 changes: 3 additions & 3 deletions pyiron_atomistics/atomistics/structure/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
analyse_voronoi_volume,
analyse_find_solids,
)
from structuretoolkit import (
from structuretoolkit.analyse import (
get_strain,
get_interstitials,
get_layers,
get_voronoi_vertices,
get_voronoi_neighbors,
get_delaunay_neighbors,
cluster_positions,
get_cluster_positions,
)
from pyiron_base import Deprecator

Expand Down Expand Up @@ -418,7 +418,7 @@ def cluster_positions(
positions (numpy.ndarray): Mean positions
label (numpy.ndarray): Labels of the positions (returned when `return_labels = True`)
"""
return cluster_positions(
return get_cluster_positions(
structure=self._structure,
positions=positions,
eps=eps,
Expand Down
4 changes: 2 additions & 2 deletions pyiron_atomistics/atomistics/structure/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import warnings
import seekpath
import importlib
from structuretoolkit import (
from structuretoolkit.analyse import (
get_symmetry,
get_neighbors,
get_neighborhood,
center_coordinates_in_unit_cell,
get_distances_array,
find_mic,
)
from structuretoolkit.common import center_coordinates_in_unit_cell
from pyiron_atomistics.atomistics.structure.atom import (
Atom,
ase_to_pyiron as ase_to_pyiron_atom,
Expand Down
6 changes: 3 additions & 3 deletions pyiron_atomistics/atomistics/structure/factories/aimsgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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.

from structuretoolkit import grainboundary_build, grainboundary_info
from structuretoolkit.build import grainboundary, get_grainboundary_info
from pyiron_atomistics.atomistics.structure.atoms import ase_to_pyiron

__author__ = "Ujjal Saikia"
Expand Down Expand Up @@ -39,7 +39,7 @@ def info(axis, max_sigma):
To construct the grain boundary select a GB plane and sigma value from the list and pass it to the
GBBuilder.gb_build() function along with the rotational axis and initial bulk structure.
"""
return grainboundary_info(axis=axis, max_sigma=max_sigma)
return get_grainboundary_info(axis=axis, max_sigma=max_sigma)

@staticmethod
def build(
Expand Down Expand Up @@ -79,7 +79,7 @@ def build(
:class:`.Atoms`: final grain boundary structure
"""
return ase_to_pyiron(
grainboundary_build(
grainboundary(
axis=axis,
sigma=sigma,
plane=plane,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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.

from structuretoolkit import B2, C14, C15, C36, D03
from structuretoolkit.build import B2, C14, C15, C36, D03
from pyiron_atomistics.atomistics.structure.atoms import ase_to_pyiron

__author__ = "Liam Huber"
Expand Down
6 changes: 3 additions & 3 deletions pyiron_atomistics/atomistics/structure/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
surface as ase_surf,
)
import numpy as np
from structuretoolkit import (
from structuretoolkit.build import (
high_index_surface,
high_index_surface_info,
get_high_index_surface_info,
)
from pyiron_atomistics.atomistics.structure.factories.ase import AseFactory
from pyiron_atomistics.atomistics.structure.factories.atomsk import (
Expand Down Expand Up @@ -500,7 +500,7 @@ def high_index_surface_info(
fin_kink_orientation: The kink orientation lying in the terrace
fin_step_orientation: The step orientation lying in the terrace
"""
return high_index_surface_info(
return get_high_index_surface_info(
element=element,
crystal_structure=crystal_structure,
lattice_constant=lattice_constant,
Expand Down
2 changes: 1 addition & 1 deletion pyiron_atomistics/atomistics/structure/phonopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def analyse_phonopy_equivalent_atoms(atoms, symprec=1e-5, angle_tolerance=-1.0):
"""
state.publications.add(publication())
return stk.analyse_phonopy_equivalent_atoms(
return stk.analyse.get_equivalent_atoms(
structure=atoms, symprec=symprec, angle_tolerance=angle_tolerance
)

Expand Down
22 changes: 8 additions & 14 deletions pyiron_atomistics/atomistics/structure/pyscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import structuretoolkit as stk
from pyiron_base import state
import pyiron_atomistics.atomistics.structure.atoms
import pyscal.core as pc
from pyiron_base import Deprecator

deprecate = Deprecator()
Expand Down Expand Up @@ -52,7 +51,7 @@ def get_steinhardt_parameter_structure(
if clustering == False:
n_clusters = None
state.publications.add(publication())
return stk.get_steinhardt_parameter_structure(
return stk.analyse.get_steinhardt_parameters(
structure=structure,
neighbor_method=neighbor_method,
cutoff=cutoff,
Expand All @@ -74,7 +73,7 @@ def analyse_centro_symmetry(structure, num_neighbors=12):
csm (list) : list of centrosymmetry parameter
"""
state.publications.add(publication())
return stk.analyse_centro_symmetry(structure=structure, num_neighbors=num_neighbors)
return stk.analyse.get_centro_symmetry_descriptors(structure=structure, num_neighbors=num_neighbors)


def analyse_diamond_structure(structure, mode="total", ovito_compatibility=False):
Expand All @@ -95,7 +94,7 @@ def analyse_diamond_structure(structure, mode="total", ovito_compatibility=False
(depends on `mode`)
"""
state.publications.add(publication())
return stk.analyse_diamond_structure(
return stk.analyse.get_diamond_structure_descriptors(
structure=structure, mode=mode, ovito_compatibility=ovito_compatibility
)

Expand All @@ -118,7 +117,7 @@ def analyse_cna_adaptive(structure, mode="total", ovito_compatibility=False):
(depends on `mode`)
"""
state.publications.add(publication())
return stk.analyse_cna_adaptive(
return stk.analyse.get_adaptive_cna_descriptors(
structure=structure, mode=mode, ovito_compatibility=ovito_compatibility
)

Expand All @@ -131,7 +130,7 @@ def analyse_voronoi_volume(structure):
structure : (pyiron_atomistics.structure.atoms.Atoms): The structure to analyze.
"""
state.publications.add(publication())
return stk.analyse_voronoi_volume(structure=structure)
return stk.analyse.get_voronoi_volumes(structure=structure)


def pyiron_to_pyscal_system(structure):
Expand All @@ -146,12 +145,7 @@ def pyiron_to_pyscal_system(structure):
Pyscal system: See the pyscal documentation.
"""
state.publications.add(publication())
sys = pc.System()
sys.read_inputfile(
pyiron_atomistics.atomistics.structure.atoms.pyiron_to_ase(structure),
format="ase",
)
return sys
return stk.common.ase_to_pyscal(pyiron_atomistics.atomistics.structure.atoms.pyiron_to_ase(structure))


def analyse_find_solids(
Expand Down Expand Up @@ -186,8 +180,8 @@ def analyse_find_solids(
pyscal system: pyscal system when return_sys=True
"""
state.publications.add(publication())
return stk.analyse_find_solids(
atoms=structure,
return stk.analyse.find_solids(
structure=structure,
neighbor_method=neighbor_method,
cutoff=cutoff,
bonds=bonds,
Expand Down
2 changes: 1 addition & 1 deletion pyiron_atomistics/atomistics/structure/structurestorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pyiron_base import FlattenedStorage, ImportAlarm
from pyiron_atomistics.atomistics.structure.atom import Atom
from pyiron_atomistics.atomistics.structure.atoms import Atoms
from structuretoolkit.analyse.symmetry import SymmetryError
from structuretoolkit.common.error import SymmetryError
from pyiron_atomistics.atomistics.structure.neighbors import NeighborsTrajectory
import pyiron_atomistics.atomistics.structure.has_structure as pa_has_structure

Expand Down
2 changes: 1 addition & 1 deletion tests/atomistics/structure/test_symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
import numpy as np
from pyiron_atomistics.atomistics.structure.atoms import Atoms
from structuretoolkit.analyse.symmetry import SymmetryError
from structuretoolkit.common.error import SymmetryError
from pyiron_atomistics.atomistics.structure.factory import StructureFactory


Expand Down

0 comments on commit 52d5840

Please sign in to comment.