bw-functional 0b93__tar.gz → 0b95__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bw_functional-0b93/bw_functional.egg-info → bw_functional-0b95}/PKG-INFO +1 -1
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/convert.py +4 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/database.py +19 -2
- {bw_functional-0b93 → bw_functional-0b95/bw_functional.egg-info}/PKG-INFO +1 -1
- {bw_functional-0b93 → bw_functional-0b95}/LICENSE +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/MANIFEST.in +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/README.md +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/__init__.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/allocation.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/edge_classes.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/node_classes.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional/update.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional.egg-info/SOURCES.txt +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional.egg-info/dependency_links.txt +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional.egg-info/requires.txt +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/bw_functional.egg-info/top_level.txt +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/pyproject.toml +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/setup.cfg +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/setup.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/tests/test_allocation.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/tests/test_database.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/tests/test_mf_node.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/tests/test_process_node.py +0 -0
- {bw_functional-0b93 → bw_functional-0b95}/tests/test_product_node.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bw-functional
|
|
3
|
-
Version:
|
|
3
|
+
Version: 0b95
|
|
4
4
|
Summary: Code for handling multifunctional activities in Brightway
|
|
5
5
|
Author-email: Chris Mutel <cmutel@gmail.com>, Marin Visscher <m.r.visscher@cml.leidenuniv.nl>
|
|
6
6
|
Maintainer-email: Marin Visscher <m.r.visscher@cml.leidenuniv.nl>
|
|
@@ -44,6 +44,10 @@ class SQLiteToFunctionalSQLite:
|
|
|
44
44
|
function_key, function = cls.create_function(key, ds, amount=exchange["amount"])
|
|
45
45
|
ds["exchanges"].pop(index)
|
|
46
46
|
|
|
47
|
+
ds.pop("reference product", None)
|
|
48
|
+
ds.pop("product", None)
|
|
49
|
+
ds.pop("unit", None)
|
|
50
|
+
|
|
47
51
|
return {key: ds, function_key: function}
|
|
48
52
|
|
|
49
53
|
@staticmethod
|
|
@@ -266,7 +266,8 @@ class Build:
|
|
|
266
266
|
"""
|
|
267
267
|
consumption = Build.consumption(nodes, exchanges)
|
|
268
268
|
production = Build.production(nodes, exchanges)
|
|
269
|
-
|
|
269
|
+
substitution = Build.substitution(nodes, exchanges)
|
|
270
|
+
return pd.concat([consumption, production, substitution])
|
|
270
271
|
|
|
271
272
|
@staticmethod
|
|
272
273
|
def biosphere(nodes, exchanges):
|
|
@@ -300,6 +301,22 @@ class Build:
|
|
|
300
301
|
x["flip"] = True
|
|
301
302
|
return x[["row", "col", "amount", "flip"] + UNCERTAINTY_FIELDS]
|
|
302
303
|
|
|
304
|
+
@staticmethod
|
|
305
|
+
def substitution(nodes, exchanges):
|
|
306
|
+
"""
|
|
307
|
+
Constructs the consumption flows by allocating technosphere exchanges.
|
|
308
|
+
|
|
309
|
+
Args:
|
|
310
|
+
nodes (pd.DataFrame): The dataframe containing node data.
|
|
311
|
+
exchanges (pd.DataFrame): The dataframe containing exchange data.
|
|
312
|
+
|
|
313
|
+
Returns:
|
|
314
|
+
pd.DataFrame: A dataframe containing allocated consumption flows with additional metadata.
|
|
315
|
+
"""
|
|
316
|
+
x = Build.allocated(nodes, exchanges, ["substitution"])
|
|
317
|
+
x["flip"] = False
|
|
318
|
+
return x[["row", "col", "amount", "flip"] + UNCERTAINTY_FIELDS]
|
|
319
|
+
|
|
303
320
|
@staticmethod
|
|
304
321
|
def production(nodes, exchanges):
|
|
305
322
|
"""
|
|
@@ -389,7 +406,7 @@ class Mutate:
|
|
|
389
406
|
# Distributions that use the standard method
|
|
390
407
|
standard = [sa.NormalUncertainty.id, sa.UniformUncertainty.id, sa.TriangularUncertainty.id,
|
|
391
408
|
sa.WeibullUncertainty.id, sa.GammaUncertainty.id, sa.GeneralizedExtremeValueUncertainty.id,
|
|
392
|
-
sa.UndefinedUncertainty, sa.NoUncertainty]
|
|
409
|
+
sa.UndefinedUncertainty.id, sa.NoUncertainty.id]
|
|
393
410
|
# Lognormal uncertainty
|
|
394
411
|
ln = [sa.LognormalUncertainty.id]
|
|
395
412
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bw-functional
|
|
3
|
-
Version:
|
|
3
|
+
Version: 0b95
|
|
4
4
|
Summary: Code for handling multifunctional activities in Brightway
|
|
5
5
|
Author-email: Chris Mutel <cmutel@gmail.com>, Marin Visscher <m.r.visscher@cml.leidenuniv.nl>
|
|
6
6
|
Maintainer-email: Marin Visscher <m.r.visscher@cml.leidenuniv.nl>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|