Skip to content
Engineering Decision Intelligence
TutorialVersion 0.3.0

Compare alternatives and trace Brightway supply chains

Run multi-method and alternatives comparisons, then inspect stored-result contributions and bounded supply-chain trees.

1. Resolve activities and methods first

text
list_projects
→ list_databases(project=...)
→ search_activities(project=..., database=..., query=...)
→ list_methods(project=..., filter=...)

Reuse returned activity codes and method tuples. Do not reconstruct identifiers from display names.

2. Score one activity across several methods

text
run_multi_method(
  project="...",
  database="...",
  code="...",
  methods=[[...], [...]],
  amount=1.0
)

Use this when the activity and functional amount stay fixed while the impact method changes. Use run_multi_method_async for larger method sets.

3. Compare several alternatives

text
compare_activities(
  project="...",
  alternatives=[
    {"database": "foreground", "code": "option_a", "label": "Option A"},
    {"database": "foreground", "code": "option_b", "label": "Option B"}
  ],
  methods=[[...]]
)

Warning

The current comparison helper evaluates each alternative at one unit of its reference activity. Compare scores directly only when that is a valid common functional basis.

Use compare_activities_async for a large alternatives × methods grid.

4. Inspect one result in detail

text
run_lca(...)
→ contribution_analysis(result_id=...)
→ top_emissions(result_id=...)
→ dispose_result(result_id=...)

Keep the same result_id for contribution and emission analysis so every view refers to the same solved LCA.

5. Build a bounded supply-chain tree

text
supply_chain(
  project="...",
  database="...",
  code="...",
  method=[...],
  amount=1.0,
  max_level=3,
  cutoff=0.02
)

max_level limits recursion depth and cutoff removes small contribution branches. Use supply_chain_async for larger graphs.

6. Reproduce the public comparison fixture

The Brightway MCP repository tests this workflow with a synthetic foreground: electricity emits 0.9 kg CO2-eq/kWh; steel uses 2.5 kWh plus 1.8 kg direct CO2-eq/kg; widget uses 0.5 kg steel + 1 kWh; widget_lite uses 0.3 kg steel + 1 kWh.

text
steel = 1.8 + 2.5 × 0.9 = 4.05 kg CO2-eq/kg
widget = 0.5 × 4.05 + 0.9 = 2.925 kg CO2-eq
widget_lite = 0.3 × 4.05 + 0.9 = 2.115 kg CO2-eq
AlternativeExpected score
widget2.925 kg CO2-eq
widget_lite2.115 kg CO2-eq

The automated comparison test asserts that widget_lite scores lower. The supply-chain test also asserts a root share of 1.0 with steel and electricity branches present.

Note

This is a synthetic software-verification fixture, not a real product footprint. Its purpose is to make comparison and contribution behavior easy to audit by hand.

Interpretation boundary

A contribution tree explains the score produced by the selected Brightway model. It does not establish a valid functional basis, database choice, allocation rule, LCIA method, or intervention strategy.