brightway-lca / brightway2-calc

The calculation engine for the Brightway2 life cycle assessment framework.
BSD 3-Clause "New" or "Revised" License
14 stars 16 forks source link

New translate method breaks redo_lcia #2

Closed aleksandra-kim closed 8 years ago

aleksandra-kim commented 9 years ago

Original report by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


The method_filepath doesn't change, even when the method does.

aleksandra-kim commented 8 years ago

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Bug report from Deborah Sills:

#!python

for col, method in enumerate(methods):
    lca.method = method
    lca.load_lcia_data()
    for row, process in enumerate(processes):
        lca.redo_lcia({process: 1})
        results[row, col] = lca.score

Probably the load_lcia_data function (and similarly the load_lci_data) should run translate by themselves...

aleksandra-kim commented 8 years ago

Original comment by Chris Mutel (Bitbucket: cmutel, GitHub: cmutel).


Fixed in 3bc8892 and 2495873. New syntax will look like:

#!python

for col, method in enumerate(methods):
    lca.switch_method(method)
    for row, process in enumerate(processes):
        lca.redo_lcia({process: 1})
        results[row, col] = lca.score