Skip to content

Commit

Permalink
Special case rare earths
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Mar 18, 2019
1 parent 67863dc commit 5fca08d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ocelot/transformations/cutoff/allocation.py
Expand Up @@ -30,6 +30,16 @@ def no_allocation(dataset):
return [dataset]


def missing_formulas(dataset):
"""Return boolean of whether each technosphere and biosphere are parameterized.
Used to check if datasets which are indicated for combined production can be used as such."""
TYPES = {'from environment', 'to environment', 'from technosphere'}
return not all(exc.get('formula')
for exc in dataset['exchanges']
if exc['type'] in TYPES)


def choose_allocation_method(dataset):
"""Choose from among the following allocation methods:
Expand Down Expand Up @@ -118,6 +128,10 @@ def choose_allocation_method(dataset):
return "combined production without products"
elif allocatable_byproducts:
return "combined production with byproducts"
# elif missing_formulas(dataset):
elif dataset['name'] == ('rare earth oxides production '
'from bastnäsite concentrate'):
return "economic"
else:
return "combined production"
elif negative_reference_production:
Expand Down

0 comments on commit 5fca08d

Please sign in to comment.