Git Product home page Git Product logo

Comments (7)

jkrumbiegel avatar jkrumbiegel commented on June 11, 2024 1

Yes, this could just mention that conversion is only defined for non-symbolic, and mention uexpand:

julia> convert(Unitful.Quantity, DynamicQuantities.us"s")
ERROR: type NamedTuple has no field s

from dynamicquantities.jl.

MilesCranmer avatar MilesCranmer commented on June 11, 2024

Thanks. I guess it just needs a uexpand if it's a SymbolicDimensions input?

from dynamicquantities.jl.

jkrumbiegel avatar jkrumbiegel commented on June 11, 2024

Yes that's what I did as well. I wasn't sure if that would be fit for the "official" implementation due to the changes in numbers when converting to non symbolic

from dynamicquantities.jl.

MilesCranmer avatar MilesCranmer commented on June 11, 2024

I think it would be perhaps too complicated to test that all ~120 or so symbols map to the correct Unitful versions, so despite this indeed changing the numerical value, I think it’s okay. Also the conversion utility was made before the units module was added here, I think it has less use now as you can just do everything in DynamicQuantities. Wdyt?

from dynamicquantities.jl.

jkrumbiegel avatar jkrumbiegel commented on June 11, 2024

I'm using this for testing that results match our previous Unitful implementation, but they already don't 100% match because once in a while floating point results change slightly. I guess that is expected when different instructions are being used sometimes by the compiler. So as I'm only asserting approximate equality, the conversion to non-symbolic seems not to matter in practice, my tests at least still pass. Maybe then this should just throw an error and explain what's going on, instead of the bug that you get now.

from dynamicquantities.jl.

MilesCranmer avatar MilesCranmer commented on June 11, 2024

I see, that makes sense.

By error do you mean the conversion step should give an error on symbolic dimensions input?

from dynamicquantities.jl.

MilesCranmer avatar MilesCranmer commented on June 11, 2024

That sounds good to me. If I can find some time soon I can add it, but someone else who is interested could add it and I can merge.

from dynamicquantities.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.