SunPy
  • About
    • Our Mission
    • Acknowledge SunPy
    • Code of Conduct
  • Documentation
    • sunpy
    • ndcube
    • aiapy
    • drms
    • pfsspy
    • radiospectra
    • sunkit-instruments
    • sunkit-image
    • sunraster
    • sunpy-soar
    • roentgen
  • Blog
  • Support Us
  • Get Help
  • SunPy Project
    • SunPy Project
    • Community Roles
    • Affiliated Packages
    • Meetings

SunPy 4.1.dev1059+gfbf307b00

  • The sunpy tutorial
  • Installation
  • Example Gallery
  • Guides
  • Reference
  • Release History
  • Acknowledging or Citing SunPy
  • Known Issues
  • Current status of sub-packages
  • Developer’s Guide
    • Newcomers’ Guide
    • Pull Request Check List
    • Using conda for Development Dependencies
    • Coding Standards
    • Testing Guidelines
    • Documentation
    • Example Gallery
      • Contribution Guidelines
    • Pull Requests and GitHub Teams
    • Use of quantities and units
    • Workflow for Maintainers
    • Dependency Support Policy
    • What runs on our Continuous Integration
    • Making Changes to Released Versions
    • Submodule and funding
    • sunpy’s Public API
    • Extending Fido with New Sources of Data
    • Logging, Warnings, and Exceptions
    • Creating new sunpy Subclasses (Maps, TimeSeries)
    • Remote Data Manager
    • Adding a new rotation method

Example Gallery¶

The purpose of the page is to describe the contribution guidelines for the sunpy Example Gallery.

All potential contributors to the sunpy example gallery should read and abide by the following guidelines.

Contribution Guidelines¶

  • The title of the example should be short yet descriptive and emphasize the goal of the example. Try to make the title appeal to a broad audience and avoid referencing a specific instrument, catalog, or anything wavelength dependent.

  • Each example should begin with a paragraph that gives a brief overview of the entire example, including relevant astronomy concepts, and motivates the described functionality.

  • The examples must be compatible with the versions supported by the last major release of the sunpy core package.

  • All the examples must be fully PEP8 compliant, the pre-commit hook should be used to ensure this.

  • Wherever possible, the examples should include linked references with links pointing to the appropriate DOI or ADS entry.

  • The example should include links (URL or sphinx intersphinx) to relevant documentation pages.

  • Each example should, where possible, include at least one image, map, or plot to use as the icon in the example gallery.

  • The examples should avoid using acronyms without defining them first (e.g. Virtual Solar Observatory, or VSO). Similarly complex jargon should be avoided unless clearly explained.

  • There should be a good variety of examples for each section (simple and more complex to cater for different levels).

  • When creating a plot, particularly of a map, the example should follow these rules of thumb to minimize verbosity and maintain consistency with the other gallery examples:

    • Do not use peek in examples. Instead, use plot.

    • Always create a figure instance using plt.figure() prior to creating a plot.

    • Only create an axes instance if it is explicitly needed later in the example (e.g. when overplotting a coordinate on a map using ax.plot_coord).

    • If an axes instance is created, it should be explicitly passed as a keyword argument wherever possible (e.g. in plot or draw_grid).

    • At the end of the example, call plt.show(). While not explicitly needed for the gallery to render, this ensures that when run as a script, the plots will appear.

    • If you need to use astropy.visualization.{quantity_support, time_support}, import these functions at the top of the example, and call them directly before the first plot that needs them.

Note

We have an example template located at sunpy/examples/example_template/example_template.py.

© 2023, The SunPy Community

Built with Sphinx 5.3.0.
GitHub • Twitter • Chat