@@ -384,6 +384,32 @@ def setup(app):
384384# https://github.com/pvlib/pvlib-python/issues/837
385385suppress_warnings = ['ref.footnote' ]
386386
387+
388+ def irradiance_transposition_sort_key (filename ):
389+ order = [
390+ "plot_ghi_transposition.py" ,
391+ "plot_transposition_gain.py" ,
392+ "plot_interval_transposition_error.py" ,
393+ "use_perez_modelchain.py" ,
394+ "plot_mixed_orientation.py" ,
395+ "plot_seasonal_tilt.py" ,
396+ "plot_rtranpose_year.py" ,
397+ "plot_rtranpose_limitations.py" ,
398+ ]
399+
400+ subsection = os .path .basename (os .path .dirname (filename ))
401+
402+ if subsection == "irradiance-transposition" :
403+ name = os .path .basename (filename )
404+ if name in order :
405+ return (0 , order .index (name ))
406+ else :
407+ return (0 , len (order ))
408+
409+ # For everything else, fall back to filename sorting
410+ return (1 , filename )
411+
412+
387413# settings for sphinx-gallery
388414sphinx_gallery_conf = {
389415 'examples_dirs' : ['../../examples' ], # location of gallery scripts
@@ -400,6 +426,9 @@ def setup(app):
400426
401427 # https://sphinx-gallery.github.io/dev/configuration.html#removing-config-comments # noqa: E501
402428 'remove_config_comments' : True ,
429+
430+ # Explicit ordering for irradiance-transposition subsection
431+ 'within_subsection_order' : irradiance_transposition_sort_key ,
403432}
404433# supress warnings in gallery output
405434# https://sphinx-gallery.github.io/stable/configuration.html
0 commit comments