Square bracket wildcards in `cylc insert` cycle points?

Hi there

Should I be able to use [ ] wildcards in cylc insert calls?

This works…

cylc insert foo py_for_afterburner.19510101T0000Z

… but this doesn’t…

cylc insert foo py_for_afterburner.195[1-9]0101T0000Z

Is this behaviour expected?

Thanks a lot

Jonny

Hi Jonny,

“Glob” pattern matching works as documented in the command help - including character ranges in task name and cycle point values - for commands that target existing tasks in the task pool.

The cylc insert command is different though. Rather than matching and operating on existing tasks, it inserts new tasks into the task pool. So no, you can’t use globbing with cylc insert because globs (like regexes) are for matching existing stuff, not for generating all the possible new stuff that the pattern would match.

Unfortunately I see cylc insert --help just prints the generic task-matching CLI info though. Sorry about that; I’ll post an issue to get it fixed.

Hilary

1 Like

Hi Hilary

OK got it, thanks. I hadn’t appreciated the difference between the different types of pattern matching.

Thanks for raising the ticket!

Cheers

Jonny

Slight correction (thanks @matthewrmshin and @dwsutherland):

You can do globbing of task names with cylc insert, because they can match against the list of all known task names in the suite.

(But you can’t do globbing of cycle points with cylc insert because the server program does not know “all the possible cycle points” to match against (they could be infinite!) - they are generated dynamically (and incrementally) from the graph recurrence expressions as the suite runs.)

(But_2 other task-targeting commands such as cylc trigger can do globbing of both task name and cycle points, because they match against task proxies - name.cycle-point - present in the current task pool).

Hilary