JuliaPhysics / JuliaPhysics/Unitful.jl
Function to simplify units, e.g. m/ft -> dimensionless
- Dominant language
- Julia
- Stars
- 675
- Forks
- 124
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 1
Description
@ajkeller34, unless I'm mistaken, the following functionality (`simplify`) does not yet exist. Happy to try and implement it if it doesn't:
``` Julia
notsosimple = 1u"m/ft*kg"
simple = simplify(notsosimple)
@assert units(simple) === units(1u"kg")
```
It should be possible to determine which unit to use of m or ft, the same way it is done for +, via`promote_type`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by examining the existing arithmetic behavior that uses promote_type, then trace where a simplify entry point would fit. The issue's example defines the expected result: simplifying 1u"m/ft*kg" should leave the compatible mass unit and produce units equivalent to 1u"kg"; add coverage for that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100