Edges implementation#12
Conversation
…-implementation # Conflicts: # pathways/edges_matrix.py
…-implementation # Conflicts: # pathways/lca.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if methods: | ||
| # regular LCIA methods | ||
| characterization_matrix = fill_characterization_factors_matrices( | ||
| methods=methods, | ||
| biosphere_matrix_dict=lca.dicts.biosphere, | ||
| biosphere_dict=biosphere_indices, | ||
| debug=debug, | ||
| ) | ||
| else: | ||
| print("Using EDGES' LCIA methods...") | ||
|
|
||
| # EDGES' LCIA methods | ||
| formatted_biosphere_index = { | ||
| v: {"name": k[0], "categories": k[1:]} | ||
| for k, v in biosphere_indices.items() | ||
| } | ||
| formatted_technosphere_index = { | ||
| v: { | ||
| "name": k[0], | ||
| "reference product": k[1], | ||
| "unit": k[2], | ||
| "location": k[3], | ||
| } | ||
| for k, v in technosphere_indices.items() | ||
| } | ||
| characterization_matrix, lca = create_edges_characterization_matrix( | ||
| model=model, | ||
| multilca_obj=lca, | ||
| methods=edges_methods, | ||
| indices={ | ||
| "biosphere": formatted_biosphere_index, |
There was a problem hiding this comment.
Stop unpacking nonexistent EDGES return value
When EDGES methods are used, _calculate_year calls create_edges_characterization_matrix and tries to unpack two values (characterization_matrix, lca = …, lines 830‑835). However create_edges_characterization_matrix (new file pathways/edges_matrix.py) returns only a single sparse tensor, so this statement raises ValueError: not enough values to unpack (expected 2, got 1) before any results are produced. As a consequence every Pathways.calculate(..., edges_methods=[...]) invocation fails immediately. The call site should only assign the characterization tensor (the lca object has already been built earlier).
Useful? React with 👍 / 👎.
No description provided.