oie-mines-paristech / lca_algebraic

Layer over brightway2 for algebraic definition of parametric models and super fast computation of LCA
BSD 2-Clause "Simplified" License
40 stars 18 forks source link

Error with multiLCAAlgebric: "No biosphere flows found" and Matrix Dimension Issue #62

Open Elon-W414 opened 3 days ago

Elon-W414 commented 3 days ago

When using the multiLCAAlgebric function with my offshore_windfarm_FU and a list of methods, I encountered the following issues:

1.Warning:

 D:\All_about_python\ANACONDA\envs\lca\lib\site-packages\bw2calc\lca.py:228: UserWarning: No biosphere flows found. No inventory results can be calculated, `lcia` will raise an error warnings.warn("No biosphere flows found. No inventory results can "

2.Error:

ValueError: axis 0 index 20 exceeds matrix dimension 0

To debug the issue, I tried using a single method directly, but encountered another error:

Single Method Test Code:

method_test = ('EF v3.0', 'acidification', 'accumulated exceedance (AE)')
multiLCAAlgebric(offshore_windfarm_FU, method_test)

Error:

AssertionError: Can't find method object EF v3.0

Environment: Operating System: Windows 11 23H2 64-bit Python: 3.10.15 brightway2: 2.4.7 lca_algebraic: 1.1.2 Database: ecoinvent 3.10_apos

Could you provide guidance on how to resolve these errors?

raphaeljolivet commented 4 hours ago

Hi,

"No biosphere flows found. No inventory results can "

It seems you did not initiate your project / did not import any database.

You shoud either use bw2io.import_ecoinvent_release() (prefered way) or the now deprecated initProject()

If you did it already, it may have failed : look at the log/output of those functions. When the import fails, you might get no biosphere / functional units at all.

please inspire from this notebook

Also, since you are using lca_algebraic 1.1.2, multiLCAAlgebric is now named compute_impacts