Skip to content

Cannot set parameter values in hierarchical parameter file from the command line #302

Description

@maxalbert

Currently it is not possible to set parameter values from the command line that are defined in a hierarchical parameter file, such as the following YAML file:

foo:
   bar: 42
   baz: 23

quux:
   bar: 55

The most intuitive syntax would be to use a dot to indicate the hierarchy:

smt run parameters.yml foo.bar=43 foo.baz=24 quux.bar=56

However, currently this does not work.

To reproduce:

$ git clone https://github.com/maxalbert/smt_bug.git
$ # Check out rev. 438c4cff80 if necessary.
$ make init-sumatra
$ smt run defaults.yaml foo.bar=43 quux.bar=56

Output (with Python 2.7):

Parameters: foo: {bar: 42, baz: 23}
!!python/unicode 'foo.bar': 43
quux: {bar: 55}
!!python/unicode 'quux.bar': 56

Output (with Python 3.5):

Parameters: foo: {bar: 42, baz: 23}
foo.bar: 43
quux: {bar: 55}
quux.bar: 56

Expected output:

Parameters: foo: {bar: 43, baz: 23}
quux: {bar: 56}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions