Config Editor

Complete: 5
Detailed Review status

Introduction

The Config Editor is a tool for browsing and editing of Python configuration files in CMSSW. It allows

  • Browsing:
    • Visualize the complete structure of a Config File and all included config files (via import)
    • Inspect the parameters of modules
    • Track which modules use input from which other modules
    • Track in which file certain modules can be found
    • Open the definition of certain modules in the user's favorite editor

  • Editing:
    • Create user configuration files which start from some standard configuration (e.g. PAT) and contain all changes to it.
    • Modify parameters of modules
    • Apply tools (e.g. PAT tools)

If you are looking for a quick introduction to ConfigEditor, have a look at the WorkBookConfigEditor. Note that the Config Editor is not designed to debug python related errors in Python Config files. Therefore see SWGuidePythonTips, SWGuideAboutPythonConfigFile.

If you are interested in tracking the history of a configuration file (e.g. which parameters were replaced at some point), have a look at the SWGuideConfigHistory.

Feel free to contact AndreasHinzmann for feedback and suggestions!

Getting started

Set up CMSSW and run ConfigEditor

  • CMSSW >=4_1_X:
    setenv SCRAM_ARCH slc5_amd64_gcc434
    cmsrel CMSSW_4_1_6
    cd CMSSW_4_1_6/src
    cmsenv
    edmConfigEditor

  • If you are running remotely (via ssh -Y):
    edmConfigEditorSSH

Older releases:

  • CMSSW >=3_8_2:
    cmsrel CMSSW_3_8_2
    cd CMSSW_3_8_2/src
    cmsenv
    edmConfigEditor
  • CMSSW >=3_5_4
    cmsrel CMSSW_3_5_4
    cd CMSSW_3_5_4/src
    cmsenv
    edmConfigEditor
    If you have freeze problems using edmConfigEditor over ssh, use this recipe:
    addpkg FWCore/GuiBrowsers V00-00-38
    scram b
  • CMSSW 3_1_1 - 3_5_3 PAT tools are not yet supported. All other functionality is in place.
    cmsrel CMSSW_3_1_1
    cd CMSSW_3_1_1/src
    cmsenv
    addpkg FWCore/GuiBrowsers V00-00-38
    scram b
    edmConfigEditor
  • CMSSW 2_1_X - 3_1_1 Only browsing functionality in place. No editing of configuration possible. The name of the tool is edmConfigBrowser.
  • Set up CMSSW(>=2_1_X) environment:
    cmsrel CMSSW_2_1_17
    cd CMSSW_2_1_17/src
    cmsenv
  • Download latest version (0.3.2) of ConfigBrowser from AFS (tgz-file, 20 MB):
    cp /afs/cern.ch/user/h/hinzmann/www/web/ConfigBrowser.tgz .
    or from website http://cern.ch/test-configbrowser/ConfigBrowser.tgz.
  • Extract (total size 54 MB) and run ConfigBrowser:
    tar -xzf ConfigBrowser.tgz
    cd ConfigBrowser
    ./edmConfigBrowser

Browsing configuration files

  • Browse an example file:
    • Check out an example from PAT:
      cvs co PhysicsTools/PatAlgos/test/patLayer1_fromAOD_full_cfg.py
    • Open the configuration file via menu File -> Open... or via commandline:
      edmConfigEditor PhysicsTools/PatAlgos/test/patLayer1_fromAOD_full_cfg.py
      browsing.png

    • Select an object in the Tree View -> The content is displayed in the Connection Structure
    • Select an object in the Connection Struture -> All parameters are displayed in the Property View
    • Double-click an object in the Connection Struture -> The object with all its dependecies is displayed in the Connection Structure

  • Inspect configuration files using your favorite editor
    • Select your favorite editor in the menu Config -> Choose editor... (e.g. type emacs)
    • Select an object and open the config file in which the selected object is defined via menu Config -> Open editor...
      Warning, important If you edit configuration files, you modify the default settings in your project CMSSW area! You should be aware of what you are doing. If you want to create user defined configuration follow the instructions in the next section.

Creating user configuration files

  • Create a new user configuration
    • Click menu File - New configuration file
    • Select a standard configuration file that you would like to start from via menu Config - Import configuration
      PhysicsTools/PatAlgos/test/patLayer1_fromAOD_full_cfg.py
      Warning, important You cannot create configuration files from scratch. You need to start from a configuration file containing a process (e.g. process=cms.Process("PAT")) and a path (e.g. process.p=cms.Path(...)).

      editing.png

  • Apply changes to the standard configuration and save them into the user configuration
    • Edit parameters of selected modules using the Property View. Your changes will appear in the user configuration code generated by Config Editor.
    • You can apply tools (e.g. PAT tools) via menu Config - Apply tool . Select a tool, choose its parameters and press apply.
    • Save user configuration via menu File - Save as...

Tutorials

Browsing PAT with Config Editor (2010)

Writing PAT user configuration with Config Editor (2010)

