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

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.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyGWP-0.0.2-py2-none-any.whl (7.9 kB view details)

Uploaded Python 2

File details

Details for the file PyGWP-0.0.2.tar.gz.

File metadata

  • Download URL: PyGWP-0.0.2.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.15

File hashes

Hashes for PyGWP-0.0.2.tar.gz
Algorithm Hash digest
SHA256 b11f1c99ba834da4dae273f883c452921012317b519d22151d918c06a91bfb46
MD5 fa803e7d33115fd3a341478762b32c4d
BLAKE2b-256 1c2282e2d7bb53ffa8d2fb5b024b455e6ba97691b8fa7f3725cf3cef790ab550

See more details on using hashes here.

File details

Details for the file PyGWP-0.0.2-py2-none-any.whl.

File metadata

  • Download URL: PyGWP-0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.15

File hashes

Hashes for PyGWP-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 8f56e857b71e4adb3c8d7745059729f1752175ccf3d0aad2b58202c05cd2ff8e
MD5 5e4d3453a52070434d9e47a007e76827
BLAKE2b-256 fa0aaef4f4b53dda21529277d3d44953e71a4d1e17c0ce416bfbfdfd4f14310d

See more details on using hashes here.

Supported by

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