'Static' analysis of mapdag graphs - in particular validation.
'Static' analysis of mapdag graphs - in particular validation.
(validate-dependency-links graph input-keys-or-false output-keys-or-false)
Performs validation on the dependency structure of the given graph, throwing an error if an invariant violation is found, otherwise returning the graph unmodified.
The only key required in Step maps for this validation is :mapdag.step/deps, so this function is suitable for validating partially-constructed graphs.
See the documentation of #'validate for the additional arguments.
Performs validation on the dependency structure of the given graph, throwing an error if an invariant violation is found, otherwise returning the graph unmodified. The only key required in Step maps for this validation is :mapdag.step/deps, so this function is suitable for validating partially-constructed graphs. See the documentation of #'validate for the additional arguments.
(validate-graph graph input-keys-or-false output-keys-or-false)
Performs validation on the given mapdag Graph, throwing an error if an invariant violation is found, otherwise returning the graph unmodified.
The other arguments can be used to limit what the validation will cover:
input-keys-or-false
is a sequence of input names, will check if some inputs or steps are missing.
Otherwise it argument should be set to the boolean false
(not nil
, which would be interpreted as an empty sequence.).output-keys-or-false
is a sequence of step names, will only check for dependency cycles or missing steps on the sub-graph induced by the ancestors of these steps.
Otherwise it argument should be set to the boolean false
(not nil
, which would be interpreted as an empty sequence.).When not-false, these arguments lead to tolerating pathological properties that don't get in the way of the computation at hands:
Performs validation on the given mapdag Graph, throwing an error if an invariant violation is found, otherwise returning the graph unmodified. The other arguments can be used to limit what the validation will cover: - if `input-keys-or-false` is a sequence of input names, will check if some inputs or steps are missing. Otherwise it argument should be set to the boolean `false` (not `nil`, which would be interpreted as an empty sequence.). - if `output-keys-or-false` is a sequence of step names, will only check for dependency cycles or missing steps on the sub-graph induced by the ancestors of these steps. Otherwise it argument should be set to the boolean `false` (not `nil`, which would be interpreted as an empty sequence.). When not-false, these arguments lead to tolerating pathological properties that don't get in the way of the computation at hands: - dependency cycles that are outside of the necessary steps, or broken by the inputs, will not be reported. - missing steps outside of the necessary steps won't be reported.
(validate-shape graph)
Performs basic 'data shape/types' validation on the given graph, throwing an error if an invariant violation is found, otherwise returning the graph unmodified.
Some kinds of errors that won't be detected:
Performs basic 'data shape/types' validation on the given graph, throwing an error if an invariant violation is found, otherwise returning the graph unmodified. Some kinds of errors that won't be detected: - incorrect arity of :mapdag.step/compute-fn - dependencies-related invariant violations, such as dependency cycles or missing keys.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close