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

Rename 'report' #761

Merged
merged 27 commits into from Nov 22, 2023
Merged

Rename 'report' #761

merged 27 commits into from Nov 22, 2023

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Nov 17, 2023

  • Use preferred module names:
    • message_ix.reportingmessage_ix.report
    • reporting.computationsreport.operator
    • Install an ixmp.util.DeprecatedPathFinder that supports imports from previous locations and raises DeprecationWarning.
    • Adjust imports within message_ix, tutorials, and references in docs.
  • Improve documentation:
    • Address Sphinx nitpicks.
    • Add .. automodule:: message_ix for the top-level module; this allows other projects to link to :mod:'message_ix' directly through intersphinx.
  • Improve the MESSAGE, MACRO, and MESSAGE_MACRO model classes, as enabled by Rename 'report', 'util' + miscellaneous clean-ups ixmp#500:
    • Include all items (including var and equ) in explicit lists of model items.
    • Add descriptions for items.
    • Derive reporting settings (RENAME_DIMS) from .models.
  • Simplify report/__init__.py.

How to review

  • Read the diff.
  • Note the CI checks all pass.
  • View the documentation, including what's new/migration notes, and ensure the changes are described clearly.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update release notes.

- Also rename test modules.
- Install DeprecatedPathFinder to support imports from old locations.
- Adjust imports minimally so package can be imported and tests pass.
Silences all warnings internal to message_ix.
@khaeru khaeru added enh New features & functionality reporting labels Nov 17, 2023
@khaeru khaeru self-assigned this Nov 17, 2023
@khaeru khaeru force-pushed the enh/2023-W46 branch 2 times, most recently from b33c8f6 to f037a03 Compare November 17, 2023 16:07
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Merging #761 (b988abf) into main (f360dc7) will increase coverage by 0.4%.
The diff coverage is 99.3%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #761     +/-   ##
=======================================
+ Coverage   94.3%   94.8%   +0.4%     
=======================================
  Files         43      43             
  Lines       3474    3797    +323     
=======================================
+ Hits        3279    3600    +321     
- Misses       195     197      +2     
Files Coverage Δ
message_ix/__init__.py 91.6% <100.0%> (+1.1%) ⬆️
message_ix/core.py 95.1% <100.0%> (ø)
message_ix/macro.py 96.7% <100.0%> (+<0.1%) ⬆️
message_ix/report/__init__.py 100.0% <100.0%> (ø)
message_ix/report/operator.py 97.1% <100.0%> (ø)
message_ix/report/pyam.py 100.0% <ø> (ø)
message_ix/tests/report/test_operator.py 100.0% <100.0%> (ø)
message_ix/tests/test_feature_storage.py 100.0% <ø> (ø)
message_ix/tests/test_macro.py 100.0% <100.0%> (ø)
message_ix/tests/test_models.py 100.0% <100.0%> (ø)
... and 8 more

- The class carries structural information about model items, with
  convenience methods for manipulating this.
- Add MESSAGE.items class dict, replacing MESSAGE_ITEMS; derive the
  latter from the former.
- These two lists should be equivalent.
- Resolve differences, defaulting to the GAMS inline docs:
  - relation=r —was not in _ABBREV.
  - rating=q —was previously r in _ABBREV.
  - land_scenario=s —previously this was shares in _ABBREV.
  - land_type=u —was not in _ABBREV.
  - shares —removed from _ABBREV.
- Adjust {MESSAGE,MACRO}.items accordingly
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
- 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.
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
- 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.
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
- 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.
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
@khaeru khaeru merged commit d36f676 into main Nov 22, 2023
18 checks passed
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
- 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.
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 22, 2023
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 23, 2023
- 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.
khaeru added a commit to iiasa/message-ix-models that referenced this pull request Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features & functionality reporting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant