Skip to content

Commit bad33bc

Browse files
committed
Add .util._message_ix.MESSAGE
Import in modules to avoid warnings.
1 parent 1d2f83f commit bad33bc

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

message_ix_models/report/sim.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def dims_of(info: "Item") -> dict[str, str]:
104104
@lru_cache(1)
105105
def to_simulate():
106106
"""Return items to be included in a simulated solution."""
107-
from message_ix.models import MACRO, MESSAGE
107+
108+
from message_ix_models.util._message_ix import MACRO, MESSAGE
108109

109110
# Items to included in a simulated solution: MESSAGE sets and parameters; some
110111
# variables

message_ix_models/tools/add_dac/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import numpy as np
1010
import pandas as pd
1111
from message_ix import make_df
12-
from message_ix.models import MESSAGE
12+
13+
from message_ix_models.util._message_ix import MESSAGE
1314

1415

1516
def generate_df(scenario, tech_data): # noqa: C901
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
try:
22
from message_ix.macro import MACRO
3+
from message_ix.message import MESSAGE
34
except ImportError:
4-
from message_ix.models import MACRO # type: ignore [no-redef]
5+
from message_ix.models import MACRO, MESSAGE # type: ignore [no-redef]
56

6-
__all__ = ["MACRO"]
7+
__all__ = [
8+
"MACRO",
9+
"MESSAGE",
10+
]

0 commit comments

Comments
 (0)