Dict type inconsistency between "--configfile" argument and "configfile:" directive

Create issue
Issue #1058 new
Former user created an issue

Description:

I stumbled upon an inconsistency between type dictionaries used in the global variable config, that is acquired by '--configfile' or 'configfile:' inside snakefile. The first uses OrderedDict, the second uses simple pyton dict.

In my opinion, it should be OrderedDict everywhere, since sometimes you need to know the order of the configurations (in my case, there are consecutive commands to call). I know that for ordering I can use sequences (or lists) in YAML, but doing so will make reading of the config a pain sometimes. Nevertheless, these two methods of obtaining a config should be consistent since they are doing the same and are (almost) called the same.

Snakemake version:

5.3.1 (also tested on 5.2.2)

Minimal working example:

------- snakefile.snake -------

configfile: srcdir('config.yaml')
print(config)

------- config.yaml -------

test:
    test:
        asdasd: 12
        test: a
        test2: b
        ano: c
        adgfgw: 15

------ console --------

(test) kucharik@gen-main:~$ snakemake -s snakefile.snake
{'test': {'test': {'asdasd': 12, 'test': 'a', 'test2': 'b', 'ano': 'c', 'adgfgw': 15}}}
Building DAG of jobs...
Nothing to be done.
Complete log: /home/kucharik/.snakemake/log/2018-12-14T164011.800688.snakemake.log
(test) kucharik@gen-main:~$ snakemake -s snakefile.snake --configfile config.yaml
{'test': OrderedDict([('test', OrderedDict([('asdasd', 12), ('test', 'a'), ('test2', 'b'), ('ano', 'c'), ('adgfgw', 15)]))])}
Building DAG of jobs...
Nothing to be done.
Complete log: /home/kucharik/.snakemake/log/2018-12-14T164038.882414.snakemake.log

Comments (1)

  1. Log in to comment