From f6b48be29e891ae3edb858b0d71918d8d717a937 Mon Sep 17 00:00:00 2001 From: Chris Mutel Date: Mon, 8 Jul 2024 08:51:31 +0200 Subject: [PATCH] Change to `manual_allocation` property --- README.md | 2 +- multifunctional/allocation.py | 2 +- tests/fixtures/basic.py | 4 ++-- tests/test_allocation.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 71ba7d3..2328227 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ There is currently no built-in functionality to determine if an edge is function * `price`: Does economic allocation based on the property "price" in each functional edge. * `mass`: Does economic allocation based on the property "mass" in each functional edge. -* `manual`: Does allocation based on the property "manual" in each functional edge. Doesn't normalize by amount of production exchange. +* `manual_allocation`: Does allocation based on the property "manual_allocation" in each functional edge. Doesn't normalize by amount of production exchange. * `equal`: Splits burdens equally among all functional edges. Property-based allocation assumes that each functional edge has a `properties` dictionary, and this dictionary has the relevant key with a corresponding numeric value. For example, for `price` allocation, each functional edge needs to have `'properties' = {'price': some_number}`. diff --git a/multifunctional/allocation.py b/multifunctional/allocation.py index 459949b..8a8c6a8 100644 --- a/multifunctional/allocation.py +++ b/multifunctional/allocation.py @@ -166,7 +166,7 @@ def property_allocation( allocation_strategies = { "price": property_allocation("price"), - "manual": property_allocation("manual", normalize_by_production_amount=False), + "manual_allocation": property_allocation("manual_allocation", normalize_by_production_amount=False), "mass": property_allocation("mass"), "equal": partial(generic_allocation, func=lambda x, y: 1.0), } diff --git a/tests/fixtures/basic.py b/tests/fixtures/basic.py index 1a5f498..f2db23a 100644 --- a/tests/fixtures/basic.py +++ b/tests/fixtures/basic.py @@ -22,7 +22,7 @@ "properties": { "price": 7, "mass": 6, - "manual": 2, + "manual_allocation": 2, }, }, { @@ -34,7 +34,7 @@ "properties": { "price": 12, "mass": 4, - "manual": 8, + "manual_allocation": 8, }, }, { diff --git a/tests/test_allocation.py b/tests/test_allocation.py index 409f8d3..32de646 100644 --- a/tests/test_allocation.py +++ b/tests/test_allocation.py @@ -141,7 +141,7 @@ def test_price_allocation(basic): def test_manual_allocation(basic): - basic.metadata["default_allocation"] = "manual" + basic.metadata["default_allocation"] = "manual_allocation" bd.get_node(code="1").allocate() check_basic_allocation_results( 0.2 * 10, 0.8 * 10, basic