Git Product home page Git Product logo

Comments (3)

ajkeller34 avatar ajkeller34 commented on June 10, 2024

Probably this just means we should reconsider if numerals are allowed in u_str. The 1 is passing through, making it a quantity and not a unit, and uconvert (I think naturally) expects you to convert to a unit, not a quantity. Will reference in #23.

from unitful.jl.

ajkeller34 avatar ajkeller34 commented on June 10, 2024

I guess "passing through" is not quite correct; rather there is no check to see that the result will indeed be a unit and not a quantity.

from unitful.jl.

ggggggggg avatar ggggggggg commented on June 10, 2024

That makes sense. When I wrote Physical.jl (my attempt at units) I let the left argument of as (equivalent of uconvert) be a quantity, but it just ignored the value. I was never sure that this was a good idea or not, but it does solve this issue. Probably a better error message would be in order so that it was something like:

julia> uconvert(u"1/cm^2",1u"fs*W/(eV*cm^2)")
ERROR: UConvertError: The first argument to uconvert must be a Unitful.Unit, you passed a Quantity.

from unitful.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.