Code Monkey home page Code Monkey logo

Comments (3)

CalebBell avatar CalebBell commented on September 24, 2024 1

Hi Yoel,
Yes, it is an issue with pint. It is also an issue I have faced before. The solution I did before was to manually code a wrapper as can be seen for some functions in fluids: https://github.com/CalebBell/fluids/blob/master/fluids/units.py#L471
Nothing has been coded in chemicals yet about this issue. There are existing issues, like speed_of_sound which has two different types of outputs.
One option would be to only ever have a function return a fixed type. I don't find that user friendly/convenient. Too much documentation duplication and it's harder to remember function names.
After working with numba, it occurs to me that so long as the types of the inputs define what the types of the outputs are, it should be possible to write a general wrapper function, and manually write metadata about how to handle types in these cases (without writing new functions). I'm thinking a dictionary in units.py and some smarts in the units.py of fluids. It is an existing issue, but thank you for reminding me of the fact it hasn't gone away while I wasn't looking at it :)
Cheers,
Caleb

from chemicals.

yoelcortes avatar yoelcortes commented on September 24, 2024

Would this conflict with the support for pint Quantities?

from chemicals.

yoelcortes avatar yoelcortes commented on September 24, 2024

Thanks for the quick reply! I should be done with this soon, so I'll go ahead and close the issue.

from chemicals.

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.