Manual

  • The command line options:
    • -f ... : open a file
    • -s ... : save screenshot of the center view to file

  • The File menu:
    • New configuration file creates an empty user configuration file.
    • Open File loads a config file (*.py) into the Config Editor, automatically loading all config files used by it (via import).
    • Reload File reloads the currently opened file. This function my be used after editing in an external editor.
    • Save writes the user configuration to file.

  • The Edit menu:
    • Find will search the objects in the Tree View and the Center View. One can search objects by label, by properties or by using a script (e.g. object.label == 'example')
    • With Find previous and Find next one can navigate through the search results.

  • The View menu:
    • Use Expand tree/Collapse tree to show/hide all branches in the Tree View.
    • Apply filer allows to filter the objects displayed in the Tree View and the Center View.
    • Set box content allows one select what is displayed in the boxes in the Center View. One may e.g. show the filename of each object (type object.filename).
    • The Save image function allows to save the contents of the Center View as an image file (e.g. PNG, BMP).
    • The Zoom function can be used to scale the contents of the Center View. Note that one can zoom by pressing CTRL and turning the mouse wheel.
    • The Center View shows a graphical representation of the object selected in the Tree View. For the arrangement of the boxes there are two different options:
    • Sequence structure switches the center view. Each module/sequence is represented by a box. The sequence structure of the configuration is vizualied.
      tree-structure-boxinbox-layout.bmp
    • Connection structure switches the center view. Each module is represented by a box. Sequences are omitted. Modules which use input (using edm::InputTag) from other modules are connected by lines.
      connection-structure.bmp

  • The Config menu:
    • Open editor opens an editor with the file that contains the object currently selected in the Property View.
    • With Choose editor one can select one's favorite editor for editing config files. The full filename of the editor can be entered as well as any command used in the shell, e.g. "emacs"
    • Dump python config to single file writes the currently opened python configuration into one single file. This is only possible for complete configuration files (*_cfg.py) containing a process (e.g. process=cms.Process("RECO")).
    • Export dot graphic create a dot graphic of the entire configuration file. You can save the graphic in several file formats(e.g. BMP, PNG, PS, PDF). This is only possible for complete configuration files (*_cfg.py) containing a process (e.g. process=cms.Process("RECO")).
    • Import configuration loads a standard configuration as a starting point for your user configuration.
    • Apply Tool allows you to apply a tool (e.g. PAT tool) to your user configuration. In a dialog you can select a tool, choose its parameters and apply it.

Troubleshooting

  • Problems with Open dialog: QPixmap:scaleWidth: Pixmap is a null pixmap
    There are no icons for navigting directories shown in the Open dialog. This is a know bug in the qt external to be fixed in the next release. For the moment you can navigate directories typing in the filename field: e.g. .. to move one directory up

  • ImportError: No module named ...
    This means that you opened a config file that Python cannot read. It can also mean that your config file includes another config file which cannot be read. Note that Python cannot read files which contain a dot "." in the filename except for the dot in ".py". These files need to be renamed: e.g. patLayer0_fromAOD_full.cfg.py needs to be renamed to patLayer0_fromAOD_full_cfg.py

  • Qt-related problems:
    Make sure that you are not using a custom Python version or custom Qt and PyQt versions in your $PYTHON_PATH. Use Python and Qt from CMSSW.

Talks

Introduction to Config Editor (2010)

Config Browser at CHEP (2009)

Update on Config Browser (2008)

Introduction to Config Browser (2008)

First prototype (2008)

Developers page

Config Editor Developers Page

Review status

Reviewer/Editor and Date (copy from screen) Comments
AndreasHinzmann - 03 Mar 2010 switch to ConfigEditor page
AndreasHinzmann - 17 Nov 2009 add ConfigEditor
AndreasHinzmann - 17 Apr 2009 switch to Qt4 version
AndreasHinzmann - 09 Oct 2008 add screenshots
AndreasHinzmann - 03 Oct 2008 add manual
AndreasHinzmann - 30 Sep 2008 add troubleshooting
AndreasHinzmann - 25 Sep 2008 add version information
AndreasHinzmann - 05 Sep 2008 add introduction, installation instructions and getting started
AndreasHinzmann - 03 Sep 2008 create template page

Responsible: AndreasHinzmann Last reviewed by: AndreasHinzmann - 03 Mar 2010

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng browsing.png r1 manage 79.1 K 2010-03-04 - 15:35 AndreasHinzmann Screenshot of the main-window of Config Editor browsing a PAT configuration
Bitmapbmp connection_structure.bmp r1 manage 152.2 K 2010-03-03 - 21:30 AndreasHinzmann Screenshot of the connection structure view of the ConfigEditor
PNGpng editing.png r1 manage 76.8 K 2010-03-04 - 15:53 AndreasHinzmann Screenshot of the main-window of Config Editor creating a user PAT configuration
Bitmapbmp mainwindow-labeled.bmp r1 manage 1625.9 K 2010-03-03 - 15:46 AndreasHinzmann Screenshot of the main-window of Config Editor
Bitmapbmp sequence_structure.bmp r1 manage 126.5 K 2010-03-03 - 21:30 AndreasHinzmann Screenshot of the sequence structure view of the ConfigEditor
Edit | Attach | Watch | Print version | History: r30 < r29 < r28 < r27 < r26 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r30 - 2013-07-08 - AndreasHinzmann
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback