Skip to content

In cluster mode unserializable parameter leads to all parameters deleted #1425

@mxposed

Description

@mxposed

Snakemake version: 6.15.5

When I run snakemake in cluster mode, if a rule has a parameter which is not serializable, it leads to all parameters being removed from the serialization in jobscript

Minimal example:

import numpy as np

rule all:
    input: "a.txt"

rule first:
    output: "a.txt"
    params:
        good="Good old value",
        bad=np.int64(1)
    shell:
        "touch a.txt"

The output of snakemake --cluster sbatch -j1 --verbose prints the jobscript properties:

Jobscript:
#!/bin/sh
# properties = {"type": "single", "rule": "first", "local": false, "input": [], "output": ["a.txt"], "wildcards": {}, "log": [], "threads": 1, "resources": {"tmpdir": "/tmp"}, "jobid": 1, "cluster": {}}

I expect that the parameter definition will at least have the good serializable parameter. Ideally I would also like numpy types to serialize.

If maintainers are fine with fixing this at all, I can submit a pull request with the fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions