Skip to content

Update example configs to reduce duplication #357

@tomeichlersmith

Description

@tomeichlersmith

This will just make the config files more portable and reduce duplication since most folks have all their hps stuff underneath one parent directory.

This can be achieved by providing a [DEFAULT] section at the top of the config file and then using the variable-expansion syntax %(variable_name)s. For example, I do the following:

# define where all my HPS stuff is
[DEFAULT]
hps_home = /full/path/to/hps/working/dir

# can reference that root directory in the rest of the config parameters
[MG4]
madgraph_dir = %(hps_home)s/mc/generators/madgraph4/src

We could also support all environment variables by providing the os.environ map to the ConfigParser constructor as "defaults". Then folks could pull (for example) %(HPS_HOME)s from the environment instead of having to change the config file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions