Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Aug 15, 2024
1 parent 7706e72 commit 64cf406
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,22 @@ def test_interstitials():
species = s.value(sys.sample, CMSO.hasSpecies)
elements = [k[2] for k in s.triples((species, CMSO.hasElement, None))]
assert len(elements) == 3

def test_gb():
kg = KnowledgeGraph()
struct_gb_1 = System.create.defect.grain_boundary(axis=[0,0,1],
sigma=5,
gb_plane=[3, -1, 0],
element='Fe',
graph=kg)
res = kg.query_sample(kg.ontology.terms.pldo.SymmetricalTiltGrainBoundary)
assert len(res.AtomicScaleSample.values) == 1

new = struct_gb_1.repeat((2,2,2))
res = kg.query_sample(kg.ontology.terms.pldo.SymmetricalTiltGrainBoundary)
assert len(res.AtomicScaleSample.values) == 2

ss = kg.get_sample(new.sample)
res = ss.query_sample(ss.ontology.terms.pldo.SymmetricalTiltGrainBoundary)
assert len(res.AtomicScaleSample.values) == 1

0 comments on commit 64cf406

Please sign in to comment.