Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dac tutorial add tech #810

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
98 changes: 98 additions & 0 deletions message_ix/tests/data/add_tech/westeros_carbon_removal_data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
daccs:
year_init: 700
inv_cost_:
par_name: inv_cost
value: 100
unit: USD/(tCO2/yr)
node_loc:
Westeros: 1
year_vtg:
rate: 0
fix_cost_:
par_name: fix_cost
value: 5
unit: USD/(tCO2/yr)/yr
node_loc:
Westeros: 1
year_vtg:
rate: 0
year_act:
rate: 0
var_cost_:
par_name: var_cost
value: 5
unit: USD/tCO2
node_loc:
Westeros: 1
year_vtg:
rate: 0
year_act:
rate: 0
input_:
par_name: input
value: 0.0028
unit: '-'
node_loc:
Westeros: 1
mode:
standard: 1
commodity:
electricity: 1
level:
final: 1
output_:
par_name: output
value: 1
unit: tCO2
node_loc:
Westeros: 1
mode:
standard: 1
commodity:
CO2: 1
level:
final: 1
capacity_factor_:
par_name: capacity_factor
value: 0.913
unit: '-'
node_loc:
Westeros: 1
emission_factor_:
par_name: emission_factor
value: -1
unit: tCO2/tCO2
node_loc:
Westeros: 1
mode:
standard: 1
emission:
CO2: 1
technical_lifetime_:
par_name: technical_lifetime
value: 25
unit: y
node_loc:
Westeros: 1
initial_new_capacity_up_:
par_name: initial_new_capacity_up
value: 0.5
unit: Mt CO2/yr
node_loc:
Westeros: 1
year_vtg:
rate: 0
time:
year: 1
growth_new_capacity_up_:
par_name: growth_new_capacity_up
value: 0.05
unit: '-'
node_loc:
Westeros: 1
year_vtg:
rate: 0
time:
year: 1


2 changes: 2 additions & 0 deletions message_ix/tests/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def _t(group: Union[str, None], basename: str, *, check=None, marks=None):
_t("w0", f"{W}_addon_technologies"),
_t("w0", f"{W}_historical_new_capacity"),
_t("w0", f"{W}_multinode_energy_trade"),
_t("w0", f"{W}_carbon_removal"),
_t("w0", f"{W}_multinode_emissions_bounds_daccs"),
# NB this is the same value as in test_reporter()
_t(None, f"{W}_report", check=[("len-rep-graph", 13724)]),
_t("at0", "austria", check=[("solve-objective-value", 206321.90625)]),
Expand Down
28 changes: 28 additions & 0 deletions message_ix/tests/tools/test_add_tech.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from message_ix.testing import make_dantzig
from message_ix.tools.add_tech import print_df


def test_print_df(test_mp, request, test_data_path, tmp_path):
scen = make_dantzig(test_mp, quiet=True, request=request)
scen.check_out()
path = test_data_path.joinpath("add_tech")
output_dir = tmp_path.joinpath("add_tec")
output_dir.mkdir()
print_df(
scenario=scen,
input_path=str(path.joinpath("westeros_carbon_removal_data.yaml")),
output_dir=output_dir,
)

# TODO: adapt this to read parameter names from yaml file
parameter_list = scen.par_list()
for parameter in parameter_list:
assert (output_dir / f"{parameter}.xlsx").exists()


# def test_get_values():
# get_values()


# def test_get_report():
# get_report()
Loading
Loading