Skip to content

feature/SOF 7894 tests#303

Merged
VsevolodX merged 3 commits into
mainfrom
feature/SOF-7894-tests
May 12, 2026
Merged

feature/SOF 7894 tests#303
VsevolodX merged 3 commits into
mainfrom
feature/SOF-7894-tests

Conversation

@VsevolodX
Copy link
Copy Markdown
Member

@VsevolodX VsevolodX commented May 12, 2026

  • chore: old deps
  • update: fix condition
  • chore: possible fixes

Summary by CodeRabbit

Bug Fixes

  • Fixed invalid JSON formatting in experiment data file by removing trailing comma.

Updates

  • Updated SCF job monitoring example to use default timeout behavior.
  • Improved output file detection in workflow example using substring matching.

Review Change Stack

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Warning

Rate limit exceeded

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

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 98889d6e-a973-4a63-87e0-75ca66ef55aa

📥 Commits

Reviewing files that changed from the base of the PR and between 1b19d02 and b7342a9.

📒 Files selected for processing (1)
  • utils/jupyterlite.py
📝 Walkthrough

Walkthrough

This PR contains two independent, minimal changes: the SCF calculation notebook is updated to use default timeout behavior and substring matching for output files, while a JSON data file is corrected by removing an invalid trailing comma.

Changes

Example Updates and Data Fixes

Layer / File(s) Summary
SCF job monitoring adjustments
examples/workflow/qe_scf_calculation.ipynb
The wait_for_jobs_to_finish_async call removes its explicit timeout parameter to rely on the helper's default, and output file detection switches from exact filename equality ("pw.out") to substring matching ("pw.out" in file["name"]).
JSON syntax cleanup
other/experiments/jupyterlite/uploads/C(001)-Ni(111)-Interface.json
Trailing comma after the unitCellFormula property is removed, fixing JSON syntax before the closing brace.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Exabyte-io/api-examples#301: Both PRs modify the same notebook's SCF job-wait logic—switching to or updating usage of wait_for_jobs_to_finish_async—so they are related.
  • Exabyte-io/api-examples#298: Both PRs modify the job-wait call in examples/workflow/qe_scf_calculation.ipynb—switching to wait_for_jobs_to_finish_async (and here removing the explicit timeout)—so they are related.
  • Exabyte-io/api-examples#285: Main PR's notebook change (removing the explicit timeout and relying on the helper's default) directly relates to the retrieved PR's modification of wait_for_jobs_to_finish_async behavior, so they are related.

Suggested reviewers

  • timurbazhirov

Poem

A timeout removed, now default takes the lead,
Substring matching grants the files their need,
A trailing comma fixed, JSON breathes deep,
Small tweaks that keep the workflows neat! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feature/SOF 7894 tests' is vague and non-descriptive. It references a ticket number and generic term 'tests' without conveying what was actually changed or fixed in the changeset. Replace with a more descriptive title that clarifies the actual changes, such as 'Fix SCF job monitoring and JSON serialization in examples' or 'Update notebook timeout handling and fix JSON formatting'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 feature/SOF-7894-tests

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/workflow/qe_scf_calculation.ipynb`:
- Around line 359-363: The current loop that finds the pw.out uses substring
matching on file["name"] and can pick the wrong file; replace that with a
deterministic check (e.g. match the basename or use
file["name"].endswith("pw.out")) when iterating the list returned by
job_endpoints.list_files(JOB_RESP["_id"]) to assign output_file_metadata, and
after the loop fail fast (raise/return an error) if no exact pw.out was found so
downstream parsing doesn't run on the wrong file.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: da36e9d1-b11e-4b2e-9586-6afeaa377729

📥 Commits

Reviewing files that changed from the base of the PR and between cc16a58 and 1b19d02.

📒 Files selected for processing (2)
  • examples/workflow/qe_scf_calculation.ipynb
  • other/experiments/jupyterlite/uploads/C(001)-Ni(111)-Interface.json

Comment on lines 359 to 363
"files = job_endpoints.list_files(JOB_RESP[\"_id\"])\n",
"for file in files:\n",
" if file[\"name\"] == \"pw.out\":\n",
" if \"pw.out\" in file[\"name\"]:\n",
" output_file_metadata = file\n",
"\n",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use deterministic pw.out matching to avoid parsing the wrong file.

On Line 361, substring matching can pick unintended files and silently parse incorrect data. Select by basename/ending and fail fast if not found.

Proposed fix
 files = job_endpoints.list_files(JOB_RESP["_id"])
-for file in files:
-    if "pw.out" in file["name"]:
-        output_file_metadata = file
+output_file_metadata = next(
+    (file for file in files if file["name"] == "pw.out" or file["name"].endswith("/pw.out")),
+    None,
+)
+if output_file_metadata is None:
+    raise FileNotFoundError("Could not find 'pw.out' in job output files")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/workflow/qe_scf_calculation.ipynb` around lines 359 - 363, The
current loop that finds the pw.out uses substring matching on file["name"] and
can pick the wrong file; replace that with a deterministic check (e.g. match the
basename or use file["name"].endswith("pw.out")) when iterating the list
returned by job_endpoints.list_files(JOB_RESP["_id"]) to assign
output_file_metadata, and after the loop fail fast (raise/return an error) if no
exact pw.out was found so downstream parsing doesn't run on the wrong file.

@VsevolodX VsevolodX force-pushed the feature/SOF-7894-tests branch from af7e570 to b7342a9 Compare May 12, 2026 07:12
@VsevolodX VsevolodX merged commit 9448384 into main May 12, 2026
5 checks passed
@VsevolodX VsevolodX deleted the feature/SOF-7894-tests branch May 12, 2026 07:13
This was referenced May 12, 2026
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.

2 participants