Coder Social home page Coder Social logo

Comments (2)

prehner avatar prehner commented on June 3, 2024

Since we have to deal with this problem now anyways: Is there any way we can make the implementation of the Python FFI for the dual numbers more ergonomic? It's virtually impossible to make a Box<dyn DualNum<f64>> using a PyDualNumber<PyObject> and doing a (manually implemented) type check for every operation we have also seems unfeasible.

Aside from that the steps that you outline seem doable. Maybe expose ALL dual numbers that are created in the num-dual Python FFI and then in feos we can just build the States that we need. E.g., currently num-dual builds dual numbers with up to 10 derivatives but we would only need them for up to 2 in feos.

(For more than 10 derivatives backward AD should be seriously considered anyways)

from feos.

g-bauer avatar g-bauer commented on June 3, 2024

These are things to consider:

  1. which dual numbers do we generate Python bindings for?
  2. which do we actually export in a num-dual module (the Python package)

For feos we just have to make sure that all variants we need in HelmholtzEnergy are build and public in the python (Rust) module. But I agree, we should investigate if any improvements to the way we build the bindings can be made. This is, however, an issue for num-dual.

In feos, currently two macros are used. One implements the getters for the states that are at the moment defined manually, the second one implements the HelmholtzEnergy trait. It should be possible to do that all automatically given a list of dual numbers.

from feos.

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.