`uncertainty_type` vs `uncertainty type` in `uncertainty dictionary` creating problems

Issue #16 resolved
Pascal Lesage
created an issue

As reported here, Brightway and stats_arrays uncertainty dictionaries are different: one uses the key uncertainty_type, and the other uncertainty type.

This sometimes causes confusion.

It also sometimes appear to cause errors when defining new distributions (code available upon request).

Harmonization would be great.

Comments (2)

  1. Chris Mutel repo owner

    This is an annoying inconsistency. There are clear rules that distinguish between the two, but they are not properly explained in the documentation or code.

    Brightway2-data uses the name uncertainty type when defining an uncertain value. When this input data to converted to a parameter array, which can be an input to the RNG in stats_arrays, this field is named uncertainty_type. uncertainty_type is used exclusively in stats_arrays.

    Both libraries are in widespread use now, and so introducing a breaking change would be difficult. Stats_arrays needs the underscore to allow attribute access, e.g. foo.uncertainty_type. Updating Brightway2-data would require that everyone rewrites all their databases, which is also suboptimal. It would also make all the Excel import data spreadsheets obsolete. I guess you could write a function that would slowly introduce one form or the other, while still tolerating the older version.

    Please post code that raises errors (rather than annoyances).

  2. Log in to comment