sffjunkie / astral

Python calculations for the position of the sun and moon.
Apache License 2.0
242 stars 47 forks source link

Add an Optional Argument to sun() Function to Return Only Specified Keys #85

Open qliu-bcs opened 1 year ago

qliu-bcs commented 1 year ago

Could we add an optional argument to the sun() function linked below for the users to specify key(s) to return? https://github.com/sffjunkie/astral/blob/3.2/src/astral/sun.py#L1232 https://github.com/sffjunkie/astral/blob/3.2/src/astral/location.py#L225

e.g. If only "sunrise" and "sunset" are needed, we have the option to skip "dawn", "noon", and "dusk" calculation.

This could potentially improve performance by skipping non-needed calculation(s).