Skip to content

Commit

Permalink
Renamed AffineUnitsParse to AffineUnits (for convention)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deduction42 committed Feb 4, 2025
1 parent 70cff63 commit c94ffc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/affine_dimensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Base.:(≈)(q1::UnionAbstractQuantity{<:Any, <:AbstractDimensions}, q2::UnionAbs
# Units are stored using SymbolicDimensionsSingleton
const DEFAULT_AFFINE_QUANTITY_TYPE = with_type_parameters(DEFAULT_QUANTITY_TYPE, DEFAULT_VALUE_TYPE, AffineDimensions{DEFAULT_DIM_BASE_TYPE})

module AffineUnitsParse
module AffineUnits

using DispatchDoctor: @unstable

Expand Down Expand Up @@ -434,7 +434,7 @@ end



import .AffineUnitsParse: aff_uparse, update_external_affine_unit
import .AffineUnits: aff_uparse, update_external_affine_unit

"""
ua"[unit expression]"
Expand All @@ -450,8 +450,8 @@ import .AffineUnitsParse: aff_uparse, update_external_affine_unit
`Quantity(1.0, AffineDimensions(scale=1000.0, offset=0.0, basedim=Dimensions(length=1, time=-2)))`.
"""
macro ua_str(s)
ex = AffineUnitsParse.map_to_scope(Meta.parse(s))
ex = :($AffineUnitsParse.as_quantity($ex))
ex = AffineUnits.map_to_scope(Meta.parse(s))
ex = :($AffineUnits.as_quantity($ex))
return esc(ex)
end

Expand Down
4 changes: 2 additions & 2 deletions src/register_units.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ end

function _register_affine_unit(name, expr)
name_symbol = Meta.quot(name)
index = get(AffineUnitsParse.AFFINE_UNIT_MAPPING, name, INDEX_TYPE(0))
index = get(AffineUnits.AFFINE_UNIT_MAPPING, name, INDEX_TYPE(0))
if !iszero(index)
unit = AffineUnitsParse.AFFINE_UNIT_VALUES[index]
unit = AffineUnits.AFFINE_UNIT_VALUES[index]
error("Unit `$name` is already defined as `$unit`")
end
return :($update_affine_values($name_symbol, $expr))
Expand Down

0 comments on commit c94ffc9

Please sign in to comment.