Skip to content

Commit

Permalink
Started fixing tests, but it's too late
Browse files Browse the repository at this point in the history
  • Loading branch information
ceriottm committed Sep 18, 2023
1 parent 1b5462f commit 8716da4
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions python/tests/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def test_custom_shapes(self):
numbers=[1, 1, 1], positions=[[0, 0, 0], [1, 1, 1], [2, 2, 5]]
)

shapes = {
#TODO re-enable after having fixed custom shapes
"""
"cubes": [
[
{"kind": "custom", "vertices": CUBE_VERTICES},
Expand All @@ -57,27 +58,32 @@ def test_custom_shapes(self):
"simplices": CUBE_SIMPLICES,
},
],
],
"other": [
[
{"kind": "sphere", "radius": 0.3},
{"kind": "ellipsoid", "semiaxes": [0.3, 0.2, 0.1]},
{
"kind": "ellipsoid",
"semiaxes": [0.3, 0.2, 0.1],
"orientation": [1, 0, 0, 0],
},
],
],
],"""
shapes = {
"spheres_structure": {
"kind" : "sphere",
"parameters" : {
"global" : {"radius": 0.1},
"structure" : [ {"position" : [1, 2, 3]} ],
}
},
"ellipsoids_atoms" : {
"kind" : "ellipsoid",
"parameters" : {
"global" : {"semiaxes": [0.3, 0.2, 0.1]},
"atom" : [ {}, {"semiaxes": [0.1, 0.2, 0.3]}, {"orientation": [0.2,0.3,0.4,1]}],
}
}
}

data = chemiscope.create_input(frames=[frame], shapes=shapes)

result = data["structures"][0]["shapes"]
self.assertEqual(list(result.keys()), ["cubes", "other"])
result = data["shapes"]
print(result)
self.assertEqual(list(result.keys()), ["spheres_structure", "ellipsoids_atoms"])

for key, values in result.items():
self.assertEqual(shapes[key][0], values)
self.assertEqual(shapes[key], values)


class TestShapesFromASE(unittest.TestCase):
Expand Down

0 comments on commit 8716da4

Please sign in to comment.