diff --git a/README.md b/README.md index 84c32a4..f00782e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The LCIA Formatter v1 was peer-reviewed internally at USEPA and externally throu |ImpactWorld+ Endpoint*|International Reference Center for Life Cycle of Products, Services and Systems (CIRAIG)|[ImpactWorld+](http://www.impactworldplus.org/en/team.php)| |IPCC GWP|Intergovernmental Panel on Climate Change (IPCC)| | |FEDEFL Inventory Methods|US Environmental Protection Agency|[FEDEFL Inventory Methods](https://github.com/USEPA/LCIAformatter/wiki/Inventory-Methods)| +|Cumulative Energy Demand|Federal LCA Commons|[FEDEFL Inventory Methods](https://github.com/USEPA/LCIAformatter/wiki/Inventory-Methods)| \* only works on Windows installations diff --git a/lciafmt/__init__.py b/lciafmt/__init__.py index 3843c40..5c9868f 100644 --- a/lciafmt/__init__.py +++ b/lciafmt/__init__.py @@ -13,6 +13,7 @@ import pandas as pd import lciafmt.cache as cache +import lciafmt.ced as ced import lciafmt.fmap as fmap import lciafmt.jsonld as jsonld import lciafmt.traci as traci @@ -34,6 +35,7 @@ class Method(Enum): TRACI = "TRACI 2.1" RECIPE_2016 = "ReCiPe 2016" FEDEFL_INV = "FEDEFL Inventory" + CED = "Cumulative Energy Demand" ImpactWorld = "ImpactWorld" IPCC = "IPCC" @@ -122,6 +124,8 @@ def get_method(method_id, add_factors_for_missing_contexts=True, return ipcc.get() if method_id == Method.FEDEFL_INV: return fedefl_inventory.get(subset) + if method_id == Method.CED: + return ced.get() def clear_cache(): diff --git a/lciafmt/ced.py b/lciafmt/ced.py new file mode 100644 index 0000000..a6c531c --- /dev/null +++ b/lciafmt/ced.py @@ -0,0 +1,60 @@ +# ced.py (lciafmt) +# !/usr/bin/env python3 +# coding=utf-8 +""" +Generate method for Cumulative Energy Demand (CED) +""" + +import numpy as np +import pandas as pd + +import lciafmt +from lciafmt.util import store_method + + +def get() -> pd.DataFrame(): + + inv_orig = lciafmt.get_method(method_id = 'FEDEFL_INV', subset = ['ced']) + inv = inv_orig.copy() + inv['Indicator'] = '' + inv['Method'] = 'Cumulative Energy Demand' + + conditions = [ + inv['Flowable'].isin(['Wood, primary forest']), + inv['Flowable'].isin(['Biomass', 'Softwood', 'Hardwood', 'Wood']), + inv['Flowable'].isin(['Energy, hydro']), + inv['Flowable'].str.contains('|'.join(['wind', 'solar', 'geothermal'])), + inv['Flowable'].str.contains('Uranium'), + inv['Flowable'].str.contains('|'.join(['Coal', 'Oil', 'Crude', + 'gas', 'Methane'])), + ] + + indicators = ['Non-renewable, biomass', + 'Renewable, biomass', + 'Renewable, water', + 'Renewable, wind, solar, geothermal', + 'Non-renewable, nuclear', + 'Non-renewable, fossil', + ] + inv['Indicator'] = np.select(conditions, indicators, default='') + + ## Original CED Method included the + # "Energy, fossil, unspecified" technosphere flow; + # this has been dropped + # https://www.lcacommons.gov/lca-collaboration/National_Renewable_Energy_Laboratory/USLCI_Database_Public/dataset/FLOW/46dc4693-2f24-39d2-b69f-dd059737fd5e + + ## Original CED Method used HHV for biomass/wood flows + # Some wood flows were removed after the original method in FEDEFLv1.0.8 + + # Dropped flows from FEDEFL inv method: "Hydrogen", "Energy, heat" + inv = inv.query('Indicator != ""').reset_index(drop=True) + + return inv + + +if __name__ == "__main__": + method = lciafmt.Method.CED + df = get() + store_method(df, method) + lciafmt.util.save_json(method, df) + # lciafmt.util.save_json(method, df, write_flows=True) diff --git a/lciafmt/data/description.yaml b/lciafmt/data/description.yaml index de20bad..225ac34 100644 --- a/lciafmt/data/description.yaml +++ b/lciafmt/data/description.yaml @@ -7,6 +7,7 @@ description: >+ Source citation: [citation] +mapping: >+ [Method] flowable and context input files are maintained in the FEDEFL GitHub Repository: https://github.com/USEPA/fedelemflowlist diff --git a/lciafmt/data/lcia.bib b/lciafmt/data/lcia.bib index 5f96129..f6a3bb0 100644 --- a/lciafmt/data/lcia.bib +++ b/lciafmt/data/lcia.bib @@ -45,3 +45,12 @@ @incollection{smith_earths_2021 author = {Smith, Chris and Nicholls, Zebedee R. J. and Armour, Kyle and Collins, William and Forster, Piers and Meinshausen, Malte and Palmer, Matthew D. and Watanabe, Masahiro}, year = {2021}, } + +@report{frischknecht_implementation_2007, + title = {Implementation of life cycle impact assessment methods}, + url = {https://esu-services.ch/fileadmin/download/publicLCI/03_LCIA-Implementation.pdf}, + number = {ecoinvent report No. 3}, + author = {Frischknecht, Rolf and Jungbluth, Niels and Althaus, H. J. and Bauer, C. and Doka, G. and Dones, R. and Hischier, R. and Hellweg, S. and Humbert, S. and Köllner, T.}, + urldate = {2024-11-13}, + year = {2007}, +} diff --git a/lciafmt/data/methods.json b/lciafmt/data/methods.json index d971d5f..5a51a92 100644 --- a/lciafmt/data/methods.json +++ b/lciafmt/data/methods.json @@ -35,7 +35,7 @@ "name": "FEDEFL Inventory", "version": "1.0.0", "path": "fedefl", - "url": "http://www.github.com/usepa//Federal-LCA-Commons-Elementary-Flow-List", + "url": "https://github.com/USEPA/fedelemflowlist/blob/master/fedelemflowlist/subset_list.py", "citation": "", "source_type": "FEDEFL Python function" }, @@ -67,6 +67,17 @@ }, "citation": "Forster and Ramaswamy 2007 (AR4), Myhre and Shindell 2013 (AR5), Forster and Storelvmo 2021 (AR6)", "source_type": "csv" + }, + { + "id": "CED", + "name": "Cumulative Energy Demand", + "version": "1.0", + "detail_note": "All heating values are per the FEDEFL, and the list of external references is found on the EPA FEDEFL GitHub at: https://github.com/USEPA/fedelemflowlist. This CED method is based on the categorization scheme used in Frischknecht et al. (2007) found in the ecoinvent report 'Implementation of Life Cycle Impact Assessment Methods.'", + "path": "fedefl", + "bib_id": "frischknecht_implementation_2007", + "url": "https://github.com/USEPA/fedelemflowlist/blob/master/fedelemflowlist/subset_list.py", + "citation": "Frischknecht et al. 2007", + "source_type": "" } ] diff --git a/lciafmt/fedefl_inventory.py b/lciafmt/fedefl_inventory.py index 4b243c4..e72cd92 100644 --- a/lciafmt/fedefl_inventory.py +++ b/lciafmt/fedefl_inventory.py @@ -39,7 +39,7 @@ def get(subset=None) -> pd.DataFrame: axis=1, inplace=True) flows['Indicator'] = inventory flows['Indicator unit'] = subsets.get_inventory_unit(inventory) - flows['Characterization Factor'] = 1 + flows['Characterization Factor'] = 1.0 # Apply unit conversions where flow unit differs from indicator unit flows_w_conversion = pd.merge(flows, alt_units, how='left', @@ -56,3 +56,6 @@ def get(subset=None) -> pd.DataFrame: method['Method'] = 'FEDEFL Inventory' return method + +if __name__ == "__main__": + df = get() diff --git a/lciafmt/util.py b/lciafmt/util.py index 6ef28e1..ffa47e7 100644 --- a/lciafmt/util.py +++ b/lciafmt/util.py @@ -187,6 +187,8 @@ def generate_method_description(name: str, else: method_meta = method.get_metadata() desc += generic['description'] + if 'mapping' in method_meta: + desc += generic['mapping'] if 'detail_note' in method_meta: desc += method_meta['detail_note'] if 'methods' in method_meta: