We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f602b9 commit 7daa0e2Copy full SHA for 7daa0e2
src/systems/unit_check.jl
@@ -43,6 +43,18 @@ function __get_unit_type(vs′...)
43
return nothing
44
end
45
46
+
47
+function screen_unit(result::DQ.AbstractQuantity)
48
+ d = DQ.dimension(result)
49
+ if d isa DQ.Dimensions
50
+ return result
51
+ elseif d isa DQ.SymbolicDimensions
52
+ return DQ.uexpand(oneunit(result))
53
+ else
54
+ throw(ValidationError("$result doesn't have a recognized unit"))
55
+ end
56
+end
57
58
function screen_unit(result)
59
throw(ValidationError("$result doesn't have any unit."))
60
0 commit comments