-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update .report.sim for iiasa/ixmp#500, iiasa/message_ix#761
- Import RENAME_DIMS through a function that provides backwards compatibility. - Use MESSAGE.items and MACRO.items; remove redefinitions. - Simplify simulate_qty() to accept a list of dimensions directly.
- Loading branch information
Showing
2 changed files
with
47 additions
and
152 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,20 @@ | ||
from typing import Dict | ||
|
||
|
||
def rename_dims() -> Dict[str, str]: | ||
"""Access :data:`.ixmp.report.common.RENAME_DIMS`. | ||
This provides backwards-compatibility with ixmp versions 3.7.0 and earlier. It can | ||
be removed when message-ix-models no longer supports versions of ixmp older than | ||
3.8.0. | ||
""" | ||
try: | ||
# ixmp 3.8.0 and later | ||
import ixmp.report.common | ||
except ImportError: | ||
# ixmp <= 3.7.0 | ||
import ixmp.reporting.util # type: ignore [import-not-found] | ||
|
||
return ixmp.reporting.util.RENAME_DIMS | ||
else: | ||
return ixmp.report.common.RENAME_DIMS |