Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

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

@kmilo9999

Description

@kmilo9999
          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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions