Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

bw_migrations

Migration data and utilities for Brightway IO and LCA in general

Build Status Coverage Status Build status

Most databases use their own nomenclature for classification systems, units, etc. These systems need to be matched when linking from one database to another. Often, a simple mapping is suitable, and tools like correspondentia are a good fit. However, sometimes one needs more complexity, e.g. change field X to Y, but only if field A has value B. When ecoinvent released version 3, they changed their unit of mesaure for water from kilograms to cubic meters. bw_migrations provides tools for this more complicated transformations, and is built around the following data format:

{
    # The fields on which to filter
    'fields': ['name', 'category', 'unit'],
    'data': [
        (
            # First element is input data in the order of `fields` above
            ('Water', 'air', 'kilogram'),
            # Second element is new values to substitute when all fields match
            {
                'unit': 'cubic meter',
                '__multiplier__': 0.001
            }
        )
    ]
}

And is implemented with the following pseudo-code:

for element in input_data:
    for original, new in migration['data']:
        if all(element[field] == original[field] for field in migration['fields']):
            element.update(dict(zip(migration['fields'], new)))

The actual code is a bit more complex, as bw_migrations can also do rescaling of probability distributions and disaggregation migrations (splitting one object into several outputs).

Metadata

Release files for bw-migrations 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for bw-migrations 0.2
File Size Uploaded
bw_migrations-0.2.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bw-migrations 0.2
File Interpreter ABI Platform
bw_migrations-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.5 kB

Release files / bw_migrations-0.2.tar.gz

Download URL bw_migrations-0.2.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
229d99a820cbcf18854ce6a3870552e8feebb89b9342abbafaa1a6d95a57dff9
BLAKE2b-256 checksum
How to use checksums
5156647c42d2c7ec041da11a04cb583e8ec4f14b3cae2ed420669ef5e443ae43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

Release files / bw_migrations-0.2-py3-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL bw_migrations-0.2-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c72ef245380e04cea610116ee42e9b27f63cd42b4760f6ef92258abea73c33fb
BLAKE2b-256 checksum
How to use checksums
d73b691c781ce78c18694e86536d8bf24a881661407cb93f8c4e9f6b70037714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page