Skip to content

Commit c9c68aa

Browse files
committed
Add fields to docstrings
1 parent 9847077 commit c9c68aa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/types.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ const SYNONYM_MAPPING = NamedTuple(DIMENSION_NAMES .=> DIMENSION_SYNONYMS)
99
A type representing the dimensions of a quantity, with each
1010
field giving the power of the corresponding dimension. For
1111
example, the dimensions of velocity are `Dimensions(length=1, time=-1)`.
12+
13+
# Fields
14+
15+
- `length::Rational{Int}`: length dimension (i.e., meters^(length))
16+
- `mass::Rational{Int}`: mass dimension (i.e., kg^(mass))
17+
- `time::Rational{Int}`: time dimension (i.e., s^(time))
18+
- `current::Rational{Int}`: current dimension (i.e., A^(current))
19+
- `temperature::Rational{Int}`: temperature dimension (i.e., K^(temperature))
20+
- `luminosity::Rational{Int}`: luminosity dimension (i.e., cd^(luminosity))
21+
- `amount::Rational{Int}`: amount dimension (i.e., mol^(amount))
1222
"""
1323
struct Dimensions
1424
length::R
@@ -45,6 +55,12 @@ You can access specific dimensions with `ulength(q)`, `umass(q)`, `utime(q)`,
4555
4656
Severals operators in `Base` are extended to work with `Quantity` objects,
4757
including `*`, `+`, `-`, `/`, `^`, `sqrt`, and `cbrt`.
58+
59+
# Fields
60+
61+
- `value::T`: value of the quantity of some type `T`
62+
- `dimensions::Dimensions`: dimensions of the quantity
63+
- `valid::Bool`: whether the quantity is valid or not
4864
"""
4965
struct Quantity{T}
5066
value::T

0 commit comments

Comments
 (0)