Skip to content

Make addition of ephemeris note more obvious and explicit.#11594

Merged
StuartLittlefair merged 1 commit into
astropy:mainfrom
mhvk:solar-system-docstring-update
Apr 19, 2021
Merged

Make addition of ephemeris note more obvious and explicit.#11594
StuartLittlefair merged 1 commit into
astropy:mainfrom
mhvk:solar-system-docstring-update

Conversation

@mhvk

@mhvk mhvk commented Apr 18, 2021

Copy link
Copy Markdown
Contributor

A small change in how we add a note about the ephemeris to functions in solar_system. This is partially as currently, the docstrings give no indication that an addition is going to happen, which leaves oddly orphan "Notes" sections (which trip auto-checkers like the one in #11590). But I must admit I had hoped one could use f-strings for docstrings - sadly, this is not possible. Still, I think this PR makes things a little clearer.

Comment on lines +512 to +513
for f in [f for f in locals().values() if callable(f) and f.__doc__ is not None
and '{_EPHEMERIS_NOTE}' in f.__doc__]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also long wished python would allow for the comprehension syntax

for f in locals().values() if (...):
   ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the main reason I did the list comprehension there is that I cannot just iterate over locals.values() anyway (I guess since I define f). But yet, the comprehension syntax there would make things just a little more compact and less indented.

@StuartLittlefair StuartLittlefair merged commit 8615fc8 into astropy:main Apr 19, 2021
@StuartLittlefair

Copy link
Copy Markdown
Contributor

thanks @mhvk

@mhvk mhvk deleted the solar-system-docstring-update branch April 19, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants