-
Notifications
You must be signed in to change notification settings - Fork 6
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
3 changed files
with
47 additions
and
2 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
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,43 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
''' | ||
EXPOsan: Exposition of sanitation and resource recovery systems | ||
This module is developed by: | ||
Yalin Li <[email protected]> | ||
This module is under the University of Illinois/NCSA Open Source License. | ||
Please refer to https://github.com/QSD-Group/EXPOsan/blob/main/LICENSE.txt | ||
for license details. | ||
''' | ||
|
||
__all__ = ('test_saf',) | ||
|
||
def test_saf(): | ||
from numpy.testing import assert_allclose | ||
from exposan import saf | ||
|
||
# Because of different CF settings for ImpactItem with the same ID | ||
from qsdsan.utils import clear_lca_registries | ||
clear_lca_registries() | ||
|
||
saf.load(configuration='baseline') | ||
rtol = 0.01 | ||
assert_allclose(saf.get_MFSP(saf.sys), 3.95586679600505, rtol=rtol) | ||
assert_allclose(saf.get_GWP(saf.sys), -5.394022805849971, rtol=rtol) | ||
|
||
saf.load(configuration='EC') | ||
saf.simulate_and_print(saf.sys) | ||
assert_allclose(saf.get_MFSP(saf.sys), 11.876241988677974, rtol=rtol) | ||
assert_allclose(saf.get_GWP(saf.sys), 2.8357334832704386, rtol=rtol) | ||
|
||
saf.load(configuration='EC-Future') | ||
saf.simulate_and_print(saf.sys) | ||
assert_allclose(saf.get_MFSP(saf.sys), 3.821113328378629, rtol=rtol) | ||
assert_allclose(saf.get_GWP(saf.sys), -8.475883955624251, rtol=rtol) | ||
|
||
|
||
if __name__ == '__main__': | ||
test_saf() |