Skip to content

RAVEN Development IDE Setup

Congjian Wang - INL edited this page Sep 16, 2021 · 8 revisions

Setting Up IDEs to Develop RAVEN

There are some common settings for some common IDEs that can make developing RAVEN easier. Here are some notes from our core development team who use the following IDEs.

VS Code

VS Code is a popular IDE with a rapidly growing user group. One if its main draws to RAVEN developers is online debugging and exploration of Python code during run time.

Setting up VS Code for RAVEN development includes installing a couple extensions, adding to the settings json, and extending the launch json.

Extensions

Particular extensions vary from user to user, but the following are commonly used (as of this writing):

  • XML Tools, by Josh Johnson, for better XML editing
  • Fold, by Felicio Mununga, for indent-based folding
  • GitLens -- Git supercharged, by Eric Amodio, for better git integration
  • Edit csv, by janisdd, for in-VS easy CSV viewing and editing

Settings (json)

You can edit the underlying settings.json file by using the Open Settings (JSON) command from the Command Palette (⇧⌘P). The following settings are commonly used, and can be added directly to the settings.json file either globally or for the RAVEN workspace:

    // RAVEN settings
    //disable opening of files as preview instead of editable
    "workbench.editor.enablePreview": false,
    "workbench.editor.enablePreviewFromQuickOpen": false,
    // lines should not exceed 100 characters, and may not exceed 120
    "editor.rulers": [100, 120],
    // navigation within code
    "breadcrumbs.enabled": true,
    // set up python path -> FIXME change to your conda libs install location!
    "python.pythonPath": "/Users/talbpw/anaconda3/envs/raven_libraries/bin/",
    "python.defaultInterpreterPath": "/Users/talbpw/anaconda3/envs/raven_libraries/bin/",
    // python linting (automatic checking) to be compatible with RAVEN
    // C0103: naming conventions in RAVEN are different than PEP8 standard, so disable this
    // C0301: line too long, while we have suggestions we don't enforce this rule, so disable this
    // W0511: TODOs in code comments, this is acceptable in RAVEN
    // R0902: too many instance attributes, we don't enforce this
    // R0914: too many local variables, we don't enforce this
    // E0401: path unresolved, generally this is handled by the importing structure of RAVEN
    // see more at e.g. http://pylint-messages.wikidot.com/all-codes
    "python.linting.pylintEnabled": true,
    "python.linting.lintOnSave": true,
    "python.linting.pylintArgs": [
        "--disable=C0103,C0301,W0511,R0902,R0914,E0401",
        "--indent-string='  '"
    ],
    "python.languageServer": "Pylance",
    "editor.tabSize": 2,
    "python.linting.pylintUseMinimalCheckers": false,
    // associate XML and XSD as HTML files for the coloring and features
    "files.associations": {
        "*.xml": "html",
        "*.xsd": "html"
    },
    // standard file cleanup and formatting
    "files.trimTrailingWhitespace": true,
    "files.insertFinalNewline": true,
  • NOTE: The user paths must be changed from /Users/talbpw to the corresponding path on your machine!

Launch (json)

VS Code allows launching python and using debugging tools. This allows us to set up launch configurations particularly for running RAVEN.

Add the following to the global or workspace launch.json file under configurations:

    { "name": "RAVEN",
      "type": "python",
      "request": "launch",
      "python": "${command:python.interpreterPath}",
      "program": "/Users/talbpw/projects/raven/framework/Driver.py",

      "cwd": "/Users/talbpw/projects/raven/tests/framework/ROM/TimeSeries/SyntheticHistory",
      "args": ["fourier.xml"],

    },

Then, by changing the cwd and args entries, different RAVEN inputs can be executed.

  • NOTE: The user paths must be changed from /Users/talbpw to the corresponding path on your machine!