-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
DOC: Integrate the content of the "/examples" directory into docs [Issue #396] #443
Conversation
Thank you so much, this is a great improvement. Could you please cull the |
Yes, you can see in the changed files. In each file I have written comments about what part I exactly integrated into the registry docs (lines are given), what I think are unnecessary. I would not delete them right now, once everyone reviewing this PR agree, I will delete the files. In my opinion, all these 4 files can thus be deleted. For the 'auth/' folder I am not sure what to do with them, as well as for the 'serialquery.py'. |
@chmmao - thank you for picking this up! I'm not sure what to do about the things in As for |
examples/images/ex_get_cutouts.py
Outdated
@@ -24,3 +24,7 @@ | |||
for image in results: | |||
print("Downloading %s..." % name) | |||
image.cachedataset(filename="NVSSimages/%s.fits" % name) | |||
|
|||
# This file can be deletd |
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.
Please do delete the file (and the other similar ones, especially the notebooks) instead of commenting in it. The ultimate aim is to get rid of the examples
directory altogether.
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.
Ok sure, they are deleted now.
If they are expected to work, then yes, move them to the documentation with turning off testing. Keeping the |
Thanks for the review and for the suggestion you made:
I wonder which docs section should I move them to? |
Practically you've already moved the content, I mean we should not keep notebook files anywhere in this repo. |
docs/registry/index.rst
Outdated
.. doctest-remote-data:: | ||
|
||
>>> import pyvo as vo | ||
>>> from astropy.coordinates import SkyCoord | ||
|
||
>>> import warnings | ||
>>> warnings.filterwarnings('ignore', module="astropy.io.votable.*") | ||
|
||
>>> archives = vo.regsearch(servicetype='image', waveband='x-ray') | ||
>>> pos = SkyCoord.from_name('Cas A') | ||
>>> len(archives) # doctest: +IGNORE_OUTPUT | ||
33 |
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.
For example, this example generates a CI test failure, as due to the empty lines it is picked up as 3 separate examples and remote-data only added for the first one.
I would suggest to add >>>
in the empty lines as well, so eventually everything stays as one example.
.. doctest-remote-data:: | |
>>> import pyvo as vo | |
>>> from astropy.coordinates import SkyCoord | |
>>> import warnings | |
>>> warnings.filterwarnings('ignore', module="astropy.io.votable.*") | |
>>> archives = vo.regsearch(servicetype='image', waveband='x-ray') | |
>>> pos = SkyCoord.from_name('Cas A') | |
>>> len(archives) # doctest: +IGNORE_OUTPUT | |
33 | |
.. doctest-remote-data:: | |
>>> import pyvo as vo | |
>>> from astropy.coordinates import SkyCoord | |
>>> | |
>>> import warnings | |
>>> warnings.filterwarnings('ignore', module="astropy.io.votable.*") | |
>>> | |
>>> archives = vo.regsearch(servicetype='image', waveband='x-ray') | |
>>> pos = SkyCoord.from_name('Cas A') | |
>>> len(archives) # doctest: +IGNORE_OUTPUT | |
33 |
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.
Thank you so much! I was wondering why it did not work since the code seem to be fine and docktest
runs pretty well locally. Now the issue is fixed.
Codecov Report
@@ Coverage Diff @@
## main #443 +/- ##
=======================================
Coverage 79.98% 79.98%
=======================================
Files 52 52
Lines 6036 6036
=======================================
Hits 4828 4828
Misses 1208 1208 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Please squash the example changing commits out from the commits, and fix the servicetype table, or let me know if you want me to do it.
Otherwise all looks good. Thank you!
docs/registry/index.rst
Outdated
|
||
===== ====================================== | ||
sia Simple Image Access (SIA) services | ||
ssa Simple Spectral Access (SSA) services |
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.
Even if the aliases are dismissed from this list, do add sia2
to this table.
or maybe, instead link to the class docs ( as ~pyvo.registry.Servicetype
) that has the list (e.g. eliminate the need to maintain such a list at two places).
docs/registry/index.rst
Outdated
|
||
.. doctest-remote-data:: | ||
|
||
>>> for service in archives: # doctest: +ELLIPSIS |
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 suspect this should all work without the ELLIPSIS (as it should be opted in by default). If it's not, then it's an issue to be opened and followed-up.
docs/registry/index.rst
Outdated
|
||
.. doctest-remote-data:: | ||
|
||
>>> cats = vo.regsearch(keywords=['blazar','Fermi']) |
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.
Some style fixes are needed for the example, nothing serious, but adding and removing a few whitespaces here and there. I'm happy to do such fixes before merging.
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 am very sorry for replying after such a long time, I have not been focusing on GitHub for a while. I have made changes such as:
- use the
~pyvo.registry.Servicetype
link for the parameters - some whitespaces fixes.
For this one:
.. doctest-remote-data::
for service in archives: # doctest: +ELLIPSIS
I used ELLIPSIS
because the output is a very long list of services, I just took the first three of them as examples. I don't think without ELLIPSIS
it would pass the test.
And... I tried to rebase/squash all commits into one, and somehow the result does not look like what I wanted. But the overall changes are still there, I would appreciate if you could help me here. :)
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.
Re ELLIPSIS:
it should work as we enable it by default. If it doesn't then something in our doctest config went wrong, so I'll double check it.
And... I tried to rebase/squash all commits into one, and somehow the result does not look like what I wanted. But the overall changes are still there, I would appreciate if you could help me here. :)
Yeap, will do that (and will post the commands I use here, so you can check which one you did differently). Thanks for trying, and thanks for the rest of the fixes.
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.
Re rebase, here is the big picture and the copy paste of what I see in my local setup:
- locally you need the clone of astropy, and your fork, check it with
git remote -v
- fetch to update the remotes
- rebase
- push back to your remote branch.
$ git remote -v
astropy git@github.com:astropy/pyvo (fetch)
astropy git@github.com:astropy/pyvo (push)
bsipocz git@github.com:bsipocz/pyvo (fetch)
bsipocz git@github.com:bsipocz/pyvo (push)
chmmao git@github.com:chmmao/pyvo (fetch)
chmmao git@github.com:chmmao/pyvo (push)
$ git fetch --all --prune
Fetching bsipocz
Fetching astropy
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (1/1), 660 bytes | 660.00 KiB/s, done.
From github.com:astropy/pyvo
b96a950..feda0f0 main -> astropy/main
Fetching chmmao
$ git rebase -i astropy/main
# editor comes up, do the commit reorders, squashes, removal of duplicates (if there is any from a previous rebase, etc). Note that we rebase on astropy/main and not on the main of your fork
#
# When rebase is finished (you may need to do a bunch of git rebase --continue, etc., push it back.
$ git push chmmao HEAD:integrate_examples --force
# note about the --force, it's needed as you overwrite the branch
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.
Thank you so much! Good to know how to do that properly.
ebb99ea
to
6cf2c3f
Compare
delete useless texts
… the narrative docs
6cf2c3f
to
469c56a
Compare
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.
Thank you @chmmao for this cleanup, I'm so glad to see the examples directory is gone and the content is now actually tested and exposed in the user documentation.
Greetings,
This PR aims to address the issue #396.
I tried to integrate the examples shown in the
examples
directory into the docs forregistry
.Not everything is integrated but I have chosen the most important ones in my opinion.
Hopefully it would resolve (partly) the issue, I am glad to hear improvements and potential mistakes.