3 ms·
Hi; a parametrized rule in Stu would be something such as: list.$NETWORK.$METHOD.$STYLE.txt: data/$NETWORK.txt compute_$METHOD.py style_$STYLE.css { pyt
by kunegis 11y ago
Hi; a parametrized rule in Stu would be something such as:
list.$NETWORK.$METHOD.$STYLE.txt: data/$NETWORK.txt compute_$METHOD.py style_$STYLE.css
{
python compute_$METHOD.m --dataset data/$NETWORK.txt --style style_$STYLE.css
}
GNU Make supports individual parameters with '%', and Cook [1] supports multiple parameters with '%1'/'%2'/etc.
The second defining feature of Stu are what we call 'dynamic dependencies', which work like this:
@all: [dep];
>dep: NETWORKS.txt METHODS.txt STYLES.txt {
for NETWORK in $(cat NETWORKS.txt) ; do
for METHOD in $(cat METHODS.txt) ; do
for STYLE in $(cat STYLES.txt) ; do
echo list.$NETWORK.$METHOD.$STYLE.txt
done
done
done
}
I.e., a filename in brackets is first built, and then Stu will parse its content as a list of dependencies.
Myself I have used Make for years in the KONECT project [2], and implementing these types of things is possible with Make, but only using some very verbose and ugly hacks that become unreadable very fast. Also, I don't know of another tool that has these features, and therefore I wrote one; the one that comes closest is Cook by the late Peter Miller.
[1] https://ftp.gnu.org/non-gnu/cook.README https://ftp.gnu.org/non-gnu/cook.README
[2] http://konect.uni-koblenz.de/ http://konect.uni-koblenz.de/