Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abbreviate type aliases in API #59

Closed
redeboer opened this issue Jan 18, 2022 · 2 comments
Closed

Abbreviate type aliases in API #59

redeboer opened this issue Jan 18, 2022 · 2 comments
Assignees
Labels
📝 Docs Improvements or additions to documentation

Comments

@redeboer
Copy link
Member

redeboer commented Jan 18, 2022

Signatures that use type aliases look rather ugly in the existing APIs of QRules, AmpForm, and TensorWaves.
image

This can be fixed with autodoc_type_aliases. The problem though, is that this requires from __future__ import annotations, which is only available in Python >3.7. Alternatively, type aliases can be abbreviated by making the signatures strings, as was done (by accident due to OrderedDict) here:

image

See also #58

@redeboer redeboer self-assigned this Jan 18, 2022
@redeboer redeboer changed the title Abbreviate signatures with Sphinx Abbreviate type aliases in API Jan 18, 2022
@redeboer redeboer added the 📝 Docs Improvements or additions to documentation label Jan 18, 2022
@redeboer
Copy link
Member Author

Done for AmpForm and TensorWaves (ComPWA/ampform#207 and ComPWA/tensorwaves#404). QRules still proved problematic, but this may improve once Sphinx v4.5.0 is out (ComPWA/qrules#156 (comment)).

@redeboer redeboer transferred this issue from ComPWA/compwa.github.io Apr 25, 2022
@redeboer
Copy link
Member Author

redeboer commented Dec 5, 2023

Works well, see e.g. https://ampform.readthedocs.io/en/0.14.x/api/ampform.dynamics.html#ampform.dynamics.EnergyDependentWidth. For QRules, this will be automatically addressed through ComPWA/.github#5 once it drops support for Python 3.6.

@redeboer redeboer closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 Docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant