Makeflow Feature: JX Representation
There are a number of neat new features in the latest versions of our software that I would like to highlight through some occasional blog posts. If these sound interesting, please give them a try and send us your feedback.
For example, a traditional makeflow rule looks like this:
out.txt: in.txt calib.dat simulate.exe
simulate.exe -i in.txt -p 10 > out.txt
In the latest version of Makeflow, you can write the same rule in JSON like this:
{
"command" : "simulate.exe -i in.txt -p 10 > out.txt",
"inputs" : [ "in.txt", "calib.dat", "simulate.exe" ],
"outputs": [ "out.txt" ]
}
Now, just using JSON by itself doesn't give you a whole lot. However, we extended JSON with a few new features like list comprehensions, variables substitutions, and operators. This gives us a programmable way of generating a lot of rules easily.
For example, this represents 100 rules where the parameter varies from 0-99:
{
"command" : format("simulate.exe -i in.txt -p %d > out.%d.txt",param,param),
"inputs" : [ "in.txt", "calib.dat", "simulate.exe" ],
"outputs": [ format("out.%d.txt",param) ]
} f or param in range(100)
Thanks to Andrew Litteken for converting and testing many of our example workflows into the new format.
Enjoy Reading This Article?
Here are some more articles you might like to read next: