Skip to content

Conversation

@ParticularlyPythonicBS
Copy link
Member

@ParticularlyPythonicBS ParticularlyPythonicBS commented Jan 5, 2026

Uses make target instead of direct sphinx builder and fixes latex specific formatting and compatibility issues.

Summary by CodeRabbit

  • Documentation
    • Improved PDF build: changed build output dir, recommend latexmk, and added a runtime fallback to pdflatex when latexmk is unavailable; updated build command to use make latexpdf.
    • Updated PDF instructions to include TeX Live for Windows/Linux.
    • Fixed LaTeX/math formatting and escaped subscripts for consistency.
    • Updated diagram path patterns, replaced emoji/status icons with bracketed markers, and trimmed trailing whitespace in quick-start docs.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 5, 2026

Walkthrough

Updated documentation and build scripts: changed Sphinx build output directory, made the latexpdf Makefile target detect latexmk and fall back to two pdflatex runs with messages; multiple docs edits (figure path, status marker formats, whitespace) and escaped underscores / formatting fixes in component docstrings. No functional code changes.

Changes

Cohort / File(s) Summary
Build tooling & README
docs/Makefile, docs/README.md
BUILDDIR set to _build; latexpdf target now checks for latexmk and falls back to a two-run pdflatex sequence with explanatory echoes; README updated to recommend latexmk/TeX Live and use make latexpdf.
Docs: status markers & wording
docs/source/computational_implementation.rst, docs/source/unit_checking.rst, docs/source/quick_start.rst
Replaced emoji markers with bracketed indicators (e.g., ([!]), [V], [X]); fixed minor whitespace; other small wording/formatting changes.
Docs: figures & math formatting
docs/source/Documentation.rst, docs/source/mathematical_formulation.rst
Graphviz figure path made generic (images/results1990.*); LaTeX subscripts adjusted to escape underscores (e.g., Theta_{\text{cost\_invest}}).
Component docstrings / notation
temoa/components/limits.py, temoa/components/operations.py, temoa/components/storage.py
Escaped underscores in LaTeX-like identifiers across constraints and docstrings; storage constraint docstring formatting cleaned (denominator, MPL/CAP, days_per_period). No logic or API changes.

Sequence Diagram(s)

(omitted — changes are documentation and small Makefile control flow that do not meet diagram criteria)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Pre-merge checks and finishing touches

✅ 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 'Fixing regressions in pdf documentation building' directly and accurately summarizes the main purpose of the PR, which involves fixing LaTeX formatting, updating the build process to use make targets instead of direct Sphinx invocation, and addressing PDF generation compatibility issues across multiple documentation files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent 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 0d6ae91 and 48d339b.

⛔ Files ignored due to path filters (3)
  • docs/source/images/graphviz_examples/results1990.pdf is excluded by !**/*.pdf
  • docs/source/images/results1990.pdf is excluded by !**/*.pdf
  • docs/source/images/results1990.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • docs/Makefile
  • docs/README.md
  • docs/source/Documentation.rst
  • docs/source/computational_implementation.rst
  • docs/source/mathematical_formulation.rst
  • docs/source/quick_start.rst
  • docs/source/unit_checking.rst
  • temoa/components/limits.py
  • temoa/components/operations.py
  • temoa/components/storage.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-30T14:37:44.260Z
Learnt from: idelder
Repo: TemoaProject/temoa PR: 180
File: temoa/components/limits.py:632-647
Timestamp: 2025-10-30T14:37:44.260Z
Learning: In the `limit_tech_input_split_average_constraint` function in `temoa/components/limits.py`, there was a bug where the `total_inp` summation incorrectly used the fixed variable `i` instead of the loop variable `S_i` when indexing `processOutputsByInput` and calling `get_variable_efficiency`. This pattern should be watched for in similar aggregation constraints: when summing over a loop variable like `S_i`, all references within that loop should use `S_i`, not a fixed outer variable.

Applied to files:

  • temoa/components/storage.py
  • temoa/components/limits.py
⏰ 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.12)
  • GitHub Check: setup and test (windows-latest, 3.13)
  • GitHub Check: setup and test (macos-latest, 3.12)
  • GitHub Check: setup and test (macos-latest, 3.13)
