Exemple #1
0
    def get(self, **wildcards):
        missing = self.rule.wildcard_names.difference(wildcards.keys())
        if missing:
            raise WorkflowError("Missing wildcard values for {}".format(
                ", ".join(missing)))

        output, _ = self.rule.expand_output(wildcards)
        if (self.checkpoints.future_output is None or any(
            (not f.exists or f in self.checkpoints.future_output)
                for f in output)):
            raise IncompleteCheckpointException(self.rule,
                                                checkpoint_target(output[0]))
        return CheckpointJob(self.rule, output)
Exemple #2
0
 def __init__(self, rule, targetfile):
     super().__init__(
         "The requested checkpoint output is not yet created."
         "If you see this error, you have likely tried to use "
         "checkpoint output outside of an input function, or "
         "you have tried to call an input function directly "
         "via <function_name>(). Please check the docs at "
         "https://snakemake.readthedocs.io/en/stable/"
         "snakefiles/rules.html#data-dependent-conditional-execution "
         "and note that the input function in the example rule "
         "'aggregate' is NOT called, but passed to the rule "
         "by name, such that Snakemake can call it internally "
         "once the checkpoint is finished.")
     self.rule = rule
     from snakemake.io import checkpoint_target
     self.targetfile = checkpoint_target(targetfile)
Exemple #3
0
    def get(self, **wildcards):
        missing = self.rule.wildcard_names.difference(wildcards.keys())
        if missing:
            raise WorkflowError("Missing wildcard values for {}".format(
                ", ".join(missing)))

        output, _ = self.rule.expand_output(wildcards)
        if self.checkpoints.future_output is not None:
            for iofile in output:
                if iofile in self.checkpoints.future_output:
                    break
                if not iofile.exists and not iofile.is_temp:
                    break
            else:
                return CheckpointJob(self.rule, output)

        raise IncompleteCheckpointException(self.rule,
                                            checkpoint_target(output[0]))