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

I didn't notice this before either, but these functions (get_var, get_N, get_lat) are used in a map call and need updated data in each iteration. I am curious about what might be a faster approach. One could define more general functions outside of the loop and then pass the data that is needed using a [lambda expression](https://docs.python.org/3/reference/expressions.html#lambda:~:text=about%20conditional%20expressions.-,6.14.%20Lambdas%C2%B6,-lambda_expr%20%3A%3A%3D%20%20%22lambda%22%20%5B) or a [partial function](https://docs.python.org/3/library/functools.html#functools.partial). In all three approaches 3 functions are created in each iteration. Hard to say which is the fastest without profiling. #157

Open
kmilo9999 opened this issue Mar 4, 2024 · 0 comments

Comments

@kmilo9999
Copy link
Collaborator

          I didn't notice this before either, but these functions (`get_var`, `get_N`, `get_lat`) are used in a map call and need updated data in each iteration. I am curious about what might be a faster approach. One could define more general functions outside of the loop and then pass the data that is needed using a [lambda expression](https://docs.python.org/3/reference/expressions.html#lambda:~:text=about%20conditional%20expressions.-,6.14.%20Lambdas%C2%B6,-lambda_expr%20%3A%3A%3D%20%20%22lambda%22%20%5B) or a [partial function](https://docs.python.org/3/library/functools.html#functools.partial). In all three approaches 3 functions are created in each iteration. Hard to say which is the fastest without profiling.

Originally posted by @cpaniaguam in #132 (comment)

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

1 participant