Skip to content

Config sensitive to field-ordering #12

@benjimin

Description

@benjimin

These two config files differ only in the list-ordering, but produce different outcomes.

This works:

- template: wind_v3
- load_exposure:
    exposure_latitude: LATITUDE
    exposure_longitude: LONGITUDE
    file_name: .../exposure.csv
- load_wind_ascii: NetCDF:.../gust.nc:vmax
- calc_struct_loss:
    replacement_value_label: REPLACEMENT_VALUE
- save: .../test_impact.csv

This fails:

- calc_struct_loss:
    replacement_value_label: REPLACEMENT_VALUE
- load_wind_ascii: NetCDF:.../gust.nc:vmax
- save: .../test_impact.csv
- template: wind_v3
- load_exposure:
    exposure_latitude: LATITUDE
    exposure_longitude: LONGITUDE
    file_name: .../exposure.csv

With uninformative message (from config_build.py, called from templates.py, called from config.py):

RuntimeError: 
Invalid key in config file; calc_struct_loss 

Possibly the template must be specified first, to control how subsequent fields are parsed. This is either a bug or should be clearly documented. (At minimum, since the config is the primary user interface, the error message should be more helpful.)

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