Skip to content

Conversation

@ParticularlyPythonicBS
Copy link
Member

@ParticularlyPythonicBS ParticularlyPythonicBS commented Jan 16, 2026

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Myopic Optimization documentation covering configuration, workflow, efficiency semantics, and backtracking behavior.
    • Added the Myopic section to the documentation navigation.
    • Improved structure of an existing documentation entry by converting a plain label into a referenced directive for clearer linking.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Walkthrough

Documentation-only change: adds a new docs/source/myopic.rst for Myopic Optimization, inserts "myopic" into the docs toctree, and updates docs/source/computational_implementation.rst to reference the myopic page via a doc directive.

Changes

Cohort / File(s) Summary
Myopic feature documentation
docs/source/myopic.rst
New documentation describing Myopic Optimization: purpose, configuration (scenario_mode and [myopic] options), operational flow (initialization, per-window solving, efficiency table updates), table semantics, and backtracking behavior on infeasibility.
Documentation navigation and reference
docs/source/index.rst, docs/source/computational_implementation.rst
Added "myopic" entry to the toctree in index.rst. Converted the plain myopic label in computational_implementation.rst to a :doc: directive referencing myopic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'myopic feature documentation' accurately reflects the main changes: adding documentation for the myopic feature across three files (index.rst, computational_implementation.rst, and myopic.rst).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/source/myopic.rst`:
- Around line 65-68: Split the long sentence in the "Backtracking and Roll-back"
paragraph into shorter sentences to improve readability: locate the paragraph
describing the Myopic sequencer's roll-back mechanism (mentions "Myopic
sequencer", "roll-back", and "view_depth") and break the single long sentence
into two or three concise sentences — e.g., one sentence explaining that it will
back up to the previous window and re-solve with an expanded view_depth, and a
second sentence stating that if it cannot back up further the run will abort
with an error — preserving the original meaning and terminology.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0093b3 and 4b43e58.

📒 Files selected for processing (3)
  • docs/source/computational_implementation.rst
  • docs/source/index.rst
  • docs/source/myopic.rst
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: setup and test (windows-latest, 3.13)
  • GitHub Check: setup and test (windows-latest, 3.12)
  • GitHub Check: setup and test (macos-latest, 3.13)
  • GitHub Check: setup and test (macos-latest, 3.12)
🔇 Additional comments (7)
docs/source/myopic.rst (5)

1-8: LGTM!

The introduction clearly describes the myopic optimization concept and its purpose. The RST formatting is correct with proper title markup and reference label.


9-18: LGTM!

The framework overview provides a clear high-level description of the myopic extension's capabilities. The bullet points are well-organized and easy to understand.


19-40: LGTM!

The configuration section is well-structured with:

  • Clear TOML example
  • Detailed parameter descriptions
  • Proper use of the .. important:: directive to highlight the critical database requirement

The technical details about view_depth and step_size are explained clearly with practical examples.


41-54: LGTM!

The "How it Works" section provides an excellent step-by-step walkthrough of the myopic optimization algorithm. The hierarchical structure with numbered steps and sub-steps makes the sequential process easy to follow. The term "ghost capacity" is particularly descriptive for planned but unbuilt technologies.


55-64: LGTM!

The Myopic Efficiency Table section clearly explains this critical internal data structure and its role in filtering technologies across optimization windows. The bullet points effectively describe the dynamic maintenance behavior.

docs/source/computational_implementation.rst (1)

470-470: LGTM!

The update properly uses the :doc: directive to reference the new myopic documentation. This creates a proper cross-reference link and is consistent with the documentation structure for other extensions like monte_carlo (line 469) and stochastics (line 472).

docs/source/index.rst (1)

8-8: LGTM!

The addition of myopic to the toctree properly integrates the new documentation into the main documentation index. The placement is consistent with the existing structure.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +65 to +68
Backtracking and Roll-back
--------------------------

If the solver fails to find an optimal solution for a given window (e.g., due to infeasibility caused by previous decisions), the Myopic sequencer has a built-in roll-back mechanism. It will attempt to back up to the previous window and re-solve with an expanded ``view_depth`` to find a feasible path forward. If it cannot back up further, the run will abort with an error.
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider breaking the long sentence for improved readability.

The backtracking mechanism is clearly described, but the single long sentence (line 68) could be split into multiple sentences to improve readability:

♻️ Proposed refactor for improved readability
-If the solver fails to find an optimal solution for a given window (e.g., due to infeasibility caused by previous decisions), the Myopic sequencer has a built-in roll-back mechanism. It will attempt to back up to the previous window and re-solve with an expanded ``view_depth`` to find a feasible path forward. If it cannot back up further, the run will abort with an error.
+If the solver fails to find an optimal solution for a given window (e.g., due to infeasibility caused by previous decisions), the Myopic sequencer has a built-in roll-back mechanism.
+
+The sequencer will attempt to back up to the previous window and re-solve with an expanded ``view_depth`` to find a feasible path forward. If it cannot back up further, the run will abort with an error.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Backtracking and Roll-back
--------------------------
If the solver fails to find an optimal solution for a given window (e.g., due to infeasibility caused by previous decisions), the Myopic sequencer has a built-in roll-back mechanism. It will attempt to back up to the previous window and re-solve with an expanded ``view_depth`` to find a feasible path forward. If it cannot back up further, the run will abort with an error.
Backtracking and Roll-back
--------------------------
If the solver fails to find an optimal solution for a given window (e.g., due to infeasibility caused by previous decisions), the Myopic sequencer has a built-in roll-back mechanism.
The sequencer will attempt to back up to the previous window and re-solve with an expanded ``view_depth`` to find a feasible path forward. If it cannot back up further, the run will abort with an error.
🤖 Prompt for AI Agents
In `@docs/source/myopic.rst` around lines 65 - 68, Split the long sentence in the
"Backtracking and Roll-back" paragraph into shorter sentences to improve
readability: locate the paragraph describing the Myopic sequencer's roll-back
mechanism (mentions "Myopic sequencer", "roll-back", and "view_depth") and break
the single long sentence into two or three concise sentences — e.g., one
sentence explaining that it will back up to the previous window and re-solve
with an expanded view_depth, and a second sentence stating that if it cannot
back up further the run will abort with an error — preserving the original
meaning and terminology.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@docs/source/myopic.rst`:
- Line 83: The wording in the "Limited Foresight" bullet uses an informal phrase
("stupid but cost-saving"); replace it with a more formal alternative such as
"locally optimal but globally suboptimal" or "short-sighted but cost-effective"
and update the sentence around the ``view_depth`` reference so it reads: Myopic
mode cannot see beyond the specified ``view_depth``, which can lead the model to
make locally optimal but globally suboptimal (short-sighted but cost-effective)
decisions in early windows and cause rollbacks when later constraints enter the
visibility window—advise caution when setting ``view_depth`` relative to known
future constraints.
- Line 61: The term "visibility window" appears only once in the text (line
containing "* Items not built in a previous window's visibility window are
removed.") and is inconsistent with the rest of the doc; replace that phrase
with the established terminology used elsewhere (e.g., "look-ahead window" or
simply "window") so the line reads "* Items not built in a previous window's
look-ahead window are removed." (or "* Items not built in a previous window are
removed.") and scan the surrounding paragraphs to ensure the chosen term matches
uses of "view_depth" and "optimization windows".

The ``myopic_efficiency`` table is a key internal component of the myopic sequencer. It acts as a dynamic version of the standard ``efficiency`` table, filtered for each optimization window.

* It is "actively maintained" during the run.
* Items not built in a previous window's visibility window are removed.
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider using consistent terminology.

The phrase "visibility window" on line 61 is the only occurrence of this term. For consistency with terminology used elsewhere in the document (e.g., "view_depth", "optimization windows"), consider using "look-ahead window" or simply "window" instead.

♻️ Proposed terminology alignment
-* Items not built in a previous window's visibility window are removed.
+* Items not built in a previous window's look-ahead period are removed.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* Items not built in a previous window's visibility window are removed.
* Items not built in a previous window's look-ahead period are removed.
🤖 Prompt for AI Agents
In `@docs/source/myopic.rst` at line 61, The term "visibility window" appears only
once in the text (line containing "* Items not built in a previous window's
visibility window are removed.") and is inconsistent with the rest of the doc;
replace that phrase with the established terminology used elsewhere (e.g.,
"look-ahead window" or simply "window") so the line reads "* Items not built in
a previous window's look-ahead window are removed." (or "* Items not built in a
previous window are removed.") and scan the surrounding paragraphs to ensure the
chosen term matches uses of "view_depth" and "optimization windows".

~~~~~~~~~~~~~~~~~~~~~~~

* **Investment Amortization**: Investment costs in Temoa are amortized over the useful life of a built technology. This harmonizes how the model perceives costs and benefits within the ``view_depth``: since the model only sees the benefits of a technology for the portion of its life that falls within the current window, the costs are similarly distributed. Consequently, discounted investment costs reported in summary logs may be significantly higher than those reported in the ``output_cost`` table.
* **Limited Foresight**: Myopic mode cannot see beyond the specified ``view_depth``, including constraints. If a constraint only becomes active later in the planning horizon, the model may make "stupid but cost-saving" decisions in early windows. This can lead to unexpected rollbacks when those constraints finally enter the visibility window, which can complicate the interpretation of the results. Modeler caution is advised when setting the ``view_depth`` relative to known future constraints.
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider more formal phrasing (optional).

The phrase "stupid but cost-saving" effectively conveys the concept of locally optimal but globally suboptimal decisions. However, for more formal technical documentation, you might consider alternatives like "locally optimal but globally suboptimal" or "short-sighted but cost-effective".

♻️ Proposed more formal phrasing
-If a constraint only becomes active later in the planning horizon, the model may make "stupid but cost-saving" decisions in early windows.
+If a constraint only becomes active later in the planning horizon, the model may make locally optimal but globally suboptimal decisions in early windows.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* **Limited Foresight**: Myopic mode cannot see beyond the specified ``view_depth``, including constraints. If a constraint only becomes active later in the planning horizon, the model may make "stupid but cost-saving" decisions in early windows. This can lead to unexpected rollbacks when those constraints finally enter the visibility window, which can complicate the interpretation of the results. Modeler caution is advised when setting the ``view_depth`` relative to known future constraints.
* **Limited Foresight**: Myopic mode cannot see beyond the specified ``view_depth``, including constraints. If a constraint only becomes active later in the planning horizon, the model may make locally optimal but globally suboptimal decisions in early windows. This can lead to unexpected rollbacks when those constraints finally enter the visibility window, which can complicate the interpretation of the results. Modeler caution is advised when setting the ``view_depth`` relative to known future constraints.
🤖 Prompt for AI Agents
In `@docs/source/myopic.rst` at line 83, The wording in the "Limited Foresight"
bullet uses an informal phrase ("stupid but cost-saving"); replace it with a
more formal alternative such as "locally optimal but globally suboptimal" or
"short-sighted but cost-effective" and update the sentence around the
``view_depth`` reference so it reads: Myopic mode cannot see beyond the
specified ``view_depth``, which can lead the model to make locally optimal but
globally suboptimal (short-sighted but cost-effective) decisions in early
windows and cause rollbacks when later constraints enter the visibility
window—advise caution when setting ``view_depth`` relative to known future
constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants