Skip to content

Commit 08b6d4d

Browse files
committed
Try to make ds_policyscen on the fly from effort sharing inputs
1 parent 6211a4c commit 08b6d4d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ws.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from dotenv import dotenv_values
2323
from effortsharing.allocation import allocation
2424
from effortsharing.datareading import datareading
25+
from effortsharing.policyscens import policyscenadding
2526
from flask import Flask, jsonify, request
2627
from flask_cors import CORS
2728

@@ -668,7 +669,17 @@ def allocation_map(year, allocation_method):
668669
return {"data": rows, "domain": domain}
669670

670671

672+
def read_policy_scenarios():
673+
policyscenner = policyscenadding(
674+
input_file=config.effort_sharing_config,
675+
xr_total=ds_global,
676+
)
677+
policyscenner.read_engage_data()
678+
policyscenner.filter_and_convert()
679+
671680
# Reference pathway data (xr_policyscen.nc)
681+
# TODO once I got the engage data, I can try read_policy_scenarios()
682+
# ds_policyscenner = read_policy_scenarios()
672683
ds_policyscen = xr.open_dataset(config.data_dir / "xr_policyscen.nc")
673684

674685

0 commit comments

Comments
 (0)