Skip to content

Commit 106ebdb

Browse files
committed
Rename AbstractQuantity to QuantityNumber
1 parent 0c7beeb commit 106ebdb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/NestedNumbers.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export NestedNumber, AReal, AInteger, ABool
1111
export OpaqueNumber, OReal, OInteger, OBool
1212
export TracedNumber, TReal, TInteger, TBool
1313
export StaticNumber, SReal, SInteger, SBool
14-
export AbstractQuantity, QReal, QInteger, QBool
14+
export QuantityNumber, QReal, QInteger, QBool
1515

1616
"""
1717
abstract type NestedNumber{T<:Number}
@@ -139,7 +139,7 @@ const SBool = Union{Bool, StaticNumber{Bool}}
139139

140140

141141
"""
142-
abstract type AbstractQuantity{T<:Number}
142+
abstract type QuantityNumber{T<:Number}
143143
144144
Read as "maybe static Real", a `Real` or `StaticNumber{<:Real}`.
145145
"""
@@ -151,27 +151,27 @@ const SReal = Union{T, StaticNumber{T}} where T <: Real
151151
Read as "maybe static Integer", an `Integ
152152
Super-type for number-like quantities (e.g. numbers with units).
153153
"""
154-
abstract type AbstractQuantity{T<:Number} <: NestedNumber{T} end
154+
abstract type QuantityNumber{T<:Number} <: NestedNumber{T} end
155155

156156
"""
157-
const QReal = Union{T, AbstractQuantity{T}} where {T<:Real}
157+
const QReal = Union{T, QuantityNumber{T}} where {T<:Real}
158158
159-
Read as "maybe a real-valued quantity", a `Real` or `AbstractQuantity{<:Real}`.
159+
Read as "maybe a real-valued quantity", a `Real` or `QuantityNumber{<:Real}`.
160160
"""
161-
const QReal = Union{T, AbstractQuantity{T}} where T <: Real
161+
const QReal = Union{T, QuantityNumber{T}} where T <: Real
162162

163163
"""
164-
const QInteger = Union{T, AbstractQuantity{T}} where {T<:Integer}
164+
const QInteger = Union{T, QuantityNumber{T}} where {T<:Integer}
165165
166-
Read as "maybe an integer-valued quantity", an `Integer` or `AbstractQuantity{<:Integer}`.
166+
Read as "maybe an integer-valued quantity", an `Integer` or `QuantityNumber{<:Integer}`.
167167
"""
168-
const QInteger = Union{T, AbstractQuantity{T}} where T <: Integer
168+
const QInteger = Union{T, QuantityNumber{T}} where T <: Integer
169169

170170
"""
171-
const QBool = Union{Bool, AbstractQuantity{Bool}}
171+
const QBool = Union{Bool, QuantityNumber{Bool}}
172172
173-
Read as "maybe a boolean quantity", a `Bool` or `AbstractQuantity{Bool}`.
173+
Read as "maybe a boolean quantity", a `Bool` or `QuantityNumber{Bool}`.
174174
"""
175-
const QBool = Union{Bool, AbstractQuantity{Bool}}
175+
const QBool = Union{Bool, QuantityNumber{Bool}}
176176

177177
end # module

test/test_nested_number.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct SomeOpaque{T<:Number} <: OpaqueNumber{T} end
1010
struct SomeTraced{T<:Number} <: TracedNumber{T} end
1111

1212

13-
struct SomeQuantity{T<:Number} <: AbstractQuantity{T}
13+
struct SomeQuantity{T<:Number} <: QuantityNumber{T}
1414
value::T
1515
unit::Symbol
1616
end

0 commit comments

Comments
 (0)