Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate message_data.reporting #116

Merged
merged 220 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
6474c03
Move files into message_data; new __init__.py
khaeru Oct 14, 2019
4c6cec2
Merge branch 'master' into reporting3
khaeru Oct 14, 2019
009a76d
Update documentation
khaeru Oct 14, 2019
c8a0f0b
Simplify model.create
khaeru Nov 14, 2019
3e1b888
Fix reporter.as_pyam call to reporter.convert_pyam (#77)
khaeru Nov 15, 2019
321b0e2
Move reporting config file to repo-wide metadata directory
khaeru Nov 15, 2019
a0bee6c
Add CLI option for selecting reporting config file
khaeru Nov 15, 2019
b160cd0
Adjust docs to reporting config file location
khaeru Nov 15, 2019
0cb7f50
Adjust IAMC conversion
khaeru Nov 15, 2019
e19044b
Corrected context scenario attributes used to retrieve scenario model…
OFR-IIASA Nov 18, 2019
e3f613a
Reorganize reporting config
khaeru Nov 24, 2019
14ccd5b
Tweak handling of URL CLI argument
khaeru Nov 26, 2019
0291845
Fixed test for technologies.py
francescolovat Dec 10, 2019
620aefd
Added technology.yaml to the Default reporting configuration section …
francescolovat Dec 18, 2019
ae3ca8c
Adjust inclusion of technology.yaml in tools docs
khaeru Dec 18, 2019
32c4e42
Allow empty combine/inputs/select in reporting config YAML
khaeru Jan 22, 2020
7c4df12
Specify convert_pyam(year_time_dim=...) in add_iamc_table
khaeru Jan 22, 2020
377411f
Handle varying dimensionality in reporting.computations.combine; test
khaeru Jan 22, 2020
45024c5
Make combine/inputs/weight default to 1; expand docs
khaeru Jan 22, 2020
e52c501
Document more reporting.core methods; use infer_keys in add_aggregate
khaeru Jan 22, 2020
2aa3f9e
Add test_report_bare_res
khaeru Jan 29, 2020
f6f20e8
Streamline docs configuration per sphinx-quickstart 2.3.1
khaeru Feb 4, 2020
151e353
Adjust imports from ixmp.reporting
khaeru Feb 28, 2020
8d244ef
Comment definition of 'USD' unit in data/report/global.yaml
khaeru Mar 10, 2020
502cfbb
Test applying units to reported quantities (#104)
khaeru Mar 20, 2020
b7e7451
Add unit, replace_vars args for reporting IAMC conversion
khaeru Mar 24, 2020
89f9ff6
Harmonize docstrings in reporting.core
khaeru Mar 24, 2020
86456c2
Test IAMC units conversion
khaeru Mar 24, 2020
546e368
Test IAMC variable name replacement
khaeru Mar 24, 2020
d17705f
Pass units through reporting.computations.combine
khaeru Apr 1, 2020
0e98e93
Add common replacements to reporting.util.collapse()
khaeru Apr 1, 2020
94812e6
Simplify config handling & passing config to ixmp
khaeru Apr 3, 2020
f8fbe58
Tidy reporting.core imports; re-add deepcopy for testing
khaeru Apr 6, 2020
be6bc0b
Report GDP variables (#110)
francescolovat Apr 9, 2020
b337244
Use improvements from iiasa/ixmp#312
khaeru Apr 13, 2020
baf95c4
Copy cleanups from iiasa/message_data#116
khaeru Apr 13, 2020
bf97f24
Bump Reporter.add_queue(..., max_tries=2) from 1
khaeru Apr 13, 2020
4283222
Don't re-set pint application registry
khaeru Apr 14, 2020
c2cf559
Update tests for iam-units registry
khaeru Apr 14, 2020
1e84fbb
Add reporting.computations.update_scenario
khaeru Apr 20, 2020
74c4ef7
Report multiple scenarios with 'mix-data report --from-file=...'
khaeru Apr 28, 2020
5d27d20
Document continuous reporting
khaeru Apr 28, 2020
a07cde9
Cast columns to 'str' in reporting.util.collapse
khaeru Apr 28, 2020
2e09349
Add model.transport.check
khaeru Apr 20, 2020
d7bcf29
Add reporting.register() for callbacks; expand transport.report
khaeru May 7, 2020
6b7ab89
Adjust tests to use session_context where possible
khaeru May 7, 2020
257a009
Adjust model.bare.create_res and other code to use set_info()
khaeru May 10, 2020
fc4a76b
Update docs for model.transport, model.disutility; expand docs ToC
khaeru May 26, 2020
bfbc41f
Adjust imports from ixmp.reporting
khaeru Jun 20, 2020
d425a9a
Adjust reporting imports
khaeru Jun 20, 2020
6e8a774
Separate CLIs into consistent .cli submodules
khaeru Jun 21, 2020
f8ff4e7
Add --modules/-m for 'mix-data report'
khaeru Jun 21, 2020
476e377
Add transport plots
khaeru Jun 21, 2020
6c68fb0
Filter 0-length items from "mix-data report --module ..."
khaeru Jun 25, 2020
e63e7cb
Add reporting.CONFIG for use in code that does not load global.yaml
khaeru Jun 25, 2020
2246ff5
Make report() a top-level method of the .reporting module
khaeru Jul 15, 2020
be4498d
Report PRICE_COMMODITY and derived quantities (#87)
GamzeUnlu95 Jul 31, 2020
b2b7712
CH4 initial reporting
Jihoon Feb 12, 2020
b4a465c
Resolve conflict for rebase
Jihoon Mar 30, 2020
a710090
Add minor comments and bring back examples
Jihoon Mar 30, 2020
35c082d
Adjust to yaml format changes
Jihoon Apr 2, 2020
b9db904
Add successfully an aggregate variable
Jihoon Apr 3, 2020
326b027
Add reporting.utils.REPLACE rule for CH4 fugitive emissions
khaeru Apr 10, 2020
4672568
Use CH4 output labels directly in aggregation
khaeru Apr 10, 2020
bab017b
Compare auto-renamed CH4 liquids results with verbose method
khaeru Apr 10, 2020
f58aa68
Further use CH4 output labels directly in aggregation
khaeru Apr 10, 2020
9245360
Add reporting.computations.select
khaeru Apr 10, 2020
139d08c
Update reporting.util.collapse and .REPLACE for CH4
khaeru Apr 10, 2020
a4f5179
Select technologies for CH4 IAMC reporting
khaeru Apr 10, 2020
87dbde2
Correct reporting.util.REPLACE for CH4 technologies
khaeru Apr 10, 2020
11a7e77
Remove verbose CH4 reporting to IAMC
khaeru Apr 10, 2020
a1ec4f4
Including fugitive and biomass burning in CH4 IAMC reporting
khaeru Apr 10, 2020
42a18ea
Simplify reporting of CH4 land use emissions
khaeru Apr 10, 2020
79f155d
Tidy small/inadvertent changes in global.yaml
khaeru Apr 14, 2020
8236b30
Configure reporting of CH4 emissions from GLOBIOM
khaeru Apr 14, 2020
874a246
Adjust test_iamc_replace_vars
khaeru Apr 14, 2020
bef3adf
Update replacements for reporting CH4 emissions from GLOBIOM
khaeru Apr 14, 2020
22cf075
Sort technology names involved in CH4 emissions reporting
khaeru Apr 14, 2020
730fa85
Use output names directly for CH4 emissions from final energy use
khaeru Apr 14, 2020
96818bc
Expand docs of reporting.util.collapse
khaeru Apr 14, 2020
23da9ce
Correct intersphinx cross-references in reporting docs
francescolovat Apr 16, 2020
de0dac2
Correct code example typo in docstring of reporting.core.add_aggregate()
francescolovat Apr 17, 2020
755144f
Import apply_units reporting comp from ixmp
khaeru Jul 31, 2020
a5da3ac
Report emissions of F-gases
khaeru Apr 9, 2020
60d1f01
Add computations.gwp_factors
khaeru Apr 9, 2020
f61b145
Simplify YAML configuration for emissions reporting
khaeru Apr 9, 2020
e8d441c
Add reporting.util.collapse_gwp_info
khaeru Apr 9, 2020
b70da1c
Remove gwp.csv
khaeru Apr 9, 2020
6cb3bfd
Expand comments for F-gas emissions reporting
khaeru Apr 9, 2020
b2dd927
Hide IAMC format YAML keys from Reporter.describe()
khaeru Apr 9, 2020
dc12836
Add reporting.computations.select
khaeru Apr 10, 2020
ba0bfc3
Add reporting.computations.apply_units
khaeru Apr 10, 2020
5ccc485
Update F-gas emissions reporting in global.yaml
khaeru Apr 10, 2020
9224dbd
Tidy logging in reporting.core
khaeru Apr 10, 2020
f861310
Remove computations.apply_units, .select
khaeru Apr 14, 2020
fc0b48c
Rewrite computations.combine using ixmp built-in computations
khaeru Jul 31, 2020
68eca2b
Log a warning and continue on missing columns in util.collapse_gwp_info
khaeru Jul 31, 2020
73a6d4d
Replace non-units for price quantities
khaeru Jul 31, 2020
facf452
Report secondary energy (#120)
francescolovat Aug 21, 2020
8721299
Set "output dir" reporting config key
khaeru Aug 27, 2020
2470157
Move general Plot class to .reporting from .transport.report
khaeru Sep 22, 2020
e8d2278
Fix test_report_bare_res
khaeru Sep 22, 2020
2818d4e
Update MESSAGEix-Transport usage docs; use Windows-friendly file name…
francescolovat Nov 6, 2020
105d454
Silence a warning with Series.str.replace(regex=True) in .reporting.util
khaeru Jan 14, 2021
230e870
Add doc/repro.rst; config for sphinx.ext.{autosummary,viewcode}
khaeru Jan 14, 2021
7539db6
Use message_data.testing in transport tests; blacken
khaeru Jan 14, 2021
f0fae86
Tidy .transport.report and related code
khaeru Feb 8, 2021
fd623be
Blacken .reporting.{cli,core}
khaeru Feb 8, 2021
56483da
Use directory from "report --output=" option for plots
khaeru Feb 8, 2021
3d586ae
Remove upstreamed reporting code
khaeru Feb 9, 2021
7fabe17
Adjust imports; remove tests of upstreamed reporting code
khaeru Feb 9, 2021
9a5713f
Update /reporting/doc/index.rst; add genno to intersphinx config
khaeru Feb 10, 2021
ef8a42b
Remove unused/unsupported arguments in .reporting.util.collapse()
khaeru Feb 11, 2021
f3d4c2c
Override genno.config handler for "iamc:"; simplify prepare_reporter()
khaeru Feb 11, 2021
5a0af84
Remove obsolete test_iamc_replace_vars
khaeru Feb 11, 2021
0c3c2fd
Update report/global.yaml for genno
khaeru Feb 11, 2021
65c4bc4
Update reporting documentation
khaeru Feb 12, 2021
be57b10
Merge .reporting.core to .reporting.__init__
khaeru Feb 12, 2021
8547674
Add tests of .reporting.util.collapse()
khaeru Feb 12, 2021
527f262
Adjust transport reports for genno.compat.pyam
khaeru Feb 14, 2021
7111e44
Allow reporting of unsolved scenarios
khaeru Feb 16, 2021
2ef3914
Move mark_time() to .logging; add --verbose common CLI parameter
khaeru Feb 18, 2021
1b53075
Lint (isort, wrap at 88 lines), comment, and document 8 files
khaeru Feb 18, 2021
002561d
Make prepare_reporter(…, key=) arg optional
khaeru Feb 18, 2021
c3eb20c
Tidy import, use of .logging
khaeru Feb 18, 2021
a0828c7
Update .reporting.cli
khaeru Feb 22, 2021
19f73f9
Update handling of default key in .reporting.prepare_reporter()
khaeru Feb 22, 2021
5f6340e
Update uses of deprecated Context methods/attributes in existing
khaeru Mar 1, 2021
1d59500
Import from message_ix_models.util.{click,logging}, not old locations
khaeru Mar 2, 2021
3dcd6b0
Adjust imports of migrated code
khaeru Mar 22, 2021
198f814
Quiet prepare_reporter() on an unsolved Scenario
khaeru Apr 23, 2021
110cdd1
Use private_data_path in the reporting CLI
khaeru May 5, 2021
a8460ec
Disambiguate reference to .reporting.prepare_reporter
khaeru Aug 25, 2021
bb62283
Move data files to correct location
OFR-IIASA Oct 15, 2021
a9a5ab4
Move from xlsx to using csv to track changes
OFR-IIASA Oct 15, 2021
1121c19
Adapt and document syntax
OFR-IIASA Oct 18, 2021
1c8c641
Raise log level for "report --dry-run"
khaeru Nov 18, 2021
15aa957
Don't set "report --output" to cwd by default (allow None)
khaeru Nov 18, 2021
dfb7b95
Move as_quantity() to .reporting.util
khaeru Nov 24, 2021
86e1599
Use local_data_path() to direct reporting outputs
khaeru Jan 26, 2022
6e12fc7
reporting.prepare_reporter() accepts a pre-populated Reporter
khaeru Feb 17, 2022
86eeb1d
Handle empty dict config in prepare_reporter()
khaeru Feb 17, 2022
0de3a42
Use extra callbacks supplied via an argument in prepare_reporter()
khaeru Feb 17, 2022
7c78e22
Remove callback argument to prepare_reporter()
khaeru Feb 17, 2022
dfccdc8
Guard against mypy errors in prepare_reporter()
khaeru Mar 3, 2022
3cc8aa8
Update ENGAGE to v4.1.8 (#301)
gidden Mar 24, 2022
dfaa9b3
Move utilities for simulating solution data to .reporting.sim
khaeru Mar 30, 2022
382fff3
Add .reporting.computations.make_output_path
khaeru Apr 4, 2022
2ea0397
Handle "var:" key in "iamc:" reporting config sections
khaeru Apr 4, 2022
06ff0dc
Adapt genno to some standard message_data reporting config
khaeru Apr 20, 2022
2aeb9b0
Use "*" wildcards per genno 1.11
khaeru Apr 20, 2022
8ad230c
Quiet genno logging in add_simulated_solution()
khaeru Apr 20, 2022
a14a4d8
Don't squash existing parameter data in add_simulated_solution()
khaeru Apr 21, 2022
c408353
Use silence_log in add_simulated_solution()
khaeru Apr 21, 2022
5f3702b
Promote legacy reporting docs to nav menu; cross-link with others
khaeru Apr 22, 2022
6316195
Check that simulated_qty() do not lack dimension labels
khaeru May 6, 2022
f4b2d08
Check for duplicate data in simulate_qty()
khaeru May 11, 2022
2200972
Satisfy mypy for #337
khaeru May 11, 2022
416042a
Update files/directories to reduce lint-check exclusions (#384)
OFR-IIASA Jun 15, 2022
d6b6ee9
Use "::" in genno keys in data/report/global.yaml
khaeru May 30, 2022
05dc7e2
Only infer full set of dimensions in prepare_reporter() if none given
khaeru May 30, 2022
a06d2b2
Use Context to pass options to report(), prepare_reporter()
khaeru Jul 25, 2022
abbf4ee
Simplify reporting CLI; use --dry-run via common_params()
khaeru Jul 25, 2022
f43702e
Adjust reporting tests to new signatures
khaeru Jul 25, 2022
71f81e7
Expand commodity mapping in .reporting.util.REPLACE_DIMS
khaeru Aug 5, 2022
b437472
Use "message::default" as default key in report CLI
khaeru Aug 16, 2022
a6af3a6
Move model_periods and usage from transport to general reporting
khaeru Aug 19, 2022
73eff7b
Simplify prepare_reporter()
khaeru Aug 23, 2022
3f311ea
Roll import of reporting callbacks into register()
khaeru Sep 7, 2022
5db34be
Invoke legacy reporting through "mix-models report" CLI
khaeru Sep 7, 2022
005fcb5
Copy legacy reporting config files for materials from `material-R12-r…
khaeru Sep 7, 2022
4929867
Correct path to units file in report/materials.yaml
khaeru Sep 8, 2022
d5c147e
Always call Path.expanduser() and .mkdir() on reporting output paths
khaeru Sep 13, 2022
95e17d8
Add remove_all_ts() reporting computation; use for NAVIGATE
khaeru Sep 15, 2022
96aa839
Use timeseries_only=True in remove_all_ts(); correct usage
khaeru Sep 15, 2022
9974f49
Always print result *and* path from reporting CLI
khaeru Sep 19, 2022
0cd73cc
Reduce redundant logging in prepare_reporter()
khaeru Sep 22, 2022
ada9489
Add a TODO in remove_all_ts()
khaeru Sep 23, 2022
2211d53
Fix NameError in .reporting.register()
khaeru Sep 27, 2022
3b78a00
Satisfy mypy
khaeru Sep 27, 2022
d51aa4c
Test invocation of iamc_report_hackathon.report()
khaeru Nov 4, 2022
46bd9a6
Adjust legacy reporting invocation by .reporting.report()
khaeru Nov 4, 2022
0ef27f0
Warn about old args to .iamc_report_hackathon.report()
khaeru Nov 4, 2022
265702d
Satisfy mypy in .transport.test_data.assert_units()
khaeru Nov 4, 2022
09134d5
Simplify pass-through of legacy reporting args from CLI
khaeru Nov 7, 2022
b7509a7
Expand types handled by as_quantity()
khaeru Oct 3, 2022
16213f5
Adjust prepare_reporter for iiasa/message-ix-models#82
khaeru Oct 3, 2022
836c147
Sketch an integrated NAVIGATE workflow
khaeru Oct 4, 2022
751363c
Address warnings in Sphinx docs build
khaeru Oct 7, 2022
c7c1e7d
Allow specifying an initial year to .computations.remove_ts()
khaeru Oct 14, 2022
f65a1e9
Address untyped/implicit optional errors from mypy
khaeru Nov 8, 2022
c16c20a
Add navigate_aggregates.csv
GamzeUnlu95 Dec 9, 2022
1847a8d
Add .reporting.util.add_replacements()
khaeru Jan 20, 2023
2649fa1
Handle partial sums in reporting "iamc:" config handler
khaeru Jan 24, 2023
f6e2eb2
Consolidate legacy reporting config for NAVIGATE
khaeru Jan 24, 2023
6049f3c
Address mypy errors for #422
khaeru Feb 4, 2023
757e1d1
Handle missing "var" key in "iamc:" reporting config section
khaeru Feb 9, 2023
ddc281d
Add .reporting.computations.from_url()
khaeru Feb 10, 2023
5c70163
Add .reporting.computations.get_ts()
khaeru Feb 10, 2023
ee40d68
Add .reporting.util.copy_ts()
khaeru Feb 10, 2023
574ca98
Ensure "y::model" and "y0" keys are in all reporters
khaeru Feb 10, 2023
0a049f6
Debug .reporting.computations.from_url()
khaeru Feb 10, 2023
3593ec1
Debug .reporting.util.copy_ts()
khaeru Feb 10, 2023
f1fd123
Lint .reporting.computations
khaeru Feb 10, 2023
46357e1
Add compound_growth() genno computation, tests
khaeru Feb 17, 2023
4738cb3
Adjust test_generate_workflow_cli
khaeru Apr 1, 2023
48c3edb
Sort imports in 4 files
khaeru May 31, 2023
66cffd8
Adjust and sort imports in .report
khaeru Aug 30, 2023
48a3555
Migrate enhanced silence_log() from message_data
khaeru Aug 30, 2023
63b385e
Update and integrate .report documentation
khaeru Aug 30, 2023
09fac8e
Add .report.cli to "mix-models" CLI commands
khaeru Aug 30, 2023
61cd48b
Capitalize TODOs in .report.computations
khaeru Aug 30, 2023
bbac6e1
Add #116 to doc/whatsnew
khaeru Aug 30, 2023
d0b5faf
Work around python/mypy#15843 in lint CI workflow
khaeru Aug 30, 2023
589b033
Update test of silence_log()
khaeru Aug 30, 2023
6da4b49
Adjust compound_growth for pandas 2.1.0
khaeru Aug 31, 2023
b0b131a
Satisfy mypy in two places with genno 1.18.0
khaeru Aug 31, 2023
e3596c6
Adjust .report tests migrated from message_data
khaeru Aug 31, 2023
ba805c9
Adjust package names and relative paths in .report
khaeru Aug 31, 2023
87ab426
Force use of "iamc:" genno config handler during migration
khaeru Aug 31, 2023
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
1 change: 1 addition & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
type-hint-packages: >-
genno
iam-units
"mypy < 1.5"
"pint < 0.21"
pytest
sdmx1
Expand Down
5 changes: 5 additions & 0 deletions doc/api/report/default-config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Default reporting configuration
*******************************

.. literalinclude:: ../../../message_ix_models/data/report/global.yaml
:language: yaml
177 changes: 177 additions & 0 deletions doc/api/report/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
Reporting (:mod:`~.message_ix_models.report`)
*********************************************

.. contents::
:local:

See also:

- ``global.yaml``, the :doc:`default-config`.
- Documentation for :mod:`genno` (:doc:`genno:index`), :mod:`ixmp.reporting`, and :mod:`message_ix.reporting`.

.. toctree::
:hidden:

default-config

Not public:

- `“Reporting” project board <https://github.com/orgs/iiasa/projects/3>`_ on GitHub for the initial implementation of these features.
- :doc:`m-data:/reference/tools/post_processing`, still in use.
- Documentation for reporting specific to certain model variants:

- :doc:`m-data:/reference/model/transport/report`

Introduction
============

See :doc:`the discussion in the MESSAGEix docs <message_ix:reporting>` about the stack.
In short, :mod:`message_ix` must not contain reporting code that references ``coal_ppl``, because not every model built on the MESSAGE framework will have a technology with this name.
Any reporting specific to ``coal_ppl`` must be in :mod:`message_ix_models`, since all models in the MESSAGEix-GLOBIOM family will have this technology.

The basic **design pattern** of :mod:`message_ix_models.report` is:

- A ``global.yaml`` file (i.e. in `YAML <https://en.wikipedia.org/wiki/YAML#Example>`_ format) that contains a *concise* yet *explicit* description of the reporting computations needed for a MESSAGE-GLOBIOM model.
- :func:`~.reporting.prepare_reporter` reads the file and a Scenario object, and uses it to populate a new Reporter.
This function mostly relies on the :doc:`configuration handlers <genno:config>` built in to Genno to handle the different sections of the file.

Features
========

By combining these genno, ixmp, message_ix, and message_ix_models features, the following functionality is provided.

.. note:: If any of this does not appear to work as advertised, file a bug!

Units
-----

- Are read automatically for ixmp parameters.
- Pass through calculations/are derived automatically.
- Are recognized based on the definitions of non-SI units from `IAMconsortium/units <https://github.com/IAMconsortium/units/>`_.
- Are discarded when inconsistent.
- Can be overridden for entire parameters:

.. code-block:: yaml

units:
apply:
inv_cost: USD

- Can be set explicitly when converting data to IAMC format:

.. code-block:: yaml

iamc:
# 'value' will be in kJ; 'units' will be the string 'kJ'
- variable: Variable Name
base: example_var:a-b-c
units: kJ

Continuous reporting
====================

.. note:: This section is no longer current.

The IIASA TeamCity build server is configured to automatically run the full (:file:`global.yaml`) reporting on the following scenarios:

.. literalinclude:: ../../ci/report.yaml
:caption: :file:`ci/report.yaml`
:language: yaml

This takes place:

- every morning at 07:00 IIASA time, and
- for every commit on every pull request branch, *if* the branch name includes ``report`` anywhere, e.g. ``feature/improve-reporting``.

The results are output to Excel files that are preserved and made available as 'build artifacts' via the TeamCity web interface.

API reference
=============

.. currentmodule:: message_ix_models.report

.. automodule:: message_ix_models.report
:members:

.. autosummary::

prepare_reporter
register
report

Operators
---------

.. currentmodule:: message_ix_models.report.computations
.. automodule:: message_ix_models.report.computations
:members:

:mod:`message_ix_models` provides the following:

.. autosummary::

from_url
get_ts
gwp_factors
make_output_path
model_periods
remove_ts
share_curtailment

Other operators are provided by:

- :mod:`message_ix.reporting.computations`
- :mod:`ixmp.reporting.computations`
- :mod:`genno.computations`

Utilities
---------

.. currentmodule:: message_ix_models.report.util
.. automodule:: message_ix_models.report.util
:members:

.. autosummary::

add_replacements
as_quantity
collapse
collapse_gwp_info
copy_ts


Command-line interface
----------------------

.. currentmodule:: message_ix_models.report.cli
.. automodule:: message_ix_models.report.cli
:members:


.. code-block::

$ mix-models report --help

Usage: mix-models report [OPTIONS] [KEY]

Postprocess results.

KEY defaults to the comprehensive report 'message::default', but may also be
the name of a specific model quantity, e.g. 'output'.

--config can give either the absolute path to a reporting configuration
file, or the stem (i.e. name without .yaml extension) of a file in
data/report.

With --from-file, read multiple Scenario identifiers from FILE, and report
each one. In this usage, --output-path may only be a directory.

Options:
--dry-run Only show what would be done.
--config TEXT Path or stem for reporting config file. [default:
global]
-L, --legacy Invoke legacy reporting.
-m, --module MODULES Add extra reporting for MODULES.
-o, --output PATH Write output to file instead of console.
--from-file FILE Report multiple Scenarios listed in FILE.
--help Show this message and exit.
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Among other tasks, the tools allow modelers to:
api/model-emissions
api/model-snapshot
api/disutility
api/report/index
api/tools
api/util
api/testing
Expand Down
1 change: 1 addition & 0 deletions doc/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ What's new
Next release
============

- New module :mod:`message_ix_models.report` for reporting (:pull:`116`).
- Add documentation on :ref:`migrate-filter-repo` using :program:`git filter-repo` and helper scripts (:pull:`89`).

v2023.7.26
Expand Down
1 change: 1 addition & 0 deletions message_ix_models/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def debug(ctx):
"message_ix_models.model.snapshot",
"message_ix_models.model.structure",
"message_ix_models.model.water.cli",
"message_ix_models.report.cli",
]

try:
Expand Down
Loading