🔇 Additional comments (12)
docs/source/quick_start.rst (1)

160-167: Whitespace change noted.

Line 167 removes trailing whitespace at the end of "be optimized." in the database construction section, consistent with code formatting standards.

docs/source/computational_implementation.rst (1)

381-392: LaTeX-compatible status marker formatting improves PDF documentation rendering.

Status markers have been updated from emoji format (⚠️) to ASCII-safe bracketed format ([!]) for better LaTeX/PDF compatibility. This change affects documentation annotations for untested modules in temoa.data_processing (lines 381-382) and temoa.extensions (lines 387-392).

This is a documentation-only formatting improvement with no functional impact. The new format is more compatible with LaTeX PDF document generation.

docs/source/mathematical_formulation.rst (1)

1067-1067: LaTeX notation properly escaped and grouped for PDF compatibility.

Line 1067 improves LaTeX notation formatting by:

  1. Adding braces around the subscript text: \text{cost\_invest} instead of \text{cost_invest}
  2. Escaping the underscore within the text: cost\_invest prevents LaTeX from interpreting underscore as a subscript operator

This change fixes LaTeX/PDF rendering of the mathematical notation and aligns with the PR's goal of addressing LaTeX formatting regressions. The notation now correctly renders in PDF output.

docs/source/Documentation.rst (1)

80-80: LGTM! Wildcard pattern enables multi-format compatibility.

Changing the figure path to use a wildcard pattern (.*) allows Sphinx to automatically select the appropriate image format for each output target (SVG for HTML, PDF-compatible formats for LaTeX), which aligns with the PR's goal of fixing PDF documentation building.

temoa/components/operations.py (2)

284-284: LGTM! Underscore escaping fixes LaTeX compilation.

Escaping the underscore in the LaTeX set notation (ramp_up_dayramp\_up\_day) prevents LaTeX compilation errors when generating PDF documentation. This is consistent with similar fixes across other component files.


387-387: LGTM! Underscore escaping fixes LaTeX compilation.

Escaping the underscore in the LaTeX set notation (ramp_down_dayramp\_down\_day) prevents LaTeX compilation errors when generating PDF documentation.

docs/source/unit_checking.rst (1)

103-107: LGTM! ASCII markers improve LaTeX/PDF compatibility.

Replacing emoji markers (✅/❌) with ASCII bracketed indicators ([V]/[X]) throughout the documentation ensures reliable rendering in PDF outputs where emoji support may be inconsistent or require special LaTeX packages. This directly addresses the PDF building regressions mentioned in the PR objectives.

Also applies to: 115-118, 141-142, 149-149, 158-159, 166-167, 170-172, 182-183, 191-193, 244-245, 248-250, 280-281, 284-285, 287-288, 290-291, 332-354

docs/Makefile (1)

109-124: LGTM! Robust fallback logic for PDF generation.

The latexpdf target now gracefully handles environments without latexmk by:

  1. Checking for latexmk availability at runtime
  2. Falling back to manual pdflatex with two passes (standard practice for resolving references and citations)
  3. Providing clear user feedback about which path is being used

The first pdflatex pass uses || true to tolerate warnings while generating auxiliary files, and the second pass enforces strict error handling. This directly addresses the PDF building regressions mentioned in the PR objectives.

docs/README.md (2)

46-46: LGTM! TeX Live added as a LaTeX distribution option.

Adding TeX Live provides Linux and Unix users with their preferred LaTeX distribution option alongside MiKTeX.


51-51: LGTM! Build command corrected to use Makefile target.

Changing from sphinx-build -b latexpdf to make latexpdf is correct. The latexpdf is a Makefile target, not a Sphinx builder (the builder is latex). This change aligns with the updated Makefile implementation and provides access to the improved fallback logic.

temoa/components/storage.py (1)

506-512: LGTM! LaTeX formatting fixes are correct.

The underscore escaping in the \Theta reference and formula formatting updates are appropriate for PDF documentation generation.

temoa/components/limits.py (1)

257-257: LGTM! Underscore escaping is correct for LaTeX.

The escaped underscores in \text{} blocks within the \Theta constraint references are necessary for proper PDF documentation rendering.

