Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix: correct handling of exceptions in input functions that are gener…
…ators (#1536) * fix: correct handling of exceptions in input functions that are generators * fmt
- Loading branch information
1 parent
5b394c0
commit d9a56aa
Showing
6 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import random | ||
|
||
checkpoint random: | ||
output: | ||
target = 'test1/{target}/{config}.txt' | ||
|
||
run: | ||
with open(output.target, 'w') as ftg: | ||
for i in range(2, 10): | ||
ftg.write(f'test1/{wildcards.target}/{wildcards.config}/v{i}\n') | ||
|
||
rule process: | ||
output: | ||
touch('test1/{target}/{config}/v{index}') | ||
|
||
def genetate_inputs(wildcards): | ||
with checkpoints.random.get(**wildcards).output[0].open() as fran: | ||
for line in fran.readlines(): | ||
yield line.rstrip() | ||
|
||
rule generate: | ||
input: | ||
genetate_inputs | ||
output: | ||
touch('test1/{target}/{config}.done') |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters