-
Notifications
You must be signed in to change notification settings - Fork 41
Manual adjustments for .engage.workflow
migration
#351
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
Conversation
e370556
to
e20d9fd
Compare
ae577d6
to
5b6958e
Compare
- Format docstrings according to code style, wrap at 88 characters. - Correct misspellings. - Add type hints. - Use Scenario.transact() where possible. - Use f-strings. - Use ScenarioInfo.Y instead of get_optimization_years(). - Use ScenarioInfo.N instead of get_nodes(). - Remove if __name__ == "__main__" blocks.
- Sort and adjust imports.
5b6958e
to
85bc5a3
Compare
- Adjust imports. - Type hint test functions.
- Use parametrized generics from default collections. - Import from collections.abc instead of typing.
- Copied from: https://github.com/iiasa/navigate-workflow - file definitions/scenario/scenarios.yaml - commit abb23814b7de3618ec4287ec014ddfce3e07c030 (2023-04-21) - Adjust code that reads this file to use the new location.
85bc5a3
to
3156c69
Compare
- Use path_fallback in .navigate.wp2.utils. - Change load_private_data → load_package_data in .buildings.build.load_config().
3156c69
to
0054ac1
Compare
0054ac1
to
108a3b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me :)
|
||
from message_ix import Scenario | ||
|
||
from message_ix_models import Context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like all the new type hints :)
I'm just wondering: what's the benefit of importing these only if TYPE_CHECKING
? Does this save actual runtime for the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it has any performance effect.
I usually follow the heuristic "things used only for type checking in a module are imported in a TYPE_CHECKING block". The corollary is that the top-level import
s contain only things actually referenced/called in the module.
This habit has helped me a number of times to avoid issues with circular imports.
This documentation and the related code was migrated from :mod:`message_data` ``dev`` | ||
branch as of commit 8213e6c (2025-05-08) in :pull:`350`. | ||
It does not reflect further changes made on the :mod:`message_data` ``main`` branch, | ||
other related branches, or in forks or other repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clear to me, but I might not be the best to judge this since I already understood this concept when I migrated the legacy reporting version.
This branch makes additional adjustments to the branch for #350 after the semi-automated migration process.
These include:
How to review
.engage.workflow
migration #351 in the preview build of the docs, and all the pages/functions it links to; ensure they clearly indicate the state of the code.PR checklist