Also applies to: 313-313, 460-460, 465-465, 522-522, 528-528, 711-711, 746-746, 823-823, 935-935, 943-943, 1301-1301, 1305-1305, 1381-1381


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: 3

Fix all issues with AI Agents 🤖
In @docs/Makefile:
- Around line 8-10: The Makefile has an outdated commented assignment and note
next to the BUILDDIR variable; update or remove the obsolete comment lines
referencing "/tmp/TemoaDocumentationBuild" so the comment accurately reflects
that BUILDDIR is set to "_build" (Sphinx default) and no longer to "build" or
the temp path; locate the BUILDDIR definition and either delete the two
commented lines or replace them with a short, accurate comment explaining that
"_build" is the Sphinx output directory.

In @docs/README.md:
- Around line 44-46: Update the README text to clarify that latexmk is
recommended but not required: change the sentence that currently says "you'll
need LaTeX and `latexmk` installed" to state "you'll need LaTeX installed;
`latexmk` is recommended for automatic PDF generation" and mention the fallback
to manual pdflatex is available (as implemented in the Makefile rules that fall
back to pdflatex when `latexmk` is unavailable).

In @temoa/components/limits.py:
- Line 257: Update the Theta docstring labels so they match the actual
constraint identifiers: replace occurrences of "limit_growth_capacity" and
"limit_degrowth_capacity" with "limit_growth_new_capacity" and
"limit_degrowth_new_capacity", and replace "limit_growth_capacityDelta" and
"limit_degrowth_capacityDelta" (camelCase) with
"limit_growth_new_capacity_delta" and "limit_degrowth_new_capacity_delta" so the
Theta_{...} labels align with the constraint names
limit_growth_new_capacity_constraint, limit_degrowth_new_capacity_constraint,
limit_growth_new_capacity_delta_constraint, and
limit_degrowth_new_capacity_delta_constraint in the module.
📜 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 b284706 and dcb41a2.

⛔ Files ignored due to path filters (3)
  • docs/source/images/graphviz_examples/results1990.pdf is excluded by !**/*.pdf
  • docs/source/images/results1990.pdf is excluded by !**/*.pdf
  • docs/source/images/results1990.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • docs/Makefile
  • docs/README.md
  • docs/source/Documentation.rst
  • docs/source/computational_implementation.rst
  • docs/source/mathematical_formulation.rst
  • docs/source/quick_start.rst
  • docs/source/unit_checking.rst
  • temoa/components/limits.py
  • temoa/components/operations.py
  • temoa/components/storage.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-30T14:37:44.260Z
Learnt from: idelder
Repo: TemoaProject/temoa PR: 180
File: temoa/components/limits.py:632-647
Timestamp: 2025-10-30T14:37:44.260Z
Learning: In the `limit_tech_input_split_average_constraint` function in `temoa/components/limits.py`, there was a bug where the `total_inp` summation incorrectly used the fixed variable `i` instead of the loop variable `S_i` when indexing `processOutputsByInput` and calling `get_variable_efficiency`. This pattern should be watched for in similar aggregation constraints: when summing over a loop variable like `S_i`, all references within that loop should use `S_i`, not a fixed outer variable.

Applied to files:

  • temoa/components/limits.py
🔇 Additional comments (11)
docs/source/quick_start.rst (1)

85-85: LaTeX/PDF compatibility fix: Standardize quotes around config.

Replacing smart quotes with ASCII straight quotes is the correct approach for ensuring LaTeX/PDF builders handle documentation correctly without escaping issues.

docs/source/mathematical_formulation.rst (1)

1064-1064: LaTeX best practice: Escape underscores in subscript text notation.

The change from \Theta_{\text{cost_invest}} to \Theta_{\text{cost\_invest}} properly escapes underscores within LaTeX text mode, preventing PDF build failures. This follows standard LaTeX conventions for literal underscores.

temoa/components/operations.py (3)

284-284: LaTeX best practice: Escape underscores in docstring subscript notation.

The ramp_up_day constraint docstring properly escapes underscores in the mathematical notation \Theta_{\text{ramp\_up\_day}}, ensuring PDF documentation builders handle the LaTeX correctly.


