{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/15394","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/15394/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/15394/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/15394/events","html_url":"https://github.com/JuliaLang/julia/pull/15394","id":139111607,"number":15394,"title":"RFC: Modifying base to play nicely with physical units","user":{"login":"ajkeller34","id":7145721,"avatar_url":"https://avatars.githubusercontent.com/u/7145721?v=3","gravatar_id":"","url":"https://api.github.com/users/ajkeller34","html_url":"https://github.com/ajkeller34","followers_url":"https://api.github.com/users/ajkeller34/followers","following_url":"https://api.github.com/users/ajkeller34/following{/other_user}","gists_url":"https://api.github.com/users/ajkeller34/gists{/gist_id}","starred_url":"https://api.github.com/users/ajkeller34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajkeller34/subscriptions","organizations_url":"https://api.github.com/users/ajkeller34/orgs","repos_url":"https://api.github.com/users/ajkeller34/repos","events_url":"https://api.github.com/users/ajkeller34/events{/privacy}","received_events_url":"https://api.github.com/users/ajkeller34/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-03-07T22:17:37Z","updated_at":"2016-03-08T20:41:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/15394","html_url":"https://github.com/JuliaLang/julia/pull/15394","diff_url":"https://github.com/JuliaLang/julia/pull/15394.diff","patch_url":"https://github.com/JuliaLang/julia/pull/15394.patch"},"body":"I'm interested and personally invested in getting Julia to support physical units. There are some places in base that could be modified to suppress the numerous override warnings that appear when using my physical unit package for Julia 0.5.0-dev, [Unitful.jl](https://github.com/ajkeller34/Unitful.jl). Advertisements aside, I believe some changes to base are going to be necessary for any units package that fully supports Ranges (`UnitRange`, `FloatRange`, etc.) to have a chance of integrating with Julia without emitting warnings. Here's a TL;DR version: `one(x)` is not logically the same as `oftype(x,1)` when working with quantities that have units (`one(x)` is defined as the multiplicative identity, which should not have units!), and sometimes we need to strip units for certain numerical operations and comparisons. This is especially obvious in `range.jl`.\r\n\r\nEncouraged by @StefanKarpinski in this [julia-users thread](https://groups.google.com/d/msg/julia-users/BT4bP5VyaRY/e3xdTRgsAgAJ), here are some changes to base I'd appreciate having comments on. The change to `complex.jl` is not as important as the changes to `number.jl` and `range.jl`. I built Julia using a few-day-old version of master and find no test regressions with my modifications. I could use some help with benchmarking, however. This is my first PR for Julia and while I have read the guidelines for contributions, please advise if I should be doing something differently.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/193958606","html_url":"https://github.com/JuliaLang/julia/pull/15394#issuecomment-193958606","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/15394","id":193958606,"user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T20:41:45Z","updated_at":"2016-03-08T20:41:45Z","body":"@ajkeller34: to elaborate on my testing proposal, I meant that we should have bare bones types that mimic relative and absolute unit quantities enough to make sure that the code in Base is doing what it should with respect to them. Otherwise changes will keep getting made accidentally in Base that will break Unitful. Unitful can do more thorough testing of actual unit functionality, of course."}}