Skip to content

Edges implementation#12

Merged
romainsacchi merged 12 commits into
mainfrom
edges-implementation
Nov 13, 2025
Merged

Edges implementation#12
romainsacchi merged 12 commits into
mainfrom
edges-implementation

Conversation

@romainsacchi
Copy link
Copy Markdown
Collaborator

No description provided.

@romainsacchi romainsacchi merged commit 195217a into main Nov 13, 2025
3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pathways/lca.py
Comment on lines +805 to +835
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,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant