Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
d3719f8
Update "transport" CI workflow labels
khaeru Oct 30, 2025
1edfe5e
Handle policy codes in LoadFactorLDV
khaeru Nov 18, 2025
504cd7f
Drop "sha" from message_data workflow dispatch
khaeru Nov 18, 2025
310525e
Add "slurm_remote_args" config setting
khaeru Nov 19, 2025
92004be
Improve .util.slurm and CLI
khaeru Nov 18, 2025
4f25386
Skip logging for mix-models sbatch command
khaeru Nov 22, 2025
2b1a90a
Remove plotnine from packages without type hints
khaeru Nov 18, 2025
aa2a6d0
Add .transport.SLURM_TEMPLATE
khaeru Nov 18, 2025
7235028
Defer jaydebeapi import in .buildings.rc_afofi
khaeru Nov 18, 2025
a141a26
Protect submodule imports in .cli
khaeru Nov 18, 2025
cd9970c
Correct log message in .transport.stock
khaeru Nov 19, 2025
d6b3f57
Set util cache path by default
khaeru Nov 19, 2025
3075f0a
Avoid user_cache_path() in iea_web_data_for_query
khaeru Nov 19, 2025
88dd801
Guard message_data imports in .workflow.solve()
khaeru Nov 19, 2025
2f712aa
Set CPLEX threads=8 for transport solve on UniCC
khaeru Nov 19, 2025
4e10979
Add .report.operator.summarize()
khaeru Nov 21, 2025
53b4b91
Return highest version from .sdmx.read()
khaeru Nov 21, 2025
1cee306
Correct version syntax in PRICE_EMISSION_URL
khaeru Nov 21, 2025
adde325
Add .sdmx.StructureFactory
khaeru Nov 21, 2025
cda2c20
Add .transport.CL_SCENARIO StructureFactory
khaeru Nov 21, 2025
72df8a7
Add IIASA_ECE:CL_TRANSPORT_SCENARIO(1.2.1)
khaeru Nov 21, 2025
55d2705
Add USD / t to transport units
khaeru Nov 22, 2025
a609954
Add transport.policy.*.add_tasks, prepare_computer
khaeru Nov 21, 2025
4e5c089
Assign units in PRICE_EMISSION.add_tasks
khaeru Nov 21, 2025
79b0dd7
Add policy cases to transport…test_debug
khaeru Nov 21, 2025
d9f7472
Add remove_emission_bounds(…, parameters=…) arg
khaeru Nov 21, 2025
b266ed0
Add step_0(…, remove_emission_parameters=…) arg
khaeru Nov 21, 2025
b3f5daa
Remove .transport.workflow.tax_emission()
khaeru Nov 21, 2025
30e7577
Ignore warnings due to iiasa/ixmp4#209
khaeru Nov 22, 2025
02dd856
Add .operator.latest_reporting_from_{file,platform}
khaeru Nov 24, 2025
72f2209
Add .report.operator.latest_reporting()
khaeru Nov 24, 2025
0a9ab78
Add .transport.plot.MultiStock
khaeru Nov 24, 2025
cd20131
Allow .iamc.to_quantity(…, query=None)
khaeru Nov 24, 2025
2c97b21
Refactor .transport.report.multi()
khaeru Nov 24, 2025
0d98a06
Add .util.genno.append()
khaeru Nov 24, 2025
c4430b5
Add .transport.plot.Kind enumeration
khaeru Nov 24, 2025
ca62431
Use .plot.prepare_computer() in {build, report}
khaeru Nov 24, 2025
1105fab
Update usage of genno.KeySeq
khaeru Nov 24, 2025
0e8dee3
Add .model.workflow.STAGE enumeration
khaeru Nov 26, 2025
0964159
Add .types.PlotAddable
khaeru Nov 26, 2025
4f0a048
Add make_output_path(…, config_key=…) argument
khaeru Nov 26, 2025
afb9db0
Handle 0 args to .operator.summarize()
khaeru Nov 26, 2025
1a8c984
Improve .report.plot.Plot
khaeru Nov 26, 2025
93c0d85
Use improved .report.plot features in .transport
khaeru Nov 26, 2025
60f3a79
Add .transport.plot.MultiFE
khaeru Nov 26, 2025
59163b3
Add .transport.key.{debug,demand_base}
khaeru Nov 26, 2025
7cc6d62
Improve .testing.check.CheckResult
khaeru Nov 26, 2025
555c39f
Add module .transport.check
khaeru Nov 26, 2025
d5ede47
Add data/transport/R12/input_cap_new.csv
khaeru Nov 26, 2025
cedfa58
Add .circeular.structure, scenario codelist
khaeru Nov 26, 2025
84044c4
Relocate short_hash(), add len=… argument
khaeru Dec 10, 2025
4dc0184
Add .testing.check.NoDuplicates
khaeru Dec 10, 2025
64f9550
Handle kwargs to transport.testing.configure_build
khaeru Dec 10, 2025
814ee7a
Retrieve base-model `demand` in transport build
khaeru Dec 10, 2025
e230e99
Add .transport.material
khaeru Nov 26, 2025
033446c
Test .transport.report.multi()
khaeru Dec 12, 2025
ea1c3e8
Test .transport.build.debug_multi()
khaeru Dec 12, 2025
27f98fa
Add .transport.Config.use_modules()
khaeru Dec 14, 2025
8bdcda1
Add ScenarioInfo.from_path()
khaeru Dec 15, 2025
73c0352
Add "M …" variants to CL_TRANSPORT_SCENARIO
khaeru Dec 14, 2025
19b9b19
Add .transport.config.iter_price_emission()
khaeru Dec 15, 2025
dd63e30
Add all available exo prices to transport workflow
khaeru Dec 15, 2025
f0cb97a
Add IIASA_ECE:CL_TRANSPORT_SCENARIO(1.3.0)
khaeru Dec 15, 2025
a2b4e39
Adjust marker on test_simulated_iamc()
khaeru Jan 14, 2026
a0f7646
Add #447 to doc/whatsnew
khaeru Jan 14, 2026
5cf4924
Skip some tests that stall CI jobs
khaeru Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/transport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,20 @@ env:
labels: >-
[
"SSP1",
"SSP1 policy",
"SSP1 exo price",
"SSP1 tax",
"SSP2",
"SSP2 policy",
"SSP2 exo price",
"SSP2 tax",
"SSP3",
"SSP3 policy",
"SSP3 exo price",
"SSP3 tax",
"SSP4",
"SSP4 policy",
"SSP4 exo price",
"SSP4 tax",
"SSP5",
"SSP5 policy",
"SSP5 exo price",
"SSP5 tax",
"DIGSY-BEST-C",
"DIGSY-BEST-S",
"DIGSY-WORST-C",
Expand Down Expand Up @@ -75,7 +80,6 @@ jobs:
run: |
echo '{
"ref": "${{ github.ref }}",
"sha": "${{ github.sha }}",
"base": "${{ env.base }}",
"from-step": "${{ env.from-step }}",
"labels": ${{ env.labels }}
Expand Down
4 changes: 4 additions & 0 deletions doc/api/report/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ Operators
get_commodity_groups
get_ts
gwp_factors
latest_reporting
latest_reporting_from_platform
latest_reporting_from_file
make_output_path
model_periods
node_glb
Expand All @@ -209,6 +212,7 @@ Operators
select_allow_empty
select_expand
share_curtailment
summarize
zeros_like

The following functions, defined elsewhere,
Expand Down
1 change: 1 addition & 0 deletions doc/api/util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Submodules:
pycountry
scenarioinfo
sdmx
zipfile

Commonly used:

Expand Down
2 changes: 2 additions & 0 deletions doc/transport/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ Quick links to each of the data flows:
:data:`~.data.ikarus_var_cost`
:data:`~.data.input_adj_ldv`
:data:`~.data.input_base`
:data:`~.data.input_cap_new`
:data:`~.data.input_ref_ldv`
:data:`~.data.input_share`
:data:`~.data.lifetime_ldv`
Expand Down Expand Up @@ -228,6 +229,7 @@ Quick links to each of the data flows:
.. autodata:: message_ix_models.model.transport.data.ikarus_var_cost
.. autodata:: message_ix_models.model.transport.data.input_adj_ldv
.. autodata:: message_ix_models.model.transport.data.input_base
.. autodata:: message_ix_models.model.transport.data.input_cap_new
.. autodata:: message_ix_models.model.transport.data.input_ref_ldv
.. autodata:: message_ix_models.model.transport.data.input_share
.. autodata:: message_ix_models.model.transport.data.lifetime_ldv
Expand Down
86 changes: 75 additions & 11 deletions doc/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,86 @@ Next release
============

- New provider for exogenous data from the :ref:`tools-cepii` :class:`.BACI` data source (:pull:`450`).
- Improvements to :class:`.report.Config` (:pull:`178`):
- New tools and utilities:

- Enumeration :class:`.workflow.STAGE` (:pull:`447`).
- Classes
:class:`.sdmx.StructureFactory` and
:class:`.testing.check.NoDuplicates` (:pull:`447`).
- Method :meth:`.ScenarioInfo.from_path` (:pull:`447`).
- Functions :func:`.zipfile.extract_if_newer` (:pull:`450`),
:func:`.random_sample_from_file` (:pull:`450`),
:func:`~message_ix_models.util.genno.append` (:pull:`447`), and
:func:`.iamc.compare` (:pull:`178`).

- Add :py:`parameters` argument to :func:`.remove_emission_bounds.main` (:pull:`447`),
to control which parameter(s) are cleared.
- Change :py:`query=...` argument to :func:`.iamc.to_quantity`, :func:`.iamc_like_data_for_query` to be optional (:pull:`447`).
- Improve and extend :mod:`.util.slurm` and :program:`mix-models sbatch` CLI command (:pull:`447`);
new class :class:`.slurm.Template`;
new configuration setting "slurm remote args".

Reporting
---------

- Expand :doc:`reporting documentation <api/report/index>` (:pull:`178`)
to cover features implemented/not implemented by :mod:`genno`-based reporting.
Module globals :data:`.NOT_IMPLEMENTED_MEASURE` and :data:`.NOT_IMPLEMENTED_IAMC`
record not-yet-implemented measures and IAMC ‘variables’.
- Improve :class:`.report.Config` (:pull:`178`):

- New attribute :attr:`~.report.Config.modules`.
- New method :meth:`~.report.Config.iter_callbacks`.

- New function :func:`.tools.iamc.compare` (:pull:`178`).
- New module :mod:`.report.extraction` for reporting of resource extraction (:pull:`451`).
- New reporting operators (:pull:`451`):
:func:`.get_commodity_groups`,
:func:`.node_glb`, and
:func:`.zeros_like`.
- Expand :doc:`api/report/index` documentation (:pull:`178`)
to cover features implemented/not implemented by :mod:`genno`-based reporting.
Module globals :data:`.NOT_IMPLEMENTED_MEASURE` and :data:`.NOT_IMPLEMENTED_IAMC`
record not-yet-implemented measures and IAMC ‘variables’.
- New utility functions :func:`.extract_if_newer`, :func:`.random_sample_from_files` (:pull:`450`).
- New operators:

- :func:`.get_commodity_groups` (:pull:`451`),
- :func:`.latest_reporting` (:pull:`447`),
- :func:`.latest_reporting_from_platform` (:pull:`447`),
- :func:`.latest_reporting_from_file` (:pull:`447`),
- :func:`.node_glb` (:pull:`451`),
- :func:`.summarize` (:pull:`447`), and
- :func:`.zeros_like` (:pull:`451`).

- Relocate from :mod:`.transport.report.plot` to :mod:`.report.plot` (:pull:`447`)
and generalize:

- Classes :class:`.LabelFirst`, :class:`.PlotTimeSeries`, :class:`.PlotFromIAMC`.
- Extensions to the behaviour of :class:`.Plot`.
- New helper functions :func:`.report.plot.collect`,
:func:`.report.plot.prepare_computer` (:pull:`447`).

Projects and model variants
---------------------------

- Add :doc:`/project/circeular` code list :class:`~.circeular.structure.CL_TRANSPORT_SCENARIO` (:pull:`447`).
- Improve :mod:`.model.transport` (:pull:`447`).

- Add :meth:`Config.use_modules <.transport.config.Config.use_modules>`.
- Bump Codelist=IIASA_ECE:CL_TRANSPORT_SCENARIO to version 1.3.0.

- Include model variants with MESSAGEix-Materials
by adding and using :attr:`.ScenarioCodeAnnotations.extra_modules`.
- Include all available emission price trajectories.

- New modules:

- :mod:`.transport.check`
with checks and assertions for the build process.
These were previously embedded in the test suite.
- :mod:`.transport.material`
and data flow :data:`.input_cap_new`
for integration of MESSAGEix-Transport and -Materials.
- :mod:`.transport.slurm` including a :data:`~.transport.slurm.TEMPLATE`.

- New plots :class:`~.transport.plot.MultiFE`,
:class:`~.transport.plot.MultiStock`.
- Implement :meth:`.transport.policy.ExogenousEmissionPrice.add_tasks`,
:meth:`.TaxEmission.add_tasks`;
add :func:`~.transport.policy.prepare_computer`;
remove custom code from :func:`.transport.workflow.generate`.
- Expand tests.

v2025.10.31
===========
Expand Down
14 changes: 14 additions & 0 deletions message_ix_models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import sys
from importlib.metadata import PackageNotFoundError, version
from warnings import filterwarnings

import iam_units
import pint

# This warning is raised because of import message_ix_models.util → import message_ix →
# import ixmp._config → import ixmp4 → [unclear]. Although recent ixmp and message_ix
# install the same filter, message_ix_models may be used with older versions of these
# packages, so for redundancy it is also installed here.

filterwarnings(
"ignore",
"Core Pydantic V1 functionality isn't compatible with Python 3.14",
UserWarning,
"fastapi.*",
)
# ruff: noqa: E402

from message_ix_models.util._logging import setup as setup_logging
from message_ix_models.util.config import Config
from message_ix_models.util.context import Context
Expand Down
15 changes: 9 additions & 6 deletions message_ix_models/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ def main(click_ctx, **kwargs):
mark_time(quiet=True)

# Check for a non-trivial execution of the CLI
non_trivial = (
not any(s in sys.argv for s in {"config", "last-log", "--help"})
and click_ctx.invoked_subcommand != "_test"
and "pytest" not in sys.argv[0]
needs_log_file = not (
"pytest" in sys.argv[0]
or "--help" in sys.argv
or click_ctx.invoked_subcommand in {"_test", "config", "last-log", "sbatch"}
)

# Log to console: either DEBUG or INFO.
# Don't start file logging for a non-trivial execution.
setup_logging(level="DEBUG" if kwargs["verbose"] else "INFO", file=non_trivial)
setup_logging(level="DEBUG" if kwargs["verbose"] else "INFO", file=needs_log_file)

if "pytest" not in sys.argv[0]:
log.debug("CLI invoked with:\n" + "\n ".join(sys.argv))
Expand Down Expand Up @@ -203,7 +203,10 @@ def _log_threads(k: int, n: int):

for name in submodules:
# Import the module and retrieve the click.Command object
__import__(name)
try:
__import__(name)
except ImportError as e:
print(e)
cmd = getattr(sys.modules[name], "cli")

# Avoid replacing message-ix-models CLI with message_data CLI
Expand Down
Loading