Simplify classifying ERFA function arguments in Argument.inout_state#255
Merged
Conversation
Some of the ERFA C function arguments are only read from (`pyerfa` calls
these "in" arguments), others are only written to ("out" arguments) and
some are both read from and written to ("inout" arguments). Because it
is impossible to tell how an argument is used from a C function's
declaration, the `FunctionDoc` class in `erfa_generator` has to parse
the doc comments to perform the classification.
In two ERFA functions an argument is meant to be a struct with some
fields that are only read from and others that are only written to. For
`pyerfa` it is an "inout" argument, but the ERFA doc comments list it as
both an "in" and an "out" argument, not as an "inout" argument.
`FunctionDoc` has so far dealt with this by merging "inout" arguments
with both "in" and "out" arguments and the `Argument.inout_state`
property has had to disentangle them. Now `FunctionDoc` keeps all three
argument categories separate and the two unusual ERFA functions are
handled explicitly. Most importantly their names are now written down,
which makes it much simpler to look up why there is a special case for
them.
avalentino
approved these changes
May 26, 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.
Some of the ERFA C function arguments are only read from (
pyerfacalls these "in" arguments), others are only written to ("out" arguments) and some are both read from and written to ("inout" arguments). Because it is impossible to tell how an argument is used from a C function's declaration, theFunctionDocclass inerfa_generatorhas to parse the doc comments to perform the classification.In two ERFA functions an argument is meant to be a struct with some fields that are only read from and others that are only written to. For
pyerfait is an "inout" argument, but the ERFA doc comments list it as both an "in" and an "out" argument, not as an "inout" argument.FunctionDochas so far dealt with this by merging "inout" arguments with both "in" and "out" arguments and theArgument.inout_stateproperty has to disentangle them. In this PRFunctionDockeeps all three argument categories separate and the two unusual ERFA functions are handled explicitly. Most importantly their names are written down, which makes it much simpler to look up why there is a special case for them.