MetOffice / dagrunner

⛔[EXPERIMENTAL] Directed acyclic graph (DAG) runner and tools
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

ENH: Passing arguments to graph callable #41

Closed cpelley closed 2 months ago

cpelley commented 2 months ago

Support passing parameters to the science callable that returns a graph. This ultimately enables science graphs to have controllable behaviour. Obvious examples include graph filtering.

image

So, this means supporting passing key, value pairs via the commandline which are passed to the science teams graph returning callable.

Example call:

execute_graph.py graph_config.graphs.ukvx --networkx-graph-kwargs file_filter_path dot-module-path

One can pass arbitrary arguments this way too:

... --networkx-graph-kwargs key1 val1 --networkx-graph-kwargs key2 val2 ...

Issues

cpelley commented 2 months ago

This is targeting CLASS_INITIALISATION for now since this builds on changes from there. I'll retarget once that is merged. Review can proceed anyway (conflicts are caused by the documentation which will go aware are retargeting).

cpelley commented 2 months ago

@bayliffe, - this change to dagrunner enables parameters passed to be given to the science teams callable which returns a graph. This means that your callable can itself define a filter UI which can be called through the execution script.

cpelley commented 2 months ago

Thanks @mo-robert-purvis. I have rebased and pushed back up. No changes to what was already approved.