-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
73 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import olca_ipc as ipc | ||
import olca_schema as o | ||
|
||
client = ipc.Client() | ||
|
||
# get the impact assessment method | ||
method = client.get(o.ImpactMethod, "bf665139-3159-45ef-9b00-f439251d2b5b") | ||
|
||
# select the first normalisation & weighting set for the example; | ||
# make sure the method has nw-sets | ||
nwset = method.nw_sets[0] | ||
|
||
# run a calculation | ||
result = client.calculate(o.CalculationSetup( | ||
target=o.Ref( | ||
id="7d1cbce0-b5b3-47ba-95b5-014ab3c7f569", | ||
ref_type=o.RefType.ProductSystem, | ||
), | ||
impact_method=method.to_ref(), | ||
nw_set=nwset.to_ref(), | ||
)) | ||
result.wait_until_ready() | ||
|
||
# print the normalized results | ||
for nr in result.get_normalized_impacts(): | ||
print(f"{nr.impact_category.name} :: {nr.amount}") | ||
|
||
result.dispose() |
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,28 @@ | ||
import olca_ipc as ipc | ||
import olca_schema as o | ||
|
||
client = ipc.Client() | ||
|
||
# get the impact assessment method | ||
method = client.get(o.ImpactMethod, "bf665139-3159-45ef-9b00-f439251d2b5b") | ||
|
||
# select the first normalisation & weighting set for the example; | ||
# make sure the method has nw-sets | ||
nwset = method.nw_sets[0] | ||
|
||
# run a calculation | ||
result = client.calculate(o.CalculationSetup( | ||
target=o.Ref( | ||
id="7d1cbce0-b5b3-47ba-95b5-014ab3c7f569", | ||
ref_type=o.RefType.ProductSystem, | ||
), | ||
impact_method=method.to_ref(), | ||
nw_set=nwset.to_ref(), | ||
)) | ||
result.wait_until_ready() | ||
|
||
# print the weighted results | ||
for wr in result.get_weighted_impacts(): | ||
print(f"{wr.impact_category.name} :: {wr.amount} {nwset.weighted_score_unit}") | ||
|
||
result.dispose() |