Skip to content

minor maintainance improvements and fixes#296

Merged
ParticularlyPythonicBS merged 3 commits intounstablefrom
maintainance/minor_fixes
Apr 9, 2026
Merged

minor maintainance improvements and fixes#296
ParticularlyPythonicBS merged 3 commits intounstablefrom
maintainance/minor_fixes

Conversation

@ParticularlyPythonicBS
Copy link
Copy Markdown
Member

@ParticularlyPythonicBS ParticularlyPythonicBS commented Apr 9, 2026

addresses several usability issues related to the Temoa tutorial, extension examples, and overall project maintainability.

Summary by CodeRabbit

  • Documentation

    • Updated quick start guide with clarified setup instructions for running Temoa.
    • Revised method of Morris extension documentation with updated step-by-step instructions.
  • Bug Fixes

    • Enhanced scenario analyzer with input validation and improved error messages.
    • Improved tutorial command file handling.
  • Chores

    • Updated pytest configuration for warning filter management.

@ParticularlyPythonicBS ParticularlyPythonicBS added Maintenance Code quality fixes and deprecation management bugfix labels Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@ParticularlyPythonicBS has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 3 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 3 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 64e09c7d-0591-43e1-9415-67d2da7fdcfb

📥 Commits

Reviewing files that changed from the base of the PR and between 7509d40 and 7b74cce.

📒 Files selected for processing (6)
  • docs/source/quick_start.rst
  • pyproject.toml
  • temoa/cli.py
  • temoa/extensions/method_of_morris/MM_README.md
  • temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py
  • temoa/tutorial_assets/config_sample.toml

Walkthrough

The PR updates documentation and code to clarify the tutorial workflow and improve validation. It modifies instructions for running tutorials and the method of morris extension, treats mc_settings.csv as a managed output file, suppresses specific third-party warnings, and reorganizes configuration sections for clarity.

Changes

Cohort / File(s) Summary
Documentation & Quick Start
docs/source/quick_start.rst, temoa/extensions/method_of_morris/MM_README.md
Clarified that config_sample.toml requires running the tutorial command to generate the database and copy mc_settings.csv; updated method of morris example instructions to specify running commands from the extension directory.
Tutorial Output Management
temoa/cli.py
Added mc_settings.csv as a tracked output file in the tutorial command, now subject to overwrite confirmation workflow.
Configuration & Build Tools
pyproject.toml, temoa/tutorial_assets/config_sample.toml
Added pytest warning filter to suppress SyntaxWarning for mpi-sppy packages; reorganized [sqlite] configuration section in sample config (moved section without changing values).
Validation & Error Handling
temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py
Added pre-plot validation to check if scenario query results exist; raises RuntimeError with instructions if no results found, and updated error messages for clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

docs

Suggested reviewers

  • jdecarolis
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The pull request title describes the changes at a high level but lacks specificity about the main problems being addressed, making it generic and difficult to understand the primary focus. Consider using a more specific title that highlights the main issue or goal, such as 'Fix tutorial guidance, clarify extension file locations, and reorganize config structure' or focus on the most significant change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maintainance/minor_fixes

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
Copy Markdown

@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: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pyproject.toml`:
- Around line 137-140: The current warning filter entry in pyproject.toml
broadly suppresses SyntaxWarning for all mpisppy modules; change that filter to
target only the offending module by replacing the "mpisppy.*" scope with
"mpisppy.utils.sputils" (keeping the rest of the filter string/format intact) so
only SyntaxWarning from mpisppy.utils.sputils is ignored as noted in the
comment.

In `@temoa/cli.py`:
- Around line 691-697: The overwrite-check for mc_settings.csv uses
target_mc_settings = current_dir / 'mc_settings.csv' which doesn't match where
mc_settings.csv is actually created (under target_config.parent based on
config_name); update the check to build target_mc_settings from
target_config.parent (e.g., target_mc_settings = target_config.parent /
'mc_settings.csv') and then use that variable in the existing_files append logic
so overwrite detection aligns with the actual destination used by the code paths
that create mc_settings.csv.

In `@temoa/extensions/method_of_morris/MM_README.md`:
- Around line 37-47: Replace reStructuredText :code:`...` roles in the
MM_README.md with Markdown inline code backticks so they render on GitHub;
specifically update occurrences referencing morris.py, morris_utopia.sql,
morris_utopia.sqlite, morris_utopia.toml and the column names MMAnalysis,
cost_variable, and efficiency to use `morris.py`, `morris_utopia.sql`,
`morris_utopia.sqlite`, `morris_utopia.toml`, `MMAnalysis`, `cost_variable`, and
`efficiency` respectively throughout the document.

In `@temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py`:
- Around line 27-29: The SQL builds a LIKE clause by interpolating scenario_name
into cur.execute (obj_values = cur.execute(...).fetchall()), which is unsafe;
change the call to use a parameterized query and pass the wildcarded pattern as
a parameter (e.g., "SELECT total_system_cost FROM output_objective WHERE
scenario LIKE ?" with parameter f"{scenario_name}-%" or the DB's param style),
so the query is bound instead of using f-string interpolation.
- Around line 34-35: The RuntimeError message that currently reads "Please run
'temoa tutorial model'..." is giving an invalid recovery command; update the
exception text where it's raised (the message referencing output_objective in
scenario_analyzer.py) to instruct running the tutorial model correctly, e.g.,
replace the incorrect string with "Please run 'temoa run tutorial_config.toml'
or run the tutorial model to populate output_objective with results first."
Ensure you update the exact string used in the RuntimeError to reflect the
correct command.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7206fb8-9973-4f6d-9da0-aefa58d79305

📥 Commits

Reviewing files that changed from the base of the PR and between fab1c72 and 7509d40.

📒 Files selected for processing (6)
  • docs/source/quick_start.rst
  • pyproject.toml
  • temoa/cli.py
  • temoa/extensions/method_of_morris/MM_README.md
  • temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py
  • temoa/tutorial_assets/config_sample.toml

Comment thread pyproject.toml Outdated
Comment thread temoa/cli.py Outdated
Comment thread temoa/extensions/method_of_morris/MM_README.md Outdated
Comment thread temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py
Comment thread temoa/extensions/monte_carlo/example_builds/scenario_analyzer.py Outdated
- Update quick start docs to reference 'temoa tutorial' for a complete setup
- Add mc_settings.csv to tutorial overwrite detection with correct path resolution
- Standardize inline code syntax in Morris extension README for GitHub rendering
- Implement parameterized SQL and corrected recovery instructions in Monte Carlo analyzer
Mitigate SyntaxWarning messages triggered by invalid escape sequences
in the mpi-sppy dependency. Narrowed the filter scope to target
only the offending module (mpisppy.utils.sputils) based on CI logs.
Move the [sqlite] table definition to the end of config_sample.toml.
This prevents subsequent root-level keys (like solver_name) from being
incorrectly parsed as child keys of the sqlite table.
@ParticularlyPythonicBS ParticularlyPythonicBS merged commit b12237e into unstable Apr 9, 2026
12 checks passed
@ParticularlyPythonicBS ParticularlyPythonicBS deleted the maintainance/minor_fixes branch April 9, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix docs Maintenance Code quality fixes and deprecation management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant