ghgforcing

raw JSON →
0.1.7.1 verified Sat May 09 auth: no python

ghgforcing calculates the radiative forcing resulting from greenhouse gas emissions, following the IPCC AR5 method. Version 0.1.7.1 is the latest. Release cadence is low; library is in maintenance mode with no active development.

pip install ghgforcing
error TypeError: calculate_radiative_forcing() got an unexpected keyword argument 'ghg'
cause Parameter name changed in version 0.1.6 from 'ghg' to 'emissions'.
fix
Replace ghg= with emissions= in the function call.
error ValueError: time_horizon must be one of (20, 100, 500)
cause Unsupported time horizon value provided.
fix
Pass only 20, 100, or 500 as time_horizon.
gotcha Time horizon must be one of 20, 100, or 500. Other values may raise errors or produce incorrect results.
fix Use only 20, 100, or 500 as the time_horizon parameter.
deprecated The 'ghg' parameter name changed from 'ghg' to 'emissions' in version 0.1.6. Old code using ghg=... will raise TypeError.
fix Use keyword argument 'emissions' instead of 'ghg'.
gotcha Emissions dictionary keys must match exact IPCC compound names (e.g., 'CO2', 'CH4', 'N2O', 'SF6', 'CF4', etc.). Misspellings or alternative abbreviations (e.g., 'CO2e') are ignored silently.
fix Check the list of accepted species in the documentation or source code.

Calculate radiative forcing for a set of GHG emissions using IPCC AR5 methods.

import ghgforcing

# Define emissions in metric tons CO2 equivalent
emissions = {'CO2': 1000, 'CH4': 10, 'N2O': 1}

# Calculate radiative forcing (W/m^2) for a 20-year time horizon
rf = ghgforcing.calculate_radiative_forcing(emissions, time_horizon=20)
print(rf)