Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ci #134

Merged
merged 2 commits into from
Jul 10, 2024
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
20 changes: 16 additions & 4 deletions atomrdf/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
from rdflib import Graph, Namespace, XSD, RDF, RDFS, BNode, URIRef
from atomrdf.namespace import CMSO, LDO, PLDO, PODO, UNSAFEASMO, UNSAFECMSO, PROV, Literal

from atomman.defect.Dislocation import Dislocation
import atomman as am
import atomman.unitconvert as uc

# read element data file
file_location = os.path.dirname(__file__).split("/")
file_location = "/".join(file_location[:-1])
Expand Down Expand Up @@ -253,7 +249,16 @@ def _make_dislocation(
The dislocation_type parameter can be set to "monopole" or "periodicarray". If set to "monopole", a single dislocation
will be generated. If set to "periodicarray", a periodic array of dislocations will be generated.

Needs atomman.
"""

try:
from atomman.defect.Dislocation import Dislocation
import atomman as am
import atomman.unitconvert as uc
except ImportError:
raise ImportError("This function requires the atomman package to be installed")

slip_direction = slip_system[0]
slip_plane = slip_system[1]
if burgers_vector is None:
Expand Down Expand Up @@ -2100,6 +2105,13 @@ def add_gb(self, gb_dict):


def rotate(self, rotation_vectors, graph=None, label=None):
try:
from atomman.defect.Dislocation import Dislocation
import atomman as am
import atomman.unitconvert as uc
except ImportError:
raise ImportError("This function requires the atomman package to be installed")

box = am.Box(
avect=self.box[0],
bvect=self.box[1],
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- owlready2
- plotly
- ipywidgets
- atomman
#- atomman
- mp-api
- sqlalchemy
- pip:
Expand Down
Loading