Skip to content

Commit

Permalink
fix unit
Browse files Browse the repository at this point in the history
  • Loading branch information
vyudu committed Jan 17, 2025
1 parent 483c972 commit df0ee8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ setmisc(x, miscdata) = setmetadata(x, VariableMisc, miscdata)
Fetch the unit associated with variable `x`. This function is a metadata getter for an individual variable, while `get_unit` is used for unit inference on more complicated sdymbolic expressions.
"""
getunit(x) = Symbolics.getmetadata(x, VariableUnit, nothing)
getunit(x) = getunit(unwrap(x))
getunit(x::Symbolic) = Symbolics.getmetadata(x, VariableUnit, nothing)
"""
hasunit(x)
Expand Down

0 comments on commit df0ee8a

Please sign in to comment.