Skip to content

Fix: Docs wrongly states that NPV is broken#1214

Merged
alexdewar merged 3 commits intomainfrom
fix-schema-npv-not-broken
Mar 19, 2026
Merged

Fix: Docs wrongly states that NPV is broken#1214
alexdewar merged 3 commits intomainfrom
fix-schema-npv-not-broken

Conversation

@alexdewar
Copy link
Copy Markdown
Member

Description

NPV is now not broken and users are free to use it, though in the docs for input files it wrongly states that NPV is broken. Update docs accordingly.

Also update a stale comment saying the same thing.

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

NPV is now not broken and users are free to use it, though in the docs for input files it wrongly states that NPV is broken. Update docs accordingly.
Copilot AI review requested due to automatic review settings March 19, 2026 12:58
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.31%. Comparing base (6c9170c) to head (b771079).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1214   +/-   ##
=======================================
  Coverage   89.31%   89.31%           
=======================================
  Files          57       57           
  Lines        7974     7974           
  Branches     7974     7974           
=======================================
  Hits         7122     7122           
  Misses        555      555           
  Partials      297      297           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates repository documentation and inline comments to remove outdated statements that NPV support is “broken”, aligning user-facing guidance with current behavior.

Changes:

  • Removes the stale “NPV is broken” reference from an investment-selection comment.
  • Updates the agent objectives input schema docs to allow npv without warning text and lightly reflows notes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/simulation/investment.rs Removes outdated NPV “known issue” reference from an inline comment in the investment selection loop.
schemas/input/agent_objectives.yaml Updates schema notes for objective_type and reflows years notes to remove “NPV broken” warning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/simulation/investment.rs Outdated
Comment on lines 801 to 806
// Check if all options have zero capacity. If so, we cannot meet demand, so have to bail
// out.
//
// This may happen if:
// - the asset has zero activity limits for all time slices with
// This may happen if the asset has zero activity limits for all time slices with
// demand.
// - known issue with the NPV objective
// (see https://github.com/EnergySystemsModellingLab/MUSE2/issues/716).
if outputs_for_opts.is_empty() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, good point. It's not necessarily about having zero capacity anymore... I'll tweak this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to rename the sort_apparisal_outputs_by_investment_priority function to make it clear it also does filtering and move comments around so it's obvious when/why we're discarding non-feasible options

Comment thread schemas/input/agent_objectives.yaml
@alexdewar alexdewar enabled auto-merge March 19, 2026 15:35
@alexdewar alexdewar merged commit 68cd34e into main Mar 19, 2026
8 checks passed
@alexdewar alexdewar deleted the fix-schema-npv-not-broken branch March 19, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants