Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flip sign on waste exchanges in imported database #82

Merged

Conversation

PascalLesage
Copy link
Contributor

Rationale: The convention for waste exchanges in some databases,
notably the ecoivent database, is the following:
- waste exchanges produced by an activity are stored as negative
  inputs
- waste exchanges flowing into a waste treatment activity have a
  negative
In SimaPro, produced waste are stored as positive inputs, and waste
treatment datasets have positive outputs.
If left as are, the supply of waste treatment services from the
linked-to database "other" to imported activities would have the
wrong sign.
This function flips the sign on all inputs from database "other" if
the production amount for that exchange in the activity for which it
is the reference flow is negative.

Note: the strategy needs to be run *after* matching with ecoinvent.
Strategy should be run as follows:
sp_imported.apply_strategy(functools.partial(flip_sign_on_waste, other="name_of_other"))

Closing misplaced issue brightway-lca/brightway2-data#66

    Rationale: The convention for waste exchanges in some databases,
    notably the ecoivent database, is the following:
    - waste exchanges produced by an activity are stored as negative
      inputs
    - waste exchanges flowing into a waste treatment activity have a
      negative
    In SimaPro, produced waste are stored as positive inputs, and waste
    treatment datasets have positive outputs.
    If left as are, the supply of waste treatment services from the
    linked-to database "other" to imported activities would have the
    wrong sign.
    This function flips the sign on all inputs from database "other" if
    the production amount for that exchange in the activity for which it
    is the reference flow is negative.

    Note: the strategy needs to be run *after* matching with ecoinvent.
    Strategy should be run as follows:
    sp_imported.apply_strategy(functools.partial(flip_sign_on_waste, other="name_of_other"))
@PascalLesage
Copy link
Contributor Author

Tests failing because of #78.
Tests pass locally.

@cmutel cmutel merged commit 65e9244 into brightway-lca:master Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants