-
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
Showing
6 changed files
with
156 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
"""Emission data class | ||
""" | ||
|
||
__author__ = "Rahul Kakodkar" | ||
__copyright__ = "Copyright 2022, Multi-parametric Optimization & Control Lab" | ||
__credits__ = ["Rahul Kakodkar", "Marco De Sousa", "Betsie Montano Flores", "Efstratios N. Pistikopoulos"] | ||
__license__ = "Open" | ||
__version__ = "2.0.0" | ||
__maintainer__ = "Rahul Kakodkar" | ||
__email__ = "cacodcar@tamu.edu" | ||
__status__ = "Production" | ||
|
||
from dataclasses import dataclass | ||
from typing import Dict | ||
|
||
# from ..components.resource import Resource | ||
|
||
|
||
# @dataclass | ||
# class Material: | ||
# """ | ||
# Materials are needed to set up processes. They could result in the emission, toxicty, etc. | ||
|
||
# Args: | ||
# name (str): name of the material, short ones are better to deal with | ||
# resource_cons (Dict[Resource, float], optional): Resources consumed per unit basis of Material. Defaults to 0. | ||
# basis (str, optional): Unit basis for material. Defaults to 'unit. | ||
# gwp (float, optional): global warming potential per unit basis of Material produced. Defaults to 0. | ||
# toxicity (float, optional): toxicity potential per unit basis of Material produced. Defaults to 0. | ||
# citation (str, optional): Add citation. Defaults to 'citation needed'. | ||
# label (str, optional): Longer descriptive label if required. Defaults to '' | ||
|
||
# Examples: | ||
# Materials can be declared using the resources they consume | ||
|
||
# >>> Steel = Material(name='Steel', gwp=0.8, resource_cons = {H2O: 3.94}, toxicity=40, basis= 'kg', label='Steel') | ||
|
||
# """ | ||
|
||
# name: str | ||
# resource_cons: Dict[Resource, float] = None | ||
# gwp: float = None | ||
# toxicity: float = None | ||
# basis: str = 'unit' | ||
# citation: str = 'citation needed' | ||
# label: str = '' | ||
|
||
# def __repr__(self): | ||
# return self.name | ||
|
||
# def __hash__(self): | ||
# return hash(self.name) | ||
|
||
# def __eq__(self, other): | ||
# return self.name == other.name | ||
|
||
|
||
# from dataclasses import dataclass | ||
|
||
@dataclass | ||
class Emission: | ||
"""Emisison are released when Resources are procured or Processes are run | ||
Args: | ||
name (str): name of emission type | ||
gwp20 (float): | ||
""" | ||
|
||
name: str | ||
# Global warming potential [kg CO2 eq.] | ||
gwp20: float = None | ||
gwp100: float = None | ||
gwp500: float = None | ||
# Global temperature potential [kg CO2 eq.] | ||
gtp20: float = None | ||
gtp100: float = None | ||
gtp500: float = None | ||
# Acidification potential [kg SO2eq.] | ||
ap: float = None | ||
# Eutrophication potential [CML assessment method: kg PO4eq. TRACI assessment method: kg N eq.] | ||
ep: float = None | ||
# Photochemical ozone creation potential [CML assessment method: kg C2H4 eq. TRACI assessment method: kg O3 eq.] | ||
pocp: float = None | ||
# Ozone depletion potential [CML assessment method: kg CFC-11 eq. TRACI assessment method: kg CFC-11 eq.] | ||
odp: float = None | ||
# Abiotic depletion potential for minerals and metals (non-fossil resources) [kg Sb eq.] | ||
adpmm: float = None | ||
# Abiotic depletion potential for fossil resources [MJ] | ||
adpff: float = None | ||
|
||
def __repr__(self): | ||
return self.name | ||
|
||
def __hash__(self): | ||
return hash(self.name) | ||
|
||
def __eq__(self, other): | ||
return self.name == other.name | ||
|
||
# # Create instances of the data class | ||
# '''All global warming and global temperature potentials have been updated with the latest IPCC Annual Report 6''' | ||
# CO2 = Emission(name = 'CO2', gwp20 = 1, gwp100 = 1, gwp500 = 1, gtp20 = 1, gtp100 = 1, gtp500 = 1, ap = 0, ep = 0, pocp = 0, odp = 0, adpmm = 0, adpff = 0) | ||
# CH4 = Emission(name = 'CH4', gwp20 = 81.2, gwp100 = 27.9, gwp500 = 7.95) | ||
# N20 = Emission(name = 'N2O', gwp20 = 273, gwp100 = 273, gwp500 = 130) | ||
|
||
# # Access attributes | ||
# print(CO2.gwp100) | ||
# print(CH4.gwp500) | ||
|
||
# # __repr__ method? | ||
# print(N20) | ||
|
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
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
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