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

Migrate message_data.reporting #116

merged 220 commits into from
Aug 31, 2023

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Aug 30, 2023

This PR migrates message_data.reporting to message_ix_models.report, using git-filter-repo as described in the documentation.

  • The name "report" is used instead of "reporting". This is in line with, for instance "build"—verb in its infinitive form.

Partly addresses #27.

Migration scripts

In settings.sh

# Source package name in Git URLs and file paths
SRC=message_data
# Python name
S_PACKAGE=$SRC
# Remote for its repo
[email protected]:iiasa/$SRC.git
# Specific branch from which to migrate code
SRC_BRANCH=dev

# Destination package name in Git URLs and file paths
DST=message-ix-models
# Python name
D_PACKAGE=message_ix_models
# Remote for its repo
[email protected]:iiasa/$DST.git
# Branch to create in the destination. This is created
# from the HEAD of the default branch, e.g. "main".
BRANCH=migrate-report

# Path fragment for path renaming and filtering.
# Edit this together with 2-migrate.sh.
MOD=report

In 2-migrate.sh:

git filter-repo \
  --refs $BRANCH --force --debug \
  --path-rename data/$MOD/:$D_PACKAGE/data/$MOD/ \
  --path-rename $S_PACKAGE/reporting/doc/:doc/api/$MOD/ \
  --path-rename $S_PACKAGE/reporting/:$D_PACKAGE/$MOD/ \
  --path-rename $S_PACKAGE/tests/test_reporting.py:$D_PACKAGE/tests/test_report.py \
  --path-rename $S_PACKAGE/tests/reporting/:$D_PACKAGE/tests/$MOD/

git filter-repo \
  --refs $BRANCH --force --debug \
  --message-callback 'return re.sub(b"^[a-z]", message[:1].upper(), message)' \
  --path doc/api/$MOD/ \
  --path $D_PACKAGE/

git filter-repo \
 --refs $BRANCH --force --debug \
 --invert-paths \
 --path-glob "$D_PACKAGE/data/report/*.xlsx" \
 --path-glob "$D_PACKAGE/data/report/advanced_*" \
 --path-glob "$D_PACKAGE/data/report/*_aggregates.csv" \
 --path $D_PACKAGE/data/report/fil_files \
 --path-glob "$D_PACKAGE/data/report/default_*" \
 --path $D_PACKAGE/data/report/ENGAGE* \
 --path $D_PACKAGE/data/report/materials-units.yaml \
 --path-glob "$D_PACKAGE/data/report/navigate*"

Resulting: rebase.txt

How to review

  • Read the migrated docs page and ensure the contents are coherent.
  • Note that the added tests pass in the CI workflows.

PR checklist

@khaeru khaeru added the enh New features or functionality label Aug 30, 2023
@khaeru khaeru self-assigned this Aug 30, 2023
khaeru added a commit that referenced this pull request Aug 30, 2023
@khaeru khaeru mentioned this pull request Aug 30, 2023
4 tasks
khaeru added a commit that referenced this pull request Aug 30, 2023
khaeru added a commit that referenced this pull request Aug 31, 2023
khaeru added a commit that referenced this pull request Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #116 (87ab426) into main (419615a) will decrease coverage by 1.5%.
The diff coverage is 54.3%.

@@           Coverage Diff           @@
##            main    #116     +/-   ##
=======================================
- Coverage   68.4%   66.9%   -1.5%     
=======================================
  Files         63      70      +7     
  Lines       4176    4635    +459     
=======================================
+ Hits        2857    3104    +247     
- Misses      1319    1531    +212     
Files Changed Coverage Δ
message_ix_models/cli.py 100.0% <ø> (ø)
message_ix_models/report/sim.py 0.0% <0.0%> (ø)
message_ix_models/report/computations.py 38.9% <38.9%> (ø)
message_ix_models/report/cli.py 40.8% <40.8%> (ø)
message_ix_models/report/util.py 51.8% <51.8%> (ø)
message_ix_models/report/__init__.py 62.6% <62.6%> (ø)
message_ix_models/util/_logging.py 97.1% <87.5%> (-2.9%) ⬇️
message_ix_models/tests/test_report.py 88.1% <88.1%> (ø)
message_ix_models/testing.py 100.0% <100.0%> (ø)
...essage_ix_models/tests/report/test_computations.py 100.0% <100.0%> (ø)
... and 2 more

@khaeru khaeru mentioned this pull request Aug 31, 2023
3 tasks
@khaeru
Copy link
Member Author

khaeru commented Aug 31, 2023

The codecov/patch and codecov/project check failures are noted, and will be addressed in (a) follow-up PR(s) along with other items described at #118.

@khaeru khaeru merged commit 2f62b67 into main Aug 31, 2023
khaeru added a commit that referenced this pull request Jul 29, 2024
- moved upstream in #116 and updated there to be
  compatible with pandas 2.1.0.
- remove associated tests.
- update usage in .transport.computations.factor_input().
khaeru added a commit that referenced this pull request Jul 30, 2024
- moved upstream in #116 and updated there to be
  compatible with pandas 2.1.0.
- remove associated tests.
- update usage in .transport.computations.factor_input().
@glatterf42 glatterf42 deleted the migrate-report branch August 14, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enh New features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants