Skip to content

Commit

Permalink
filled default values in special Geometry shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
aalbino2 committed Aug 22, 2024
1 parent dec6731 commit 6488a66
Showing 1 changed file with 67 additions and 4 deletions.
71 changes: 67 additions & 4 deletions src/nomad_material_processing/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand All @@ -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="""
Expand Down Expand Up @@ -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="""
Expand Down

0 comments on commit 6488a66

Please sign in to comment.