Skip to content

Commit

Permalink
Add code owners for .workflow (#278)
Browse files Browse the repository at this point in the history
* Copyedit doc/api/workflow.rst
  • Loading branch information
khaeru authored Jan 15, 2025
1 parent 4fad5ac commit c782c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Includes this file, GitHub Actions workflows, and more
/.github @khaeru @glatterf42

/doc/api/workflow.rst @khaeru @glatterf42
/message_ix_models/workflow.py @khaeru @glatterf42
/message_ix_models/tests/test_workflow.py @khaeru @glatterf42

/doc/api/tools-costs.rst @measrainsey
/message_ix_models/data/costs @measrainsey
/message_ix_models/data/intratec @measrainsey
Expand Down
8 changes: 4 additions & 4 deletions doc/api/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The generic pattern for workflows is:

- Solve the target scenario.
- Invoke reporting.
4. The resulting function is passed to the next workflow step.
4. The resulting scenario is passed to the next workflow step.

- A workflow can consist of any number of scenarios and steps.
- The same precursor scenario can be used as the basis for multiple target scenarios.
Expand All @@ -56,7 +56,7 @@ These functions **must**:

1. A :class:`.Context` instance.
2. The precursor scenario.
3. Optionally additional, keyword-only arguments.
3. (Optional) Additional, keyword-only arguments.

- Return either:

Expand All @@ -75,14 +75,14 @@ and they **should**:

.. code-block:: python
def changes_a(s: Scenario) -> None:
def changes_a(c: Context, s: Scenario) -> None:
"""Change a scenario by modifying structure data, but not data."""
with s.transact():
s.add_set("technology", "test_tech")
# Here, invoke other code to further modify `s`
def changes_b(s: Scenario, value=100.0) -> None:
def changes_b(c: Context, s: Scenario, *, value=100.0) -> None:
"""Change a scenario by modifying parameter data, but not structure.
This function takes an extra argument, `values`, so functools.partial()
Expand Down

0 comments on commit c782c30

Please sign in to comment.