Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use a Fortran function as argument to a Python method? #20

Open
asandrock opened this issue Feb 29, 2020 · 1 comment
Open

How to use a Fortran function as argument to a Python method? #20

asandrock opened this issue Feb 29, 2020 · 1 comment

Comments

@asandrock
Copy link

Suppose I have written a function in Fortran depending on some parameters I want to fit to data with scipy.optimize.curve_fit. How do I use this function as argument to a Python method?

I tried setitem with the function name and casting it to a Python object, but neither work in this case.

@ylikx
Copy link
Owner

ylikx commented Feb 29, 2020

You can write a Python extension module that contains a wrapper to your function (see readme). You can email me if you have questions about doing that. I do not know if it is possible to implement a simpler way in forpy, similar to what you tried, I'd have to think about it more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants