LCA-ActivityBrowser / activity-browser

GUI for brightway2
GNU Lesser General Public License v3.0
139 stars 54 forks source link

typeError when copy-pasting exchanges between activities #822

Open simb-sdu opened 2 years ago

simb-sdu commented 2 years ago

I am working on inter-activity copy/pasting of exchanges

The pasting currently only pastes the exchange without any field values (e.g. value, comment, formula, uncertainty)

I am starting to implement just the value, formula, and comment, which seems to be the exchange_modified() signal (defined as modify_exchange(exchange, field, value) in \controllers\activity.py) Having some trouble to get this function working, probably because of wrong data types. feeling stuck, see comments in code

see commit on my fork

https://github.com/simb-sdu/activity-browser/commit/37dbdcc7168dfc7d48f88dfd87a630f1f46161fe

simb-sdu commented 2 years ago
Updating activity in metadata:  'test' (unit, GLO, None) ('JJensen case studies', '60e20c58dd464061bb0c42052c20ef41')
Traceback (most recent call last):
File "C:\Users\simb\Anaconda3\envs\dev_ab\Lib\site-packages\activity_browser\activity-browser\activity_browser\controllers\activity.py", line 266, in modify_exchange
  exchange[field] = value
TypeError: list indices must be integers or slices, not str