Skip to main content

Cython functions to speed up Brightway2 LCA calculations

Project description

# Brightway2 speedups

A series of function written in [Cython](http://cython.org/) that speed up critical functions to improve the overall performance of the [Brightway2 life cycle assessment framework](https://brightwaylca.org).

In order to avoid having to have Cython as a dependency, this library includes both the pyx and Cython-generated c code, and is distributed as pre-compiled [wheels](https://pypi.python.org/pypi/wheel), except on Linux where access to a C compiler is assumed.

## Building C files

cython -t bw2speedups/_consolidate.pyx bw2speedups/_indexer.pyx bw2speedups/_find_first.pyx

## Building shared libraries

Although you can do this inplace, in my experience it is easier to just install the library in a temporary environment. You don’t want to deal with .so files in the source repository.

## Testing

Install the library into a temporary environment, then manually run the separate test files, i.e. python bw2speedupds/test/test_consolidate.py. This isn’t the most elegant, but it will do for now.

## Building wheels

pip install wheel python setup.py bdist_wheel

Note that this has to be done separately for each OS and environment, i.e. Windows 32-bit and 64-bit versions of Python are separate wheels, even with the same version of Windows.

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

bw2speedups-3.1.tar.gz (154.5 kB view details)

Uploaded Source

File details

Details for the file bw2speedups-3.1.tar.gz.

File metadata

  • Download URL: bw2speedups-3.1.tar.gz
  • Upload date:
  • Size: 154.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for bw2speedups-3.1.tar.gz
Algorithm Hash digest
SHA256 bb2adaf0b83355a73de86b88206fca1a1dadad9362918cd739f74a775a79cd74
MD5 a34e7181fe8b064cbe41a6ca3497539c
BLAKE2b-256 7f2bc6aa6503c3bde62bf0917b780a91a7e6ecc604968d4c9d64f3c20f5d5f24

See more details on using hashes here.

Supported by

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