-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add documentation for kwargs passed to reader+writer backends #1157
Conversation
32bd129
to
0ab2aad
Compare
I think we should add an entire section dedicated to headers with the best practices and caveats. The information you provided in a response to me is a great start. I think the section should also include an example of header round-tripping with
|
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 think we should add a section dedicated to headers.
That surprises me, certainly not by design on my part. I actually am not even sure where that's specified. |
The first intersphinx links, for astropy and gwcs, were using Lines 60 to 63 in f77c8df
so might be accidental. |
0ab2aad
to
5e168ba
Compare
5e168ba
to
5d057de
Compare
Yes, I think that would be a good follow up PR (i.e. for a future release) for someone with a good grasp of what are now considered best practices, maybe @simontorres? |
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.
Minor suggestions.
docs/spectrum1d.rst
Outdated
Conversely the two provided FITS writers are saving the contents of any | ||
``Spectrum1D.meta['header']`` (which should be an :class:`astropy.io.fits.Header` | ||
or any object like a `dict` that can instantiate one) as the header of the | ||
:class:`~astropy.io.fits.hdu.PrimaryHDU`. |
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.
Conversely the two provided FITS writers are saving the contents of any | |
``Spectrum1D.meta['header']`` (which should be an :class:`astropy.io.fits.Header` | |
or any object like a `dict` that can instantiate one) as the header of the | |
:class:`~astropy.io.fits.hdu.PrimaryHDU`. | |
The two provided FITS writers (`fits-tabular` and `wcs-fits`) save the contents of | |
``Spectrum1D.meta['header']`` (which should be an :class:`astropy.io.fits.Header` | |
or any object like a `dict` that can instantiate one) as the header of the | |
:class:`~astropy.io.fits.hdu.PrimaryHDU`. |
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 also add a link to the docstrings of the tabular_fits
and the wcs_fits
writers. I cant seem to find those currently included in the specutils docs. Maybe that's also a separate PR?
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've added the suggestions; there are no API docs to any of the loaders one could link to, and I am afraid this will be non-trivial to amend since they are dynamically loaded through the unified IO framework.
I suppose one could build upon _list_of_loaders
to then recursively call Spectrum1D.read.help(format)
from its list entries to generate a doc page of all the readers (and writers)...
As mentioned above the parsing_utils
functions are missing as well, but that should be more straightforward to fix; just don't know where to add the right hook for Sphinx. But those are more of interest for the Custom Loader documentation. Definitely more than enough stuff for another PR, or two.
Co-authored-by: Kelle Cruz <kellecruz@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1157 +/- ##
==========================================
+ Coverage 86.83% 86.87% +0.03%
==========================================
Files 63 63
Lines 4528 4541 +13
==========================================
+ Hits 3932 3945 +13
Misses 596 596 ☔ View full report in Codecov by Sentry. |
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.
Thanks again, LGTM.
Additional follow up to #1152 in response to #1152 (comment) – @kelle, those are generally backend options and thus depend on what interface the various loaders are using; I have completed the docstrings for the two FITS loaders to specifically point to that. Again, since these are not linked to the processed docs, I put a few examples into the narrative docs (might be preferable to link to the utility functions docs, but
parsing_utils
again are not included even in the API docs – would be useful to have them also for the custom loader section).I noticed that we are linking to the astropy-dev docs rather than stable, is this by design?