USEPA / standardizedinventories

Standardized Release and Waste Inventories
MIT License
25 stars 16 forks source link

resolves "variable called before assignment" error when TRI preferred over DMR in stewicombo #125

Closed vlahm closed 1 year ago

vlahm commented 1 year ago

This package is a life saver, y'all. Thank you.

After setting "water": ["TRI", "DMR"], in INVENTORY_PREFERENCE_BY_COMPARTMENT, and running

all = combineFullInventories({'TRI':2014, 'NEI':2014, 'DMR':2014}, filter_for_LCI = False)

(Ubuntu 20.04, Python 3.10.5, StEWI 1.0.5)

I received an error stating that the keep_list variable was being called before assignment. That error appears to be resolved by this small change.

Sorry I don't have the exact error text. As it stands, you actually have to reinstall StEWI in order to modify INVENTORY_PREFERENCE_BY_COMPARTMENT in a way that affects package behavior. Was that intended?

bl-young commented 1 year ago

Thanks for this, looks good.

This package is a life saver, y'all. Thank you.

Glad it's been helpful. We'd be interested in hearing how you are using it! You can get in touch via email here

As it stands, you actually have to reinstall StEWI in order to modify INVENTORY_PREFERENCE_BY_COMPARTMENT in a way that affects package behavior. Was that intended?

We plan to shift towards use of configuration files for these kinds of variables but have not implemented yet.