387-387: LaTeX best practice: Escape underscores in docstring subscript notation.

The ramp_down_day constraint docstring properly escapes underscores in the mathematical notation \Theta_{\text{ramp\_down\_day}}, consistent with LaTeX formatting for PDF generation.


1-593: No action required. All constraint docstrings with Theta notation across temoa/components/ have been consistently updated with properly escaped underscores in \text{} blocks. Coverage spans operations.py, limits.py, storage.py, reserves.py, geography.py, costs.py, and emissions.py.

docs/source/computational_implementation.rst (1)

381-392: Status marker standardization improves PDF rendering and accessibility.

Replacing emoji markers (⚠️) with text-based markers ([!]) is appropriate for:

  • Improving LaTeX/PDF rendering consistency
  • Enhancing accessibility across platforms
  • Aligning with documentation build goals

The changes are uniform and do not affect content or functionality.

docs/source/Documentation.rst (1)

80-89: Image files exist and wildcard pattern is correct.

The figure directive change to use the wildcard pattern (images/results1990.*) is valid. Both results1990.pdf and results1990.svg exist in docs/source/images/, allowing Sphinx to select the appropriate format for each builder (SVG for HTML, PDF for LaTeX). No issues found.

docs/source/unit_checking.rst (1)

103-353: LGTM! ASCII marker replacements improve PDF compatibility.

The replacement of Unicode emojis (✅, ❌, ⚠️) with ASCII markers ([V], [X], [!]) and arrow symbols (→) with "->" throughout the documentation enhances LaTeX/PDF rendering compatibility while maintaining semantic clarity. These changes directly address the PR objective of fixing PDF documentation build regressions.

temoa/components/storage.py (1)

506-512: LGTM! Proper LaTeX underscore escaping fixes PDF rendering.

The underscore escaping in the docstring's LaTeX math notation (\text{C2A}\text{C2A}, limit_storage_fractionlimit\_storage\_fraction, etc.) correctly addresses LaTeX compilation issues. Unescaped underscores in LaTeX text mode cause parse errors, so these changes are essential for PDF documentation generation.

docs/README.md (1)

51-51: LGTM! Simplified command aligns with new Makefile target.

The change from direct sphinx-build invocation to uv run make latexpdf is correct. The Makefile now handles the conditional logic for latexmk detection and fallback, simplifying the user experience.

docs/Makefile (1)

111-126: Good implementation of latexmk detection with fallback.

The conditional logic correctly detects latexmk availability and falls back to manual pdflatex with two passes for reference resolution. The LATEXOPTS are appropriate for CI/automation contexts.

One minor consideration: Line 120's || true allows the first pdflatex pass to continue on errors, which is intentional for unresolved references. However, the -halt-on-error flag in PDFLATEX should still catch genuine compilation errors before they're masked. The second pass (lines 122-125) runs without || true, ensuring real errors aren't silently ignored.

\le LR_{r, t}
\forall \{r, t\} \in \Theta_{\text{limit_resource}}"""
\forall \{r, t\} \in \Theta_{\text{limit\_resource}}"""
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's examine the file structure and verify it exists
ls -la temoa/components/limits.py 2>/dev/null && wc -l temoa/components/limits.py

Repository: TemoaProject/temoa

Length of output: 170


🏁 Script executed:

# Check lines around 1176, 1185, 1056, 1064 to verify constraint labels
sed -n '1050,1070p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 1014


🏁 Script executed:

sed -n '1170,1190p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 961


🏁 Script executed:

# Also check the function definitions to verify names
rg -n "def limit_growth|def limit_degrowth" temoa/components/limits.py

Repository: TemoaProject/temoa

Length of output: 824


🏁 Script executed:

# Verify underscore escaping in \text{} blocks across the file
rg -n '\\text\{[^}]*_' temoa/components/limits.py | head -20

Repository: TemoaProject/temoa

Length of output: 1631


🏁 Script executed:

# Check if the escaping is using \_ properly
rg -n '\\text\{[^}]*\\_' temoa/components/limits.py | head -20

Repository: TemoaProject/temoa

Length of output: 1631


🏁 Script executed:

