-
-
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
basic code example and links to Spectrum1D.write #1017
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1017 +/- ##
=======================================
Coverage 70.03% 70.03%
=======================================
Files 64 64
Lines 4339 4339
=======================================
Hits 3039 3039
Misses 1300 1300 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
docs/spectrum1d.rst
Outdated
----------------- | ||
|
||
Similarly, a `~specutils.Spectrum1D` object can be saved to any file format supported by | ||
:class:`~astropy.nddata.CCDData` via the :meth:`specutils.Spectrum1D.write` method. |
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.
Why is CCDData involved here?
specutils/specutils/spectra/spectrum1d.py
Line 20 in 25cb121
class Spectrum1D(OneDSpectrumMixin, NDCube, NDIOMixin, NDArithmeticMixin): |
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.
It comes from NDIOMixin whose API docs state CCDData 🤷
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 NDIOMixin used CCDData as an example of implementation using the mixin. I don't think specutils has anything to do with CCDData.
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, would you rather that I just point directly to NDIOMixin then, or nothing at all and just leave the link to the API docs which inherits from NDIOMixin API?
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.
Why not link to https://specutils.readthedocs.io/en/latest/spectrum1d.html#reading-from-a-file (with ref
)? (The table has a "write" column.)
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.
that is immediately before this sub-section, so I'll just update the text to mention "supported formats".
docs/spectrum1d.rst
Outdated
>>> from specutils import Spectrum1D | ||
>>> spec1d = Spectrum1D.read("/path/to/input.fits") # doctest: +SKIP |
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.
Do we really need this? Reading is already covered in https://specutils.readthedocs.io/en/stable/spectrum1d.html#reading-from-a-file
>>> from specutils import Spectrum1D | |
>>> spec1d = Spectrum1D.read("/path/to/input.fits") # doctest: +SKIP |
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.
Should the snippets be somewhat standalone or is it ok to assume at this point that the user already has a spectrum1D
object loaded/created?
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.
Depends on who you ask. 😆
You can ref
back to the "reading" section if you want, but I think it is overkill to tell people how to read again.
Maybe also want to link to https://specutils.readthedocs.io/en/stable/custom_loading.html#creating-a-custom-writer (using ref)? |
15791c1
to
c7e657a
Compare
c7e657a
to
19c8923
Compare
19c8923
to
bded1d7
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.
LGTM now. Thanks!
No need to wait for CI. This just touch doc without doctest.
This PR adds a very brief example of how to use
Spectrum1D.write
and links to the API docs within the main spectrum1d landing page on the docs.See rendered docs from this PR