Logo
version: 2025.1
  • About
  • Documentation
  • Development
    • General Information
    • Possible Topics
    • Developer Guide
  • Gallery

Connections

  • News
  • Downloads
  • Source Code
  • Mailing list
  • Bug/issue tracking
  • The Paper
  • Docs: development
SfePy
  • Development
  • Developer Guide
  • tools/gen_gallery.py script
  • View page source

tools/gen_gallery.py script¶

Generate the images and rst files for gallery of SfePy examples.

The following steps need to be made to regenerate the documentation with the updated example files:

  1. remove doc/examples/*:

    $ rm -rf doc/examples/*
    
  2. generate the files:

    $ ./tools/gen_gallery.py

  3. regenerate the documentation:

    $ python setup.py htmldocs
    
gen_gallery.apply_view_options(views, default)[source]¶
gen_gallery.ebase2fbase(ebase)[source]¶
gen_gallery.generate_gallery(examples_dir, output_filename, doc_dir, rst_dir, thumbnails_dir, dir_map, n_col=3)[source]¶

Generate the gallery rst file with thumbnail images and links to examples.

Parameters:
output_filenamestr

The output rst file name.

doc_dirstr

The top level directory of gallery files.

rst_dirstr

The full path to rst files of examples within doc_dir.

thumbnails_dirstr

The full path to thumbnail images within doc_dir.

dir_mapdict

The directory mapping returned by generate_rst_files()

n_colint

The number of columns in the gallery table.

gen_gallery.generate_images(images_dir, examples_dir, pattern='*.py')[source]¶

Generate images from results of running examples found in examples_dir directory.

The generated images are stored to images_dir,

gen_gallery.generate_rst_files(rst_dir, examples_dir, images_dir, pattern='*.py')[source]¶

Generate Sphinx rst files for examples in examples_dir with images in images_dir and put them into rst_dir.

Returns:
dir_mapdict

The directory mapping of examples and corresponding rst files.

gen_gallery.generate_thumbnails(thumbnails_dir, images_dir, scale=0.3)[source]¶

Generate thumbnails into thumbnails_dir corresponding to images in images_dir.

gen_gallery.main()[source]¶
gen_gallery.resview_plot(filename, filename_out, options)[source]¶
gen_gallery.run_resview_plot(*args)[source]¶

A fix for the problem that calling resview_plot() directly often terminates the program.

Previous Next

© Copyright 2020, Robert Cimrman and SfePy developers.

Built with Sphinx using a theme provided by Read the Docs.