From 6488a663529032e74fc87b5813b9b6c2caf75674 Mon Sep 17 00:00:00 2001 From: Andrea Albino Date: Thu, 22 Aug 2024 12:10:55 +0200 Subject: [PATCH] filled default values in special Geometry shapes --- src/nomad_material_processing/general.py | 71 ++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/src/nomad_material_processing/general.py b/src/nomad_material_processing/general.py index 8dadd66..64c620d 100644 --- a/src/nomad_material_processing/general.py +++ b/src/nomad_material_processing/general.py @@ -145,7 +145,10 @@ class SquareCuboid(Parallelepiped): A cuboid with all sides equal in length. """ - m_def = Section() + m_def = Section( + a_eln={'hide': ['length']}, + label='Square Cuboid', + ) height = Quantity( type=float, description='The z dimension of the parallelepiped.', @@ -156,16 +159,46 @@ class SquareCuboid(Parallelepiped): ), unit='meter', ) - side = Quantity( + width = Quantity( type=float, - description='The x and y dimensions of the parallelepiped.', + description='The x dimension of the parallelepiped.', a_eln=ELNAnnotation( component=ELNComponentEnum.NumberEditQuantity, defaultDisplayUnit='millimeter', - label='Side (x = y)', + label='Side (x=y)', ), unit='meter', ) + alpha = Quantity( + type=float, + description='The angle between y and z sides.', + a_eln=ELNAnnotation( + component=ELNComponentEnum.NumberEditQuantity, + label='Alpha (∡ y-x-z)', + ), + unit='degree', + default=90.0, + ) + beta = Quantity( + type=float, + description='The angle between x and z sides.', + a_eln=ELNAnnotation( + component=ELNComponentEnum.NumberEditQuantity, + label='Beta (∡ x-y-z)', + ), + unit='degree', + default=90.0, + ) + gamma = Quantity( + type=float, + description='The angle between x and y sides.', + a_eln=ELNAnnotation( + component=ELNComponentEnum.NumberEditQuantity, + label='Gamma (∡ x-z-y)', + ), + unit='degree', + default=90.0, + ) surface_area = Quantity( type=float, description=""" @@ -219,6 +252,36 @@ class RectangleCuboid(Parallelepiped): ), unit='meter', ) + alpha = Quantity( + type=float, + description='The angle between y and z sides.', + a_eln=ELNAnnotation( + component=ELNComponentEnum.NumberEditQuantity, + label='Alpha (∡ y-x-z)', + ), + unit='degree', + default=90.0, + ) + beta = Quantity( + type=float, + description='The angle between x and z sides.', + a_eln=ELNAnnotation( + component=ELNComponentEnum.NumberEditQuantity, + label='Beta (∡ x-y-z)', + ), + unit='degree', + default=90.0, + ) + gamma = Quantity( + type=float, + description='The angle between x and y sides.', + a_eln=ELNAnnotation( + component=ELNComponentEnum.NumberEditQuantity, + label='Gamma (∡ x-z-y)', + ), + unit='degree', + default=90.0, + ) surface_area = Quantity( type=float, description="""