You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For gallery examples, it usually makes sense to split a long script into multiple blocks using block separators. The Sphinx-Gallery package supports three different "block separators/splitters"
more than 20 # characters, i.e., ###################################################
For gallery examples, it usually makes sense to split a long script into multiple blocks using block separators. The Sphinx-Gallery package supports three different "block separators/splitters"
#
characters, i.e.,###################################################
# %%
#%%
Reference: https://sphinx-gallery.github.io/stable/syntax.html#embed-rest-in-your-example-python-files
The separator
#%%
will always be formatted to# %%
byblack
, following PEP-8 convention, so this kind of separator can be ignored.Currently, we use the
#
separator in our gallery examples (e.g., https://github.com/GenericMappingTools/pygmt/blob/main/examples/gallery/maps/tilemaps.py). I propose to use# %%
instead.The main reason is that
# %%
is also supported by Visual Studio Code and other editors/IDEs (see https://code.visualstudio.com/docs/python/jupyter-support-py#_jupyter-code-cells), making Python scripts working like Jupyter Notebooks. The# %%
also can save us a lot of keystrokes.The text was updated successfully, but these errors were encountered: