Fix doc comment pre-processing in erfa_generator#238
Merged
avalentino merged 1 commit intoliberfa:mainfrom May 1, 2026
Merged
Conversation
There are small peculiarities in the `eraLdn()` and `eraAticqn()` doc comments which are removed in a pre-processing step. However, the pre-processing has not been specific enough, so it has also made unintentional changes to doc comments of several other functions. As a result the docstrings of the Python wrappers that are supposed to include a copy of the C doc comments have been erroneously documenting most pointers as their targets instead. Additionally, the affected lines tended to become misaligned. Now the pre-processing is much more specific, which fixes the Python docstrings.
eerovaher
commented
May 1, 2026
| def __init__(self, doc): | ||
| self.doc = doc.replace("**", " ").replace("/*\n", "").replace("*/", "") | ||
| self.doc = self.doc.replace("/*+\n", "") # accommodate eraLdn | ||
| self.doc = self.doc.replace("* ", " " * 2) # accommodate eraAticqn |
Contributor
Author
There was a problem hiding this comment.
This line is the main culprit. It replaces the substring "* " with " " anywhere within the doc comment of any function, but should only replace the beginnings of two lines in the eraAticqn() doc comment.
avalentino
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are small peculiarities in the
eraLdn()anderaAticqn()doc comments which are removed in a pre-processing step. However, in currentmainthe pre-processing is not specific enough, so it also makes unintentional changes to doc comments of several other functions. As a result the docstrings of the Python wrappers that are supposed to include a copy of the C doc comments erroneously document most pointers as their targets instead. Additionally, the affected lines tend to become misaligned. This PR makes the pre-processing much more specific, which fixes the generated Python docstrings.The difference between
erfa/core.pygenerated by currentmainand this PR is