Skip to content

Commit

Permalink
Apply ruff formatting and change reporting lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
behnam-zakeri committed Oct 17, 2024
1 parent e509494 commit ec8a2bd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions message_ix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,23 +845,25 @@ def initialize(cls, scenario):
)
equ(
"RELATION_EQUIVALENCE_TIME",
"", "time dependent auxiliary equation to simplify the implementation of relations",
)
"",
"time dependent auxiliary equation to simplify the implementation of relations",
)
equ(
"RELATION_EQUIVALENCE_YEAR",
"",
"time dependent auxiliary equation to simplify the implementation of relations at"
" the year level",
)
)
equ(
"RELATION_CONSTRAINT_UP_TIME",
"",
"time dependentupper bound of relations (linear constraints)",
)
)
equ(
"RELATION_CONSTRAINT_LO_TIME",
"",
"time dependent lower bound of relations (linear constraints)")
"time dependent lower bound of relations (linear constraints)",
)
equ(
"RENEWABLES_CAPACITY_REQUIREMENT",
"",
Expand Down
6 changes: 3 additions & 3 deletions message_ix/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_reporter_from_scenario(message_test_mp):
rep = Reporter.from_scenario(scen)

# Number of quantities available in a rudimentary MESSAGEix Scenario
assert 268 == len(rep.graph["all"])
assert 281 == len(rep.graph["all"])

# Quantities have short dimension names
assert "demand:n-c-l-y-h" in rep, sorted(rep.graph)
Expand All @@ -70,11 +70,11 @@ def test_reporter_from_scenario(message_test_mp):
assert_qty_equal(obs, demand, check_attrs=False)

# ixmp.Reporter pre-populated with only model quantities and aggregates
assert 6462 == len(rep_ix.graph)
assert 6784 == len(rep_ix.graph)

# message_ix.Reporter pre-populated with additional, derived quantities
# This is the same value as in test_tutorials.py
assert 13724 == len(rep.graph)
assert 14046 == len(rep.graph)

# Derived quantities have expected dimensions
vom_key = rep.full_key("vom")
Expand Down
2 changes: 1 addition & 1 deletion message_ix/tests/test_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _t(group: Union[str, None], basename: str, *, check=None, marks=None):
_t("w0", f"{W}_historical_new_capacity"),
_t("w0", f"{W}_multinode_energy_trade"),
# NB this is the same value as in test_reporter()
_t(None, f"{W}_report", check=[("len-rep-graph", 13724)]),
_t(None, f"{W}_report", check=[("len-rep-graph", 14046)]),
_t("at0", "austria", check=[("solve-objective-value", 206321.90625)]),
_t("at0", "austria_single_policy", check=[("solve-objective-value", 205310.34375)]),
_t("at0", "austria_multiple_policies"),
Expand Down

0 comments on commit ec8a2bd

Please sign in to comment.