-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
342adb0
commit f720420
Showing
4 changed files
with
98 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
import bw2data as bd | ||
from pathlib import Path | ||
import yaml | ||
|
||
DATA_DIR = Path(__file__).resolve().parent / "data" | ||
|
||
|
||
def load_ei310_mapping(): | ||
with open(DATA_DIR / "mapping_ei310.yaml", "r", encoding="utf-8") as stream: | ||
mappings = yaml.safe_load(stream) | ||
return mappings | ||
|
||
def check_presence_biosphere_database(biosphere_name: str) -> str: | ||
""" | ||
Check that the biosphere database is present in the current project. | ||
""" | ||
|
||
if biosphere_name not in bd.databases: | ||
print("RELICS requires the name of your biosphere database.") | ||
print( | ||
"Please enter the name of your biosphere database as it appears in your project." | ||
) | ||
print(bd.databases) | ||
biosphere_name = input("Name of the biosphere database: ") | ||
|
||
return biosphere_name | ||
|
||
|
||
def check_biosphere_database(): | ||
biosphere_name = check_presence_biosphere_database("biosphere3") | ||
ERROR = "IPCC LCIA methods for ecoinvent biosphere flows only; install base ecoinvent data" | ||
assert "biosphere3" in bd.databases, ERROR | ||
assert biosphere_name in bd.databases, ERROR | ||
return biosphere_name | ||
|
||
|
||
def check_biosphere_version() -> tuple: | ||
def check_biosphere_version(biosphere_name) -> tuple: | ||
# check for the presence of Beryllium II | ||
if "Beryllium II" not in [f["name"] for f in bd.Database("biosphere3")]: | ||
if "Beryllium II" not in [f["name"] for f in bd.Database(biosphere_name)]: | ||
bw2io_version = (0, 8, 7) | ||
else: | ||
bw2io_version = (0, 8, 8) | ||
if "Methylchloride" in [f["name"] for f in bd.Database(biosphere_name)]: | ||
bw2io_version = (0, 8, 12) | ||
else: | ||
bw2io_version = (0, 8, 8) | ||
|
||
return bw2io_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Ethane, 1,1,1,2-tetrafluoro-, HFC-134a: 1,1,1,2-Tetrafluoroethane | ||
Ethane, 1,1,1-trichloro-, HCFC-140: 1,1,1-Trichloroethane | ||
Ethane, 1,1,1-trifluoro-, HFC-143a: 1,1,1-Trifluoroethane | ||
Ethane, 1,1,2-trichloro-1,2,2-trifluoro-, CFC-113: 1,1,2-Trichloro-1,2,2-trifluoroethane | ||
Ethane, 1,1-dichloro-1-fluoro-, HCFC-141b: 1,1-Dichloro-1-fluoroethane | ||
Ethane, 1,1-difluoro-, HFC-152a: 1,1-Difluoroethane | ||
Ethane, 1,2-dichloro-: Ethylene dichloride | ||
Methane, chloro-fluoro-, HCFC-31: Chloro-fluoromethane | ||
Ethane, 1,2-dichloro-1,1,2,2-tetrafluoro-, CFC-114: 1,2-Dichloro-1,1,2,2-tetrafluoroethane | ||
Ethane, 1-chloro-1,1-difluoro-, HCFC-142b: 1-Chloro-1,1-difluoroethane | ||
Ethane, 2,2-dichloro-1,1,1-trifluoro-, HCFC-123: 2,2-Dichloro-1,1,1-trifluoroethane | ||
Ethane, 2-chloro-1,1,1,2-tetrafluoro-, HCFC-124: 2-Chloro-1,1,1,2-tetrafluoroethane | ||
Ethane, chloropentafluoro-, CFC-115: Monochloropentafluoroethane | ||
Ethane, hexafluoro-, HFC-116: Hexafluoroethane | ||
Ethane, pentafluoro-, HFC-125: Pentafluoroethane | ||
Methane, chlorodifluoro-, HCFC-22: Chlorodifluoromethane | ||
Methane, chlorotrifluoro-, CFC-13: Chlorotrifluoromethane | ||
Methane, dichloro-, HCC-30: Dichloromethane | ||
Methane, dichlorodifluoro-, CFC-12: Dichlorodifluoromethane | ||
Methane, dichlorofluoro-, HCFC-21: Dichlorofluoromethane | ||
Methane, difluoro-, HFC-32: Difluoromethane | ||
Methane, monochloro-, R-40: Methylchloride | ||
Methane, tetrachloro-, R-10: Carbon tetrachloride | ||
Methane, tetrafluoro-, R-14: Tetrafluoromethane | ||
Methane, trichlorofluoro-, CFC-11: Trichlorofluoromethane | ||
Methane, trifluoro-, HFC-23: Trifluoromethane | ||
VOC, volatile organic compounds, unspecified origin: VOC, volatile organic compounds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = (0, 9, 6) | ||
version = (0, 9, 7) |