Igor Programming Tool

This documents the Igor Programming Tool (IPT) that was developed by byte physics to provide a collection of tools for WaveMetrics Igor Pro. IPT is a command line application that runs outside of Igor Pro and enables users to improve their programming workflows and write better code.

IPT is especially useful if you are working in a team and want to have a clean codebase or you want to apply best practices while writing Igor source code.

Download and Installation

Alternative versions:

Note

ipt is under heavy development and therefore the program is only usable for 3 months after the release.

Use one of the download links above that fits your platform. If its an installer, run it and enable the option that ipt will be added to your PATH. The other variants require you to place it at a location that is accessible through your PATH environment variable or update the PATH environment variable yourself.

Minimum supported OS versions:

  • Windows: 7.0

  • MacOSX: 10.13

  • Linux: Kernel 2.6

winget

We support the installation on Windows using the command line tool winget. To do this just open a terminal and run:

winget install -e --id byte-physics.ipt

The installer will require administrator privileges automatically if the terminal wasn’t already started as administrator.

Warning

The winget install won’t add ipt to your PATH environment variable itself. This problem will be fixed in a future release. To use ipt in your terminal it is recommended to add the installation path to your PATH environment variable manually.

Note

The winget repository won’t contain installer for small bugfixes. If you want to access the latest fix, you have to use the download link from above.

Feature overview

Formatting

ipt can format input files in a uniform and good looking way. Doing this makes it easier for the reader to understand your code and improves collaboration with other users. And remember also your future self is another user!

Input
 FUnction printSumOfEachMember  (wave/wave wv,string   msg)
     variable i
     VARIABLE size=DimSize(wv, 0)
     For  (i=0;i<size;i+=1)
         Wave inner=wv[i]// get inner wave
 Variable waveSum=sum(inner)// sum of inner wave
     printf "%s: sum([%d])=%f\n",msg,i,waveSum
 endfor
 EndMacro
Nicely formatted output
 Function printSumOfEachMember(WAVE/WAVE wv, string msg)
     variable i
     variable size = DimSize(wv, 0)
     for(i = 0; i < size; i += 1)
             WAVE     inner   = wv[i]      // get inner wave
             variable waveSum = sum(inner) // sum of inner wave
             printf "%s: sum([%d])=%f\n", msg, i, waveSum
     endfor
 End

Formatting is done according to our coding conventions.

Syntax checking

At the same time ipt can also check the code to find common errors which would otherwise not be found in Igor Pro.

Function printText()
    WAVE/C/T wv
    print wv
End
ipt format example.ipf

Linting

ipt has a powerful linting mode which applies additional checks and allows code transformations.

For example changing function arguments in the old IP6-style into the new inline style:

Function test(a)
    variable a

    print a
End
Function test(variable a)

    print a
End

The Supported Linter rules page contains a detailed list.

More

More information can be found in the documentation of the special features and in the documentation of all builtin ipt commands.