Skip to content
Engineering Decision Intelligence
TutorialVersion 0.3.0

Brightway comparative reference case

Rebuild the small public fixture used to verify alternative comparison and supply-chain behavior.

1. Understand the fixture

ActivityForeground definition
electricity1 kWh; 0.9 kg fossil CO2
steel1 kg; 2.5 kWh electricity + 1.8 kg fossil CO2
widget1 kg; 0.5 kg steel + 1 kWh electricity
widget_lite1 kg; 0.3 kg steel + 1 kWh electricity

The test method characterizes fossil CO2 at 1 kg CO2-eq/kg. The fixture also contains methane and sulfur-dioxide biosphere flows, but they are not used by these two alternatives.

2. Calculate the expected scores by hand

text
electricity = 0.9
steel = 1.8 + 2.5 × 0.9 = 4.05
widget = 0.5 × 4.05 + 0.9 = 2.925
widget_lite = 0.3 × 4.05 + 0.9 = 2.115

The lite alternative is lower by 0.81 kg CO2-eq on the shared one-kilogram reference basis.

3. Run the alternatives grid

text
compare_activities(
  project="bw-mcp-test",
  alternatives=[
    {"database": "fg_test", "code": "widget", "label": "widget"},
    {"database": "fg_test", "code": "widget_lite", "label": "lite"}
  ],
  methods=[["test", "GWP100"]]
)

The repository test requires two result rows and asserts that lite scores lower than widget.

4. Trace the widget supply chain

text
supply_chain(
  project="bw-mcp-test",
  database="fg_test",
  code="widget",
  method=["test", "GWP100"],
  max_level=3,
  cutoff=0.01
)

The test asserts a root share of 1.0 and non-empty steel/electricity branches. The steel branch carries 2.025 kg CO2-eq of the widget total and direct electricity carries 0.9 kg CO2-eq.

Use the fixture correctly

Note

This fixture is deliberately synthetic. Use it to verify software behavior, scaling, and interpretation mechanics before moving to a real database; do not present its numbers as product-footprint evidence.