Skip to content

feature/SOF 7894 3 - #313

Merged
VsevolodX merged 2 commits into
mainfrom
feature/SOF-7894-3
May 16, 2026
Merged

feature/SOF 7894 3#313
VsevolodX merged 2 commits into
mainfrom
feature/SOF-7894-3

Conversation

@VsevolodX

@VsevolodX VsevolodX commented May 16, 2026

Copy link
Copy Markdown
Member
  • update: restructure job api
  • update: import of job api

Summary by CodeRabbit

  • Chores
    • Reorganized job utility imports. Job-related functions including wait_for_jobs_to_finish_async, create_job, and submit_jobs are now accessed from mat3ra.notebooks_utils.api.job. If you directly import these utilities, update your import statements to reference the new module path.

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

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR moves the wait_for_jobs_to_finish_async polling helper from the generic job module into the API-specific api/job module with a new implementation using decorators. The source module is cleaned up by removing the moved function and related imports, and two example notebooks are updated to import from the new location.

Changes

Job wait helper reorganization

Layer / File(s) Summary
New job-wait implementation and API module setup
src/py/mat3ra/notebooks_utils/api/job.py
Adds imports from ..core.entity.job.api and interruptible_polling_loop, implements wait_for_jobs_to_finish_async to poll job statuses and format a summary row with aggregated counts, and updates __all__ to export the job API functions and the new implementation while removing get_convergence_series.
Source module cleanup
src/py/mat3ra/notebooks_utils/job.py
Removes the polling implementation, __all__ export list, and unused imports (datetime, Counter, pretty_print, JobEndpoints, interruptible_polling_loop); makes Material and Workflow unconditional imports; retains create_job and get_convergence_series.
Example notebook import updates
examples/job/get-file-from-job.ipynb, examples/job/ml-train-model-predict-properties.ipynb
Both notebooks update the import source for wait_for_jobs_to_finish_async from mat3ra.notebooks_utils.job to mat3ra.notebooks_utils.api.job.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Exabyte-io/api-examples#272: Implements the same async job-wait helper around interruptible_polling_loop with status aggregation and changed return semantics.
  • Exabyte-io/api-examples#305: Updates a QE SCF notebook's wait_for_jobs_to_finish_async usage to match the new polling helper behavior and signature.
  • Exabyte-io/api-examples#302: Modifies examples/job/get-file-from-job.ipynb around the same wait_for_jobs_to_finish_async import.

Suggested reviewers

  • timurbazhirov

Poem

🐰 A helper hops from home to API,
Where job-status waits in harmony,
Decorators dance, summaries align,
Old imports fade, new paths shine!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feature/SOF 7894 3' is vague and does not clearly describe the main changes, which involve restructuring the job API and moving the wait_for_jobs_to_finish_async function to a new module location. Consider a more descriptive title such as 'Restructure job API and move wait_for_jobs_to_finish_async to api.job module' that clearly conveys the primary intent of the changes.
✅ Passed checks (4 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%.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/SOF-7894-3

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.

@VsevolodX
VsevolodX merged commit 8376380 into main May 16, 2026
7 of 8 checks passed
@VsevolodX
VsevolodX deleted the feature/SOF-7894-3 branch May 16, 2026 07:15
@coderabbitai coderabbitai Bot mentioned this pull request Jun 5, 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