-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Move map factory examples from reference to a how-to guide #6977
Conversation
These doctests have been marked as SKIP for a while but maybe we should unskip them... |
Do you want to do that here or shall we punt it later? |
I'll take a swing at it here. I think now that we're pulling apart the docs into different locations, ensuring the docs don't go stale is even more important. |
docs/how_to/create_a_map.rst
Outdated
>>> import sunpy.map | ||
>>> import sunpy.data.sample | ||
>>> my_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE) # doctest: +REMOTE_DATA | ||
>>> my_map = sunpy.map.Map('file.fits') # doctest: +SKIP | ||
>>> import pathlib | ||
>>> my_map = sunpy.map.Map(pathlib.Path('file.fits')) # doctest: +SKIP | ||
>>> sub_dir = pathlib.Path('local_dir/sub_dir') | ||
>>> mymap = sunpy.map.Map(sub_dir / 'another_file.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.
>>> import sunpy.map | |
>>> import sunpy.data.sample | |
>>> my_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE) # doctest: +REMOTE_DATA | |
>>> my_map = sunpy.map.Map('file.fits') # doctest: +SKIP | |
>>> import pathlib | |
>>> my_map = sunpy.map.Map(pathlib.Path('file.fits')) # doctest: +SKIP | |
>>> sub_dir = pathlib.Path('local_dir/sub_dir') | |
>>> mymap = sunpy.map.Map(sub_dir / 'another_file.fits') # doctest: +SKIP | |
>>> from pathlib import Path | |
>>> import sunpy.map | |
>>> import sunpy.data.sample | |
>>> my_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE) # doctest: +REMOTE_DATA | |
>>> my_map = sunpy.map.Map('file.fits') # doctest: +SKIP | |
>>> my_map = sunpy.map.Map(pathlib.Path('file.fits')) # doctest: +SKIP | |
>>> mymap = sunpy.map.Map(Path('local_dir/sub_dir') / 'another_file.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.
I'm not a fan of imposing this within the how-to or in sample code in general.
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.
Imposing what? I think having the different examples collected line after line as in the suggested change makes for easier reading.
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 agree placing the import statements above the code is preferable. I don't like the spacing requirements that we typically impose in the rest of the codebase.
docs/how_to/create_a_map.rst
Outdated
Directory containing FITS files | ||
--------------------------------- | ||
|
||
If there is more than one FITS file in the directory, this will return a list of Map objects. |
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.
We could use the sample data for this and some of the other examples below?
It would need to use some pathlib to get it work but could be useful?
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'm not opposed though I worry about cluttering up the example code too much.
a2d7fc3
to
84bd7e5
Compare
docs/how_to/create_a_map.rst
Outdated
>>> import sunpy.map | ||
>>> import sunpy.data.sample | ||
>>> my_map = sunpy.map.Map(sunpy.data.sample.AIA_171_IMAGE) # doctest: +REMOTE_DATA | ||
>>> my_map = sunpy.map.Map('file.fits') # doctest: +SKIP | ||
>>> import pathlib | ||
>>> my_map = sunpy.map.Map(pathlib.Path('file.fits')) # doctest: +SKIP | ||
>>> sub_dir = pathlib.Path('local_dir/sub_dir') | ||
>>> mymap = sunpy.map.Map(sub_dir / 'another_file.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.
Imposing what? I think having the different examples collected line after line as in the suggested change makes for easier reading.
Fixes #6905