Skip to content

Commit 0dc67f5

Browse files
committed
fix: separate units/slots
1 parent a4503ad commit 0dc67f5

File tree

5 files changed

+96
-41
lines changed

5 files changed

+96
-41
lines changed

docs/attributes/slots.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,19 @@ has these fields:
7070

7171
`units`{ #units }
7272

73-
: **Optional**-*obj (see subkeys below)*<br>
73+
: **Optional**-*[Units](units.md)*<br>
7474
Values related to the slot measurement units
7575

7676

7777
`default_value`{ #default-value }
7878

7979
: **Optional**-*number | null*<br>
80-
default value for in-slot, if null then the value for the in-slot needs
81-
to be set/fed at a later point in time.
80+
default value for in-slot, if null then the value for the in-slot
81+
needs to be set/fed at a later point in time.
8282

83-
Default value must not be set for out-slots!
83+
!!! warning
84+
85+
Default value must not be set for out-slots!
8486

8587

8688

docs/attributes/units.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,58 @@ has these fields:
1515
`unit`{ #unit }
1616

1717
: **Optional**-*string*<br>
18-
18+
human readable unit symbol, here N for Newton
19+
20+
21+
=== "Example"
22+
``` yaml
23+
N
24+
```
1925

2026

2127
`exponent`{ #exponent }
2228

23-
: **Optional**-*integer[]*<br>
24-
29+
: **Optional**-*number[]*<br>
30+
7-tuple of integer-valued exponents*- Ordered list of SI base units
31+
32+
- 1st entry: Length - meter (m)
33+
- 2nd entry: Time - second (s)
34+
- 3rd entry: Amount of substance - mole (mol)
35+
- 4th entry: Electric current - ampere (A)
36+
- 5th entry: Temperature - kelvin (K)
37+
- 6th entry: Luminous intensity - candela (cd)
38+
- 7th entry: Mass - kilogram (kg)
39+
40+
!!! note "Explanation"
41+
42+
the exponents reference the above SI base units in the
43+
corresponding order to describe the unit w.r.t. the base SI units,
44+
the entries [1, -2, 0, 0, 0, 0, 1] thus denote m s⁻² kg, i.e., Newton
45+
2546

2647

2748
`offset`{ #offset }
2849

29-
: **Optional**-*integer*<br>
30-
50+
: **Optional**-*number*<br>
51+
default value is 0*- allows to offset the values by adding a constant,
52+
e.g., Celsius is offset by 273.15 relative to Kelvin (C + 273.15 = K).
53+
!!! warning
54+
55+
For absolute temperatures only! For temperature
56+
*differences*, this must be omitted!
57+
3158

3259

3360
`scale`{ #scale }
3461

35-
: **Optional**-*integer*<br>
36-
62+
: **Optional**-*number*<br>
63+
default value is 1*- allows to scale the values into base units,
64+
e.g., 1e-3 to describe mm (millimeters) in terms of m (meters)
65+
66+
67+
68+
=== "Example"
69+
``` yaml
70+
1
71+
```
3772

docs/custom_definitions/slots.yaml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
default_value:
22
description: |
3-
default value for in-slot, if null then the value for the in-slot needs
4-
to be set/fed at a later point in time.
5-
6-
Default value must not be set for out-slots!
3+
default value for in-slot, if null then the value for the in-slot
4+
needs to be set/fed at a later point in time.
5+
6+
!!! warning
7+
8+
Default value must not be set for out-slots!
79
type: number | null
810
dimensions:
911
description: dimension of inputs to in-slot, array of dimensions for matrices /
@@ -14,17 +16,6 @@ dimension_names:
1416
description: 'optional list of concise names of each tensor dimension to indicate
1517
expected contents, e.g., "dimension_names": ["batch", "channels", "width", "height"]'
1618
type: array of strings matching length of dimension | null
17-
exponents:
18-
description: 'Ordered list of SI base units<br> 1st entry: Length - meter
19-
(m)<br> 2nd entry: Time - second (s)<br> 3rd entry: Amount of
20-
substance - mole (mol)<br> 4th entry: Electric current - ampere (A)<br> 5th
21-
entry: Temperature - kelvin (K)<br> 6th entry: Luminous intensity - candela
22-
(cd)<br> 7th entry: Mass - kilogram (kg)<br><br>Explanation: the exponents
23-
reference the above SI base units in the corresponding order to describe the unit
24-
w.r.t. the base SI units, the entries [1, -2, 0, 0, 0, 0, 1] thus denote m s⁻²
25-
kg, i.e., Newton'
26-
example: '[1, -2, 0, 0, 0, 0, 1]'
27-
type: array, 7-tuple of integer-valued exponents
2819
is_continuous:
2920
description: flag to indicate whether slot values are integer or real numbers
3021
example:
@@ -39,25 +30,11 @@ name:
3930
description: Human-readable identifier
4031
example: Force at Boundary Condition 1
4132
type: string
42-
name_of_unit:
43-
description: human readable unit symbol, here N for Newton
44-
example: N
45-
type: string
46-
offset:
47-
description: allows to offset the values by adding a constant, e.g., Celsius is
48-
offset by 273.15 relative to Kelvin (C + 273.15 = K).<br>For absolute temperatures
49-
only! For temperature *differences*, this must be omitted!
50-
type: number, default value is 0
5133
ranges:
5234
description: 'valid range of values (2-tuple array minimum maximum values OR array
5335
of discrete valid scalars).<br>If a valid range is not known a-priori: null /
5436
omitted'
5537
type: array | null
56-
scale_factor:
57-
description: allows to scale the values into base units, e.g., 1e-3 to describe
58-
mm (millimeters) in terms of m (meters)
59-
example: 1
60-
type: number, default value is 1
6138
units:
6239
description: Values related to the slot measurement units
63-
type: obj (see subkeys below)
40+
type: "[Units](units.md)"

docs/custom_definitions/units.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
unit:
2+
description: human readable unit symbol, here N for Newton
3+
type: string
4+
example: N
5+
6+
exponent:
7+
description: |
8+
7-tuple of integer-valued exponents*- Ordered list of SI base units
9+
10+
- 1st entry: Length - meter (m)
11+
- 2nd entry: Time - second (s)
12+
- 3rd entry: Amount of substance - mole (mol)
13+
- 4th entry: Electric current - ampere (A)
14+
- 5th entry: Temperature - kelvin (K)
15+
- 6th entry: Luminous intensity - candela (cd)
16+
- 7th entry: Mass - kilogram (kg)
17+
18+
!!! note "Explanation"
19+
20+
the exponents reference the above SI base units in the
21+
corresponding order to describe the unit w.r.t. the base SI units,
22+
the entries [1, -2, 0, 0, 0, 0, 1] thus denote m s⁻² kg, i.e., Newton
23+
type: number[]
24+
25+
offset:
26+
description: |
27+
default value is 0*- allows to offset the values by adding a constant,
28+
e.g., Celsius is offset by 273.15 relative to Kelvin (C + 273.15 = K).
29+
!!! warning
30+
31+
For absolute temperatures only! For temperature
32+
*differences*, this must be omitted!
33+
type: number
34+
35+
scale:
36+
description: |
37+
default value is 1*- allows to scale the values into base units,
38+
e.g., 1e-3 to describe mm (millimeters) in terms of m (meters)
39+
type: number
40+
example: 1

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ nav:
4040
- Model:
4141
- Model: attributes/model/index.md
4242
- Slots: attributes/slots.md
43+
- Units: attributes/units.md
4344
- Behaviour:
4445
- Behaviour (M + A): attributes/ma_pair/index.md
4546
- Data:

0 commit comments

Comments
 (0)