Skip to content

Commit

Permalink
Avoid deprecated genno.config.STORE
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Apr 3, 2024
1 parent 5dd8dad commit da68847
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions message_ix_models/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,22 @@

log = logging.getLogger(__name__)

# Add to the configuration keys stored by Reporter.configure().
genno.config.STORE.add("output_path")
genno.config.STORE.add("output_dir")
# Ignore a section in global.yaml used to define YAML anchors
try:
# genno ≥ 1.25
genno.config.handles("_iamc formats", False, False)(genno.config.store)
except AttributeError:
# genno < 1.25
# TODO Remove once the minimum supported version in message-ix-models is ≥ 1.25
@genno.config.handles("_iamc formats")
def _(c: Reporter, info):
pass


#: List of callbacks for preparing the Reporter.
CALLBACKS: List[Callable] = []


# Ignore a section in global.yaml used to define YAML anchors
@genno.config.handles("_iamc formats")
def _(c: Reporter, info):
pass


@genno.config.handles("iamc")
def iamc(c: Reporter, info):
"""Handle one entry from the ``iamc:`` config section.
Expand Down

0 comments on commit da68847

Please sign in to comment.