Skip to content

Commit 4ea8ed5

Browse files
committed
Remove ConstructionBase dependency
1 parent 2924211 commit 4ea8ed5

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ version = "0.7.5"
55

66
[deps]
77
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
8-
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
98
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
109
Tricks = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
1110

@@ -23,7 +22,6 @@ DynamicQuantitiesUnitfulExt = "Unitful"
2322

2423
[compat]
2524
Compat = "3.42, 4"
26-
ConstructionBase = "1"
2725
Measurements = "2"
2826
PackageExtensionCompat = "1.0.2"
2927
ScientificTypes = "3"

src/arrays.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Compat: allequal
2-
import ConstructionBase: constructorof
32

43
"""
54
QuantityArray{T,N,D<:AbstractDimensions,Q<:AbstractUnionQuantity,V<:AbstractArray}

src/symbolic_dimensions.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import ConstructionBase: constructorof
21
import Tricks: static_fieldnames
32

43
import .Units: UNIT_SYMBOLS, UNIT_MAPPING, UNIT_VALUES

src/types.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import ConstructionBase: constructorof
21
import Tricks: static_fieldnames, static_fieldtypes
32

43
const DEFAULT_DIM_BASE_TYPE = FixedRational{DEFAULT_NUMERATOR_TYPE,DEFAULT_DENOM}
@@ -18,7 +17,7 @@ the need to define many other functions.
1817
The key function that one could wish to overload is
1918
`DynamicQuantities.dimension_name(::AbstractDimensions, k::Symbol)` for mapping from a field name
2019
to a base unit (e.g., `length` by default maps to `m`). You may also need to overload
21-
`ConstructionBase.constructorof(::Type{T})` in case of non-standard construction.
20+
`constructorof(::Type{T})` in case of non-standard construction.
2221
"""
2322
abstract type AbstractDimensions{R} end
2423

@@ -178,6 +177,11 @@ constructorof(::Type{<:Dimensions}) = Dimensions
178177
constructorof(::Type{<:Quantity}) = Quantity
179178
constructorof(::Type{<:GenericQuantity}) = GenericQuantity
180179

180+
# The following functions should be overloaded for special types
181+
function constructorof(::Type{T}) where {T}
182+
return Base.typename(T).wrapper
183+
end
184+
181185
struct DimensionError{Q1,Q2} <: Exception
182186
q1::Q1
183187
q2::Q2

src/utils.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Compat: allequal
2-
import ConstructionBase: constructorof
32
import Tricks: static_fieldnames
43

54
function map_dimensions(f::F, args::AbstractDimensions...) where {F<:Function}

0 commit comments

Comments
 (0)