Skip to content

Commit

Permalink
Merge pull request #134 from pyscal/fix_ci
Browse files Browse the repository at this point in the history
Fix ci
  • Loading branch information
srmnitc authored Jul 10, 2024
2 parents e57bb83 + 1c291c3 commit 3321668
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
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

0 comments on commit 3321668

Please sign in to comment.