what does this invocation of cylc graph do?
For a given suite scheduling (or if the
--namespace option if also provided, the runtime namespace inheritance) configuration, it will, instead of opening an interactive GUI window to display the visual graph of nodes & edges, print to STDOUT a textual representation of those graphs.
The returned text is the equivalent to the Graphviz code used to render the visual graph on the GUI (for the same command minus the
--reference option), but converted to a more human-readable format, namely (I believe) in the Graphviz ‘plain’ format.
For example (taking one from our test battery), for the following simple suite:
cycle point time zone = +12
initial cycle point = 20140808T00
graph = foo
graph = foo => bar
number of cycle points = 3
it will return:
$ cylc graph --reference
edge "foo.20140808T0000+12" "bar.20140808T0000+12"
node "bar.20140808T0000+12" "bar\n20140808T0000+12"
node "foo.20140808T0000+12" "foo\n20140808T0000+12"
node "foo.20140808T0600+12" "foo\n20140808T0600+12"
node "foo.20140808T1200+12" "foo\n20140808T1200+12"
Uses for it include as a means to systematically compare the graph of two suites, via
[cylc graph-diff](https://cylc.github.io/doc/built-sphinx-single/index.html#graph-diff) which under the hood simply takes the output of those commands from the two suites & does a
diff command to highlight lines that vary.
i initiated the invocation thinking, well maybe we don/t need gtk for this:
To the crux of your question, yes, given the above by functionality the
--reference option does not on its own require GTK (unless I have overlooked some subtlety).
However, I’ve taken a look at the logic of the relevant files from the codebase & the code that runs for that option does go through a (
except) block where it checks for the
gtk module & exits if it is not there, with that error you report, despite not needing that module (or some of the others it checks for there) for the
--reference option utility.
So, there is a flaw in the code logic I believe; thanks for noticing that! A small refactor could allow
cylc graph --reference to run in an environment without
gtk & other unrequired modules. I will write this up in a small Issue on GitHub.
In honest, though, this deficiency is unlikely to get addressed (at least soon), because we are developing Cylc 8 & its new UI, which will work in the browser (with no local Cylc installation required), in earnest, & there the graphing of suites will be managed by completely new code. We are focusing efforts on the new Cylc-8 system rather than making enhancements to Cylc-7 code specific to its tech stack which we are replacing, including GTK which we are leaving behind.
some utilities for non-gtk would be useful (IMHO).
We absolutely agree on this, however, & there are plans for enhanced graphing features in Cylc 8. If you are interested, we have some Issues on GitHub that discuss some of these, see e.g this one on
cylc graph & this one on graph comparisons.