What does 'inherit = None' mean in task inheritance?

Hi there

Is there a simple way to understand what inherit = None means in task inheritance?

Are these things the same…

[[foo]]
    inherit = None
    [[[environment]]]
        host = myhost

… and …

[[foo]]
    [[[environment]]]
        host = myhost

It’s not entirely clear to me from the docs I’m afraid! :slight_smile:

Thanks!

Jonny

CC @vv1610 FYI

inherit = None I believe is relevant only to the GUI. If you do inherit = FOO your task will be shown under FOO, but if you do inherit = None, FOO, then it will be displayed under the cycle point instead.

In your example, yes, they would be equivalent because you are not inheriting anything else.

See https://cylc.github.io/doc/built-sphinx-single/index.html#task-families-and-visualization

2 Likes

@TomC is right.

The reason (for the record) for this is the runtime hierarchy is primarily for inheritance of task runtime settings, but secondarily it defines the collapse/expand family hierarchy for dependency graph visualization. However, it’s a multiple inheritance hierarchy (a task or family can inherit from multiple families at once) and collapse/expand only makes sense for a single-parent hierarchy, so we use only the first parents, at each level, for that. These two purposes don’t usually conflict but sometimes the first parent is inherited for base technical reasons (e.g. platform settings) that don’t reflect the logical purpose of the task, so inherit = None, parent1 can be used to nullify the first parent for visualization purposes without affecting the inheritance of settings.

This dual use of the inheritance hierarchy is supposed to be a convenience - when it works you get a nice visualization hierarchy for free. But this inherit = None, ... bodge is not exactly intuitive :grimacing: … so we’re planning to go for a separate, more flexible, visualization hierarchy in future.

2 Likes

Thanks a lot for that, Tom! :slight_smile:

Thanks Hilary, very helpful.

I had convinced myself that the None was related to something else entirely so I’m happy to have been put straight by you and @TomC!

All the best

Jonny