# Read the full docstring context for lines 1034-1070 (limit_growth_new_capacity function)
sed -n '1034,1070p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 1888


🏁 Script executed:

# Read the full docstring context for lines 1151-1190 (limit_growth_new_capacity_delta function)
sed -n '1151,1190p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 2104


🏁 Script executed:

# Check the constraint indices function names to understand naming convention
sed -n '156,175p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 779


🏁 Script executed:

# Verify if the labels in \Theta correspond to actual constraint indices/set names
rg -n "limit_growth_capacity_indices|limit_growth_new_capacity_indices|limit_growth_new_capacity_delta_indices" temoa/components/limits.py | head -10

Repository: TemoaProject/temoa

Length of output: 258


🏁 Script executed:

# Check if constraint sets are actually defined with these names in the model
rg -n "limit_growth_capacity|limit_growth_new_capacity|limit_growth_capacityDelta|limit_growth_new_capacity_delta" temoa/components/limits.py | grep -E "(indices|def |\.declare|\.add)" | head -30

Repository: TemoaProject/temoa

Length of output: 524


🏁 Script executed:

# Check model declarations to see what constraint sets actually exist
rg -n "\.add\(|\.declare\(" temoa/components/limits.py | grep -i "capacity" | head -20

Repository: TemoaProject/temoa

Length of output: 44


🏁 Script executed:

# Check what constraint objects are actually declared in the model
rg -n "model\.limit_growth|model\.limit_degrowth" temoa/components/limits.py | grep -E "constraint|Constraint" | head -20

Repository: TemoaProject/temoa

Length of output: 44


🏁 Script executed:

# Get full context of how constraints are defined/added to model
sed -n '1080,1130p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 2670


🏁 Script executed:

# Find where constraint rules are registered/called
rg -n "constraint_rule|add_component" temoa/components/limits.py | grep -i "capacity" | head -30

Repository: TemoaProject/temoa

Length of output: 381


🏁 Script executed:

# Look for the actual constraint registration to see what names are used
rg -n "model\..*constraint|\.add_component" temoa/components/limits.py | head -40

Repository: TemoaProject/temoa

Length of output: 44


🏁 Script executed:

# Check the full context around the constraint rule definitions
sed -n '1020,1045p' temoa/components/limits.py | cat -n

Repository: TemoaProject/temoa

Length of output: 1460


🏁 Script executed:

# Find where constraints are declared/added to the model
find temoa -name "*.py" -exec grep -l "limit_growth_new_capacity\|limit_degrowth_new_capacity" {} \;

Repository: TemoaProject/temoa

Length of output: 184


🏁 Script executed:

# Check the model initialization or pyomo declarations
rg -n "Constraint|Declaration|add_component" temoa/components/ --type py -A 2 | grep -E "limit_growth|limit_degrowth" | head -40

Repository: TemoaProject/temoa

Length of output: 44


🏁 Script executed:

# Look for constraint declarations in a model/declarations file
find temoa -name "*model*" -o -name "*declaration*" | grep -E "\.(py|txt)$"

Repository: TemoaProject/temoa

Length of output: 211


🏁 Script executed:

# Check how constraints are declared in model.py
rg -n "limit_growth_new_capacity|limit_degrowth_new_capacity|limit_growth_capacity" temoa/core/model.py -B 2 -A 2 | head -80

Repository: TemoaProject/temoa

Length of output: 2984


🏁 Script executed:

# Check for constraint declarations in model.py more broadly
rg -n "\.add_component\(|Constraint" temoa/core/model.py | grep -i "limit" | head -40

Repository: TemoaProject/temoa

Length of output: 1792


🏁 Script executed:

# Final verification: confirm the constraint labels referenced in docstrings don't match constraint names
echo "=== Constraint declarations in model.py ==="
rg -n "limit_growth_new_capacity_constraint|limit_degrowth_new_capacity_constraint|limit_growth_new_capacity_delta" temoa/core/model.py | grep "Constraint("

echo "=== Docstring labels in limits.py ==="
rg -n "Theta.*limit_growth_capacity|Theta.*limit_degrowth_capacity|Theta.*capacityDelta" temoa/components/limits.py

Repository: TemoaProject/temoa

