Rename 'Attributes' to 'Parameters' to fix documentation formatting #2901
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.
With the addition of method-based attribute setting in #2795, Sphinx started generate the documentation differently for the encoding channels. The documentation for attributes is now the first sentence of the documentation which is defined by
_PropertySetter
:This is much less informative then what is in the docstring of
altair.X
and which would be shown otherwise:I tried to disable this behavior but didn't find a way. However, I'd suggest to tackle the root cause of this directly instead of trying to reconfigure Sphinx. Following the numpydoc style for docstrings (see also
ExampleError
on this page), what is calledAttributes
in the Altair class docstrings should, in my understanding, be calledParameters
as we document what parameters can be passed to e.g.altair.X
and not what attributes it has after instantiation. As allParameters
usually also appear asAttributes
(with the exception of the ones which are now replaced by the property-based methods) this didn't matter much so far. I'd suggest to now introduce this distinction by replacingAttributes
withParameters
in the docstrings:After this change, the documentation renders again how it's supposed to: