Add documentation for commodity price calculations#1362
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1362 +/- ##
==========================================
- Coverage 89.75% 89.68% -0.07%
==========================================
Files 58 58
Lines 8529 8406 -123
Branches 8529 8406 -123
==========================================
- Hits 7655 7539 -116
+ Misses 561 550 -11
- Partials 313 317 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new user-facing documentation page describing how MUSE2 calculates commodity prices after dispatch, including an end-to-end worked example for full-cost pricing (per the referenced issues).
Changes:
- Add a new “Commodity Prices” page under the Model Description section.
- Document pricing strategies, cost component breakdowns, ordering logic (including cycles), and a worked example.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docs/SUMMARY.md | Adds the new “Commodity Prices” page to the mdBook table of contents. |
| docs/model/prices.md | New documentation page describing pricing strategies and worked examples for commodity price calculation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
dc2917
left a comment
There was a problem hiding this comment.
A couple of minor suggestions but otherwise looks good to me
alexdewar
left a comment
There was a problem hiding this comment.
Looks good! A useful resource. I've put some comments.
Maybe you could link to this page from the docs for src/simulation/prices.rs? (Though bear in mind the URL may change soon, see: #1366 (comment)).
I spotted one place where we are using a different name for the variable elsewhere in the docs from what's here (there may be more), but your naming scheme is at least internally consistent, so I think that's better. We have a bit of a mix of single letters, snake case and Pascal case in equations. Not sure if we should do something about that.
| highest-cost active asset producing the commodity. | ||
| - **`shadow`**: Prices are taken directly from the shadow prices (dual values) of the commodity | ||
| balance constraints in the dispatch optimisation. | ||
| - **`scarcity`**: Prices are set to the shadow price plus the highest activity dual of the assets |
There was a problem hiding this comment.
Side note: I think this option might be misnamed. I had it in mind it removes the effect of scarcity from prices. scarcity_adjusted or something might be clearer.
I admittedly didn't make much of an attempt to make it consistent with the rest of the docs. Probably should be long run, but I think we'd need to agree upon a proper naming scheme before embarking on that. |
Done, although linkchecker will fail until this is merged |
alexdewar
left a comment
There was a problem hiding this comment.
LGTM! Tried it locally and it renders nicely.
I spotted one place where we are using a different name for the variable elsewhere in the docs from what's here (there may be more), but your naming scheme is at least internally consistent, so I think that's better. We have a bit of a mix of single letters, snake case and Pascal case in equations. Not sure if we should do something about that.
I admittedly didn't make much of an attempt to make it consistent with the rest of the docs. Probably should be long run, but I think we'd need to agree upon a proper naming scheme before embarking on that.
Agreed! I think this is fine for now.
Maybe you could link to this page from the docs for
src/simulation/prices.rs? (Though bear in mind the URL may change soon, see: #1366 (comment)).Done, although linkchecker will fail until this is merged
👍 Feel free to bypass and merge as long as there are no other failures.
@AdrianDAlessandro This is another link that will need updating for #1366.
| <!-- markdownlint-disable MD024 --> | ||
| ## Example |
There was a problem hiding this comment.
Ah ok! My bad. This is fine then
Description
Adds documentation describing the approach for calculating commodity prices. Includes the example laid out in #1128 (comment)
Fixes #1034
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks