Skip to main content

A CO2-equivalent computer based on static or dynamic CO2-relative global warming potentials coded in Python27, PyGWP.

Project description

PyGWP - A CO2-equivalent computer based on static or dynamic CO2-relative global warming potentials.

Sources

Installation

We are going to use a package management system to install and manage software packages written in Python, namely pip. Open a session in your OS shell prompt and type

pip install pygwp

Or using a non-python-builtin approach, namely git,

git clone git://github.com/lfaucheux/PyGWP.git
cd PyGWP
python setup.py install

Requirements

Use cases

  • Scientific modelling

Example usage:

>>> from PyGWP import GWPBasedCO2eq
>>> dyn_gwp20 = GWPBasedCO2eq(
...     first_year      = 2020,
...     project_horizon = 5,
...     GWP_horizon     = 20,
...     static          = False
... )
>>> ghgs_weight_per_weight_of_output_inventory_flow = {'CO2':1., 'N2O':.0, 'CH4':.0}
>>> co2eq_traj = dyn_gwp20.co2eq_yields_trajectory_computer(
...     ghgs_weight_per_weight_of_output_inventory_flow,
...     as_row_array=False
... )
>>> co2eq_traj['as_array']
array([[1.        ],
       [0.95764081],
       [0.91469171],
       [0.87112496],
       [0.82691128]])
>>> co2eq_traj['as_dict']
{2024: 0.82691127746144444, 2020: 1.0, 2021: 0.95764080833063492, 2022: 0.91469171438570718, 2023: 0.87112496115582216}

>>> co2eq_traj = dyn_gwp20.co2eq_yields_trajectory_computer({'CO2':.0,'N2O':1.,'CH4':.0})
>>> co2eq_traj['as_array']
array([[292.33637282, 278.90543843, 265.35617058, 251.68752668,
        237.89845498]])


>>> co2eq_traj = dyn_gwp20.co2eq_yields_trajectory_computer({'CO2':.0,'N2O':.0,'CH4':1.})
>>> co2eq_traj['as_array']
array([[72.2209832 , 70.75950679, 69.17102216, 67.44449179, 65.56791893]])

>>> sta_gwp20  = GWPBasedCO2eq(
...     first_year      = 2020,
...     project_horizon = 5,
...     GWP_horizon     = 20,
...     static          = True
... )                                           
>>> co2eq_traj = sta_gwp20.co2eq_yields_trajectory_computer({'CO2':.0, 'N2O':.0, 'CH4':1.})
>>> co2eq_traj['as_array']
array([[72.2209832, 72.2209832, 72.2209832, 72.2209832, 72.2209832]])

License

Distributed under the MIT license

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyGWP-0.0.32.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

PyGWP-0.0.32-py2-none-any.whl (8.0 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page