From 8716da4291226ffddcfd9a1eba4b38f3b98fbd0f Mon Sep 17 00:00:00 2001 From: Michele Ceriotti Date: Mon, 18 Sep 2023 00:16:20 -0700 Subject: [PATCH] Started fixing tests, but it's too late --- python/tests/shapes.py | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/python/tests/shapes.py b/python/tests/shapes.py index 3f36f5b1c..48909f037 100644 --- a/python/tests/shapes.py +++ b/python/tests/shapes.py @@ -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}, @@ -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):