Length of output: 546


🏁 Script executed:

# Verify one more time if there's any comment or explanation in the code about label naming
sed -n '1050,1070p' temoa/components/limits.py | grep -A 5 -B 5 "limit_growth_capacity\|limit_degrowth_capacity"

Repository: TemoaProject/temoa

Length of output: 44


🏁 Script executed:

# Check if there are any comments or explanations for the capacityDelta naming
sed -n '1170,1190p' temoa/components/limits.py | grep -A 5 -B 5 "capacityDelta"

Repository: TemoaProject/temoa

Length of output: 769


Update constraint set labels in docstrings to match actual constraint names.

The underscore escaping in \text{} blocks is correct and necessary for LaTeX rendering.

However, the constraint set labels in the docstring Theta notation don't match the actual constraint names:

  • Lines 1056, 1064: Labels show limit_growth_capacity and limit_degrowth_capacity, but the constraints are limit_growth_new_capacity_constraint and limit_degrowth_new_capacity_constraint. Labels should be limit_growth_new_capacity and limit_degrowth_new_capacity.
  • Lines 1176, 1185: Labels show limit_growth_capacityDelta and limit_degrowth_capacityDelta (camelCase), but constraints are limit_growth_new_capacity_delta_constraint and limit_degrowth_new_capacity_delta_constraint. Labels should be limit_growth_new_capacity_delta and limit_degrowth_new_capacity_delta (snake_case).
🤖 Prompt for AI Agents
In @temoa/components/limits.py around line 257, Update the Theta docstring
labels so they match the actual constraint identifiers: replace occurrences of
"limit_growth_capacity" and "limit_degrowth_capacity" with
"limit_growth_new_capacity" and "limit_degrowth_new_capacity", and replace
"limit_growth_capacityDelta" and "limit_degrowth_capacityDelta" (camelCase) with
"limit_growth_new_capacity_delta" and "limit_degrowth_new_capacity_delta" so the
Theta_{...} labels align with the constraint names
limit_growth_new_capacity_constraint, limit_degrowth_new_capacity_constraint,
limit_growth_new_capacity_delta_constraint, and
limit_degrowth_new_capacity_delta_constraint in the module.

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/quick_start.rst:
- Around line 85-89: The file contains unresolved Git conflict markers (<<<<<<<
HEAD, =======, >>>>>>> dcb41a2) around the sentence starting "To run the model,
a configuration ..."—remove the conflict markers and keep the single-quoted form
('config') to match LaTeX-compatibility and project style; ensure the final line
reads: To run the model, a configuration ('config') file is needed. An (and
remove any leftover marker lines).
📜 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 dcb41a2 and 0d6ae91.

⛔ Files ignored due to path filters (3)
  • docs/source/images/graphviz_examples/results1990.pdf is excluded by !**/*.pdf
  • docs/source/images/results1990.pdf is excluded by !**/*.pdf
  • docs/source/images/results1990.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • docs/Makefile
  • docs/README.md
  • docs/source/Documentation.rst
  • docs/source/computational_implementation.rst
  • docs/source/mathematical_formulation.rst
  • docs/source/quick_start.rst
  • docs/source/unit_checking.rst
  • temoa/components/limits.py
  • temoa/components/operations.py
  • temoa/components/storage.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-30T14:37:44.260Z
Learnt from: idelder
Repo: TemoaProject/temoa PR: 180
File: temoa/components/limits.py:632-647
Timestamp: 2025-10-30T14:37:44.260Z
Learning: In the `limit_tech_input_split_average_constraint` function in `temoa/components/limits.py`, there was a bug where the `total_inp` summation incorrectly used the fixed variable `i` instead of the loop variable `S_i` when indexing `processOutputsByInput` and calling `get_variable_efficiency`. This pattern should be watched for in similar aggregation constraints: when summing over a loop variable like `S_i`, all references within that loop should use `S_i`, not a fixed outer variable.

Applied to files:

  • temoa/components/limits.py
  • temoa/components/operations.py
  • temoa/components/storage.py
⏰ 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). (3)
  • GitHub Check: setup and test (macos-latest, 3.13)
  • GitHub Check: setup and test (macos-latest, 3.12)
  • GitHub Check: setup and test (windows-latest, 3.12)
