bgamazay commited on
Commit
f35560e
·
verified ·
1 Parent(s): 651bc0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -15
app.py CHANGED
@@ -214,29 +214,37 @@ with c2:
214
  </div>
215
  """, unsafe_allow_html=True)
216
 
217
- # 2. Charts
 
218
 
219
- years = [2015, 2020, 2023]
220
- emissions_hist = [6600, 6000, 6200]
221
- target_2030 = 7200 * 0.50
222
- bau_2030 = 6200
 
 
 
 
223
 
224
  fig1 = go.Figure()
225
 
 
226
  fig1.add_trace(go.Scatter(
227
  x=years, y=emissions_hist,
228
  mode='lines+markers',
229
- name='Historical Emissions',
230
  line=dict(color='gray', width=2)
231
  ))
232
 
 
233
  fig1.add_trace(go.Scatter(
234
- x=[2023, 2030], y=[6200, target_2030],
235
- mode='lines',
236
  name='2030 Climate Goal (50% Cut)',
237
- line=dict(color='green', dash='dash', width=2)
238
  ))
239
 
 
240
  fig1.add_trace(go.Bar(
241
  x=[2030], y=[bau_2030],
242
  name='2030 Baseline Estimate',
@@ -251,16 +259,16 @@ fig1.add_trace(go.Bar(
251
 
252
  fig1.update_layout(
253
  height=650,
254
- font=dict(size=18), # Scales all text globally
255
  title={
256
- 'text': "US Emissions Trajectory vs. AI Impact",
257
- 'font': {'size': 30},
258
  'x': 0.5,
259
  'xanchor': 'center'
260
  },
261
  yaxis={
262
  'title': {
263
- 'text': "Emissions (Million tCO<sub>2</sub>e)",
264
  'font': {'size': 20}
265
  },
266
  'tickfont': {'size': 16}
@@ -286,8 +294,9 @@ st.markdown("---")
286
  with st.expander("📚 Data Sources & Methodology"):
287
  st.markdown(f"""
288
  **Methodology Updates:**
289
- * **2030 Baseline Emissions:** Assumes 2023 emissions stay static, {US_BASELINE_MMT} Million tCO2e (EPA Gross GHG Inventory).
 
290
  * **Efficiency Logic:** Emissions Factor is calculated dynamically based on the **Electrical Efficiency** slider ({turbine_eff_percent}% currently selected).
291
  * *Formula:* `EF = (Benchmark Carbon Content) / Efficiency %`
292
- * *Benchmark:* Based on standard [NREL](https://docs.nrel.gov/docs/fy21osti/80580.pdf) life cycle emissions data for Combined Cycle Gas Turbines (486 gCO2e/kWh @ 60% efficiency).
293
  """)
 
214
  </div>
215
  """, unsafe_allow_html=True)
216
 
217
+ # 2. Charts
218
+ st.subheader("US Emissions Trajectory vs. AI Impact")
219
 
220
+ # Updated Data from Our World in Data (Billion tCO2e -> Million tCO2e)
221
+ years = [2020, 2021, 2022, 2023, 2024]
222
+ emissions_hist = [4690, 5020, 5060, 4920, 4900]
223
+
224
+ # Target: 50% reduction from 2005 levels (approx 6130 MMT CO2 in 2005 -> ~3065 MMT target)
225
+ # Adjusted to match the specific CO2-only metric provided
226
+ target_2030 = 3065
227
+ bau_2030 = 4800 # Optimistic business-as-usual decline for CO2 only
228
 
229
  fig1 = go.Figure()
230
 
231
+ # History Line
232
  fig1.add_trace(go.Scatter(
233
  x=years, y=emissions_hist,
234
  mode='lines+markers',
235
+ name='Historical CO₂ (Fossil/Industry)',
236
  line=dict(color='gray', width=2)
237
  ))
238
 
239
+ # Target Dot (Changed from line to single marker)
240
  fig1.add_trace(go.Scatter(
241
+ x=[2030], y=[target_2030],
242
+ mode='markers',
243
  name='2030 Climate Goal (50% Cut)',
244
+ marker=dict(color='green', size=12, symbol='circle')
245
  ))
246
 
247
+ # AI Impact Stacked Bar
248
  fig1.add_trace(go.Bar(
249
  x=[2030], y=[bau_2030],
250
  name='2030 Baseline Estimate',
 
259
 
260
  fig1.update_layout(
261
  height=650,
262
+ font=dict(size=18),
263
  title={
264
+ 'text': "Can we hit the 50% reduction target?",
265
+ 'font': {'size': 24},
266
  'x': 0.5,
267
  'xanchor': 'center'
268
  },
269
  yaxis={
270
  'title': {
271
+ 'text': "Emissions (Million tCO<sub>2</sub>)",
272
  'font': {'size': 20}
273
  },
274
  'tickfont': {'size': 16}
 
294
  with st.expander("📚 Data Sources & Methodology"):
295
  st.markdown(f"""
296
  **Methodology Updates:**
297
+ * **Historical Data:** US Annual CO₂ emissions from fossil fuels and industry (2020-2024). Land-use change emissions are not included. [Source: Our World in Data](https://ourworldindata.org/profile/co2/united-states).
298
+ * **Baseline Emissions:** Compared against approx. {US_BASELINE_MMT} MMT (EPA Gross GHG Inventory).
299
  * **Efficiency Logic:** Emissions Factor is calculated dynamically based on the **Electrical Efficiency** slider ({turbine_eff_percent}% currently selected).
300
  * *Formula:* `EF = (Benchmark Carbon Content) / Efficiency %`
301
+ * Based on standard [NREL](https://docs.nrel.gov/docs/fy21osti/80580.pdf) life cycle emissions data for Combined Cycle Gas Turbines (486 gCO₂e/kWh @ 60% efficiency).
302
  """)