Skip to content

Add CalcMinimizeInput dataclass example to notebook#347

Merged
jan-janssen merged 2 commits into
mainfrom
dataclass_example
May 29, 2026
Merged

Add CalcMinimizeInput dataclass example to notebook#347
jan-janssen merged 2 commits into
mainfrom
dataclass_example

Conversation

@jan-janssen
Copy link
Copy Markdown
Member

@jan-janssen jan-janssen commented May 29, 2026

Summary

  • Extends notebooks/example.ipynb with a CalcMinimizeInput dataclass example
  • The existing notebook already demonstrated CalcMDInput; this PR adds the corresponding CalcMinimizeInput usage for geometry optimisation via lammps_file_interface_function(calc_dataclass=...)

Test plan

  • Open the notebook and run the new CalcMinimizeInput cell to confirm it executes without errors and prints a final energy

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a new geometry optimization example section to the sample notebook. The tutorial demonstrates how to set up and execute optimization tasks using structured configuration methods, and shows how to extract and interpret computed results from the output. Users can now reference this example when implementing similar analyses.

Review Change Stack

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@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 29, 2026

Warning

Review limit reached

@jan-janssen, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 8 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef533b06-bd00-4a96-8d1d-a022b9fdbe96

📥 Commits

Reviewing files that changed from the base of the PR and between 0540b83 and 6259a11.

📒 Files selected for processing (1)
  • notebooks/example.ipynb
📝 Walkthrough

Walkthrough

The PR adds a new example section to the Jupyter notebook demonstrating typed dataclass usage for geometry optimization. It includes markdown introducing CalcMinimizeInput and code showing construction of the dataclass, calling the interface function with the calc_dataclass parameter, and printing the final potential energy from the output.

Changes

Typed Dataclass Geometry Optimization Example

Layer / File(s) Summary
CalcMinimizeInput example and usage demonstration
notebooks/example.ipynb
Adds markdown introducing CalcMinimizeInput and code cell demonstrating dataclass construction, passing it to lammps_file_interface_function via calc_dataclass=, and extracting energy_pot from parsed results.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • pyiron/lammpsparser#330: Introduces the CalcMinimizeInput dataclass and calc_dataclass parameter support that this notebook example demonstrates.

Poem

🐰 A rabbit hops through notebooks bright,
With dataclass examples, clean and tight,
Minimizing geometries with typed grace,
Energy results in their proper place!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: adding a CalcMinimizeInput dataclass example to the notebook.
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 dataclass_example

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.61%. Comparing base (33a2098) to head (6259a11).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #347   +/-   ##
=======================================
  Coverage   89.61%   89.61%           
=======================================
  Files          13       13           
  Lines        1204     1204           
=======================================
  Hits         1079     1079           
  Misses        125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 `@notebooks/example.ipynb`:
- Around line 503-507: The new notebook cell for the CalcMinimizeInput example
is unexecuted (execution_count: null) and has empty outputs; run the cell that
creates/uses CalcMinimizeInput in the notebook, capture and save the cell's
outputs (including the final energy value), ensure the cell's execution_count is
set and the outputs field contains the execution result, then save and commit
the updated notebook so the example output is persisted and verifiable.
🪄 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: 228fcdcd-de3a-4e06-83ae-82e359160774

📥 Commits

Reviewing files that changed from the base of the PR and between 33a2098 and 0540b83.

📒 Files selected for processing (1)
  • notebooks/example.ipynb

Comment thread notebooks/example.ipynb Outdated
Comment on lines +503 to +507
"execution_count": null,
"id": "c5000002-0000-0000-0000-000000000002",
"metadata": {},
"outputs": [],
"source": [
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 | 🟡 Minor | ⚡ Quick win

Run and persist the new CalcMinimizeInput example cell output.

Line 503 is unexecuted (execution_count: null) and Line 506 has empty outputs, while this notebook otherwise stores executed examples. Please run this new cell and commit the output (final energy) to match the PR test plan and keep the notebook verifiable.

🤖 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 `@notebooks/example.ipynb` around lines 503 - 507, The new notebook cell for
the CalcMinimizeInput example is unexecuted (execution_count: null) and has
empty outputs; run the cell that creates/uses CalcMinimizeInput in the notebook,
capture and save the cell's outputs (including the final energy value), ensure
the cell's execution_count is set and the outputs field contains the execution
result, then save and commit the updated notebook so the example output is
persisted and verifiable.

@jan-janssen jan-janssen merged commit 84fdd66 into main May 29, 2026
22 of 23 checks passed
@jan-janssen jan-janssen deleted the dataclass_example branch May 29, 2026 18:15
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.

1 participant