🔇 Additional comments (10)
temoa/components/limits.py (1)

257-257: LGTM! Underscore escaping is correct for LaTeX PDF rendering.

The underscore escaping in \text{} blocks throughout the constraint docstrings is necessary and correctly implemented for LaTeX PDF generation. The pattern \text{constraint\_name} properly escapes underscores to prevent LaTeX interpretation errors.

These documentation-only changes align with the PR objective of fixing regressions in PDF documentation building.

Also applies to: 313-313, 460-460, 465-465, 522-522, 528-528, 711-711, 746-746, 823-823, 935-935, 943-943, 1056-1056, 1064-1064, 1176-1176, 1185-1185, 1301-1301, 1305-1305, 1381-1381

docs/source/computational_implementation.rst (1)

381-392: LGTM! Status marker format update is consistent.

The status marker format change from "⚠️ untested in v4.0" to "([!] untested in v4.0)" is consistently applied across all affected module entries. This documentation formatting update likely improves LaTeX PDF rendering compatibility.

docs/source/Documentation.rst (1)

80-80: LGTM! Image path update adds format flexibility.

The figure path change from images/graphviz_examples/results1990.svg to images/results1990.* uses a wildcard pattern that allows Sphinx to automatically select the appropriate image format (SVG, PNG, etc.) based on the output target (HTML vs. PDF). This improves documentation build flexibility.

temoa/components/operations.py (1)

284-284: LGTM! Underscore escaping is correct for LaTeX rendering.

The underscore escaping in the Theta notation (\text{ramp\_up\_day} and \text{ramp\_down\_day}) is correctly implemented for LaTeX PDF generation, consistent with the escaping pattern used throughout the codebase.

Also applies to: 387-387

docs/source/mathematical_formulation.rst (1)

1067-1067: LGTM! LaTeX subscript syntax corrected.

The change from \Theta_\text{cost_invest} to \Theta_{\text{cost\_invest}} properly applies braces around the entire subscript and escapes the underscore. This ensures correct LaTeX parsing and rendering in PDF documentation.

docs/source/unit_checking.rst (1)

103-353: LGTM! Emoji replaced with LaTeX-compatible text markers.

The systematic replacement of emoji-based correctness indicators (✅/❌) with bracketed text markers ([V]/[X]) throughout the documentation improves LaTeX/PDF compatibility. Emoji characters can cause rendering issues in PDF generation toolchains, and this change ensures consistent, reliable output across all documentation formats.

temoa/components/storage.py (1)

506-512: LGTM! LaTeX formatting corrected for PDF documentation.

The docstring updates properly escape underscores in the mathematical notation (line 512: Theta_{limit\_storage\_fraction}) and improve the formatting of mathematical expressions. Unescaped underscores in LaTeX subscripts can cause compilation errors in PDF generation. These changes ensure the constraint documentation renders correctly in the generated PDF.

docs/README.md (1)

44-51: LGTM! Documentation accurately reflects the Makefile's fallback logic.

The updated wording correctly describes that LaTeX is required while latexmk is recommended, which aligns with the conditional fallback logic implemented in the Makefile (lines 109-124). Adding TeX Live as an alternative to MiKTeX provides users with more options for LaTeX installation.

The previous review concern about clarifying latexmk as recommended vs required has been addressed by this wording.

docs/Makefile (2)

8-8: LGTM! BUILDDIR updated to Sphinx convention.

Changing BUILDDIR to _build aligns with Sphinx's default directory naming convention and modern best practices.


109-124: LGTM! Well-implemented fallback for missing latexmk.

The conditional logic properly handles environments where latexmk is unavailable by:

  1. Checking for latexmk availability with command -v
  2. Falling back to manual pdflatex with appropriate options
  3. Running pdflatex twice to ensure references are resolved
  4. Providing clear user feedback about the fallback

This implementation aligns with the updated documentation in README.md that describes latexmk as recommended rather than required.

@jdecarolis jdecarolis merged commit 1eefec4 into unstable Jan 6, 2026
9 checks passed
@jdecarolis jdecarolis deleted the docs/pdf_builder branch January 6, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants