-
Notifications
You must be signed in to change notification settings - Fork 468
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
string formatting guide #1375
string formatting guide #1375
Conversation
@keewis I enabled |
indeed. You should have gotten a message from github requesting the access. If so, we should be able to close/reopen this to see the effect. Let's try: |
I don't see it in the status. I am checking if the webhook is ok |
for reference, here's the docs on that feature: https://docs.readthedocs.io/en/stable/pull-requests.html |
Somehow there has not been |
it's there now! Thanks! |
Just for the record, the read the docs documentation instructs to enable the webhook for |
@keewis We also need to check that the visibility of the generated docs are fine. ping me to let me know if something is not ok. |
Not sure if I understand this correctly. Could you elaborate? Edit: the build currently fails because of an issue with |
Ohh, when I was going to link to a reference I found ( |
This preview feature is great! How about dividing the index? It seems too crowded. This is a proposal
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be ready for a review. I'd especially be interested in the opinions of people learning about string conversion in pint
for the first time, since that's the best way for me to find things I wrongly assumed to be common knowledge.
Not sure if you still fit in that category, but: cc @TomNicholas, @jbusecke
Edit: I just noticed that the introduction for unit format specs is not easy to read... I'll fix that.
"IPython.sphinxext.ipython_directive", | ||
"IPython.sphinxext.ipython_console_highlighting", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like the ipython
sphinx extension a lot (I think it's cleaner than the doctest
directive). If desired, I can also open a new PR converting our current use of the doctest
directive (and code blocks, where appropriate) to that, which might allow us to use pytest
to run the doctests in the docstrings.
u.default_format = "" # TODO: switch to None | ||
ureg.default_format = "" # TODO: switch to None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this PR is merged before #1371, I can do that there
now that the last issue is resolved this should be ready for a final review |
Hi @keewis , I just read the proposed formatter docs: I found them great! Maybe something like adding "(see also the related |
they actually do different things, despite their naming: I guess we should try to make the naming more distinct (maybe rename Edit: in any case, thanks for the review |
@keewis you are right! I was still confused even after a not-so-quick read (but the blame is on me, not on the text! ) |
well, texts can be written in a way that is less misleading, even if the reader is less attentive. I will try to see if I can make the difference a bit more visible. |
@keewis I'm gonna merge this. |
As expressed in #1357, the tutorial does not cover everything on the formats (nor should it!) and that section is pretty difficult to find when trying to look up the available formats (also, I didn't know where to put the
register_*_format
functions)Edit: maybe we should add a
show_formats
function together with theregister_*_format
functions?The
Quantity
formatting is still left because I don't yet know enough about that.@hgrecco, RTD has a pretty neat PR preview feature which can be enabled through the admin settings. Could you enable this?
pre-commit run --all-files
with no errors