bw-functional 0b94__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.
Files changed (24) hide show
  1. {bw_functional-0b94/bw_functional.egg-info → bw_functional-0b95}/PKG-INFO +1 -1
  2. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/database.py +19 -2
  3. {bw_functional-0b94 → bw_functional-0b95/bw_functional.egg-info}/PKG-INFO +1 -1
  4. {bw_functional-0b94 → bw_functional-0b95}/LICENSE +0 -0
  5. {bw_functional-0b94 → bw_functional-0b95}/MANIFEST.in +0 -0
  6. {bw_functional-0b94 → bw_functional-0b95}/README.md +0 -0
  7. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/__init__.py +0 -0
  8. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/allocation.py +0 -0
  9. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/convert.py +0 -0
  10. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/edge_classes.py +0 -0
  11. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/node_classes.py +0 -0
  12. {bw_functional-0b94 → bw_functional-0b95}/bw_functional/update.py +0 -0
  13. {bw_functional-0b94 → bw_functional-0b95}/bw_functional.egg-info/SOURCES.txt +0 -0
  14. {bw_functional-0b94 → bw_functional-0b95}/bw_functional.egg-info/dependency_links.txt +0 -0
  15. {bw_functional-0b94 → bw_functional-0b95}/bw_functional.egg-info/requires.txt +0 -0
  16. {bw_functional-0b94 → bw_functional-0b95}/bw_functional.egg-info/top_level.txt +0 -0
  17. {bw_functional-0b94 → bw_functional-0b95}/pyproject.toml +0 -0
  18. {bw_functional-0b94 → bw_functional-0b95}/setup.cfg +0 -0
  19. {bw_functional-0b94 → bw_functional-0b95}/setup.py +0 -0
  20. {bw_functional-0b94 → bw_functional-0b95}/tests/test_allocation.py +0 -0
  21. {bw_functional-0b94 → bw_functional-0b95}/tests/test_database.py +0 -0
  22. {bw_functional-0b94 → bw_functional-0b95}/tests/test_mf_node.py +0 -0
  23. {bw_functional-0b94 → bw_functional-0b95}/tests/test_process_node.py +0 -0
  24. {bw_functional-0b94 → 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: 0b94
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>
@@ -266,7 +266,8 @@ class Build:
266
266
  """
267
267
  consumption = Build.consumption(nodes, exchanges)
268
268
  production = Build.production(nodes, exchanges)
269
- return pd.concat([consumption, production])
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: 0b94
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