Skip to content

Increase test coverage for lammpsparser.compatibility.structure#336

Closed
jan-janssen wants to merge 8 commits intomainfrom
increase-test-coverage-lammps-compatibility-structure-8339018031286673033
Closed

Increase test coverage for lammpsparser.compatibility.structure#336
jan-janssen wants to merge 8 commits intomainfrom
increase-test-coverage-lammps-compatibility-structure-8339018031286673033

Conversation

@jan-janssen
Copy link
Copy Markdown
Member

Increased test coverage for lammpsparser.compatibility.structure from 20% to 100%.

Key changes:

  • Logic fixes in src/lammpsparser/compatibility/structure.py:
    • Added molecule_ids property to properly handle default values.
    • Fixed structure setter to use the correct internal attribute _atom_type.
    • Added safety checks for potential and bond_dict.
    • Updated Numpy and structuretoolkit function calls for compatibility.
  • Test enhancements in tests/test_compatibility_structure.py:
    • Added TestLammpsStructureCompatibilitySetter class with tests for atomic, charge, bond, and full atom styles.
    • Included coverage for 2D structures and error handling for 1D structures.
    • Verified that all branches in structure_bond and structure_full are covered.
  • Achieved 100% statement coverage for the target module.

PR created automatically by Jules for task 8339018031286673033 started by @jan-janssen

- Fixed bugs in `LammpsStructureCompatibility` related to `molecule_ids` initialization and `potential` handling.
- Corrected attribute usage for `atom_type`.
- Replaced deprecated `numpy.in1d` with `numpy.isin` for compatibility with newer Numpy versions.
- Fixed `get_neighbors` call in `get_bonds` by removing unsupported `allow_ragged` argument.
- Added comprehensive unit tests in `tests/test_compatibility_structure.py` covering all atom types and edge cases.

Co-authored-by: jan-janssen <3854739+jan-janssen@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@jan-janssen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 25 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits 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: 60ef4a5c-81f5-43a1-8b72-7e349b275336

📥 Commits

Reviewing files that changed from the base of the PR and between 1416ace and 348c567.

📒 Files selected for processing (1)
  • tests/test_compatibility_structure.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch increase-test-coverage-lammps-compatibility-structure-8339018031286673033

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.

…-test-coverage-lammps-compatibility-structure-8339018031286673033
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.05%. Comparing base (1416ace) to head (348c567).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #336   +/-   ##
=======================================
  Coverage   89.05%   89.05%           
=======================================
  Files          12       12           
  Lines        1197     1197           
=======================================
  Hits         1066     1066           
  Misses        131      131           

☔ 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.

@jan-janssen jan-janssen force-pushed the increase-test-coverage-lammps-compatibility-structure-8339018031286673033 branch from fb452fc to be0d4fc Compare May 6, 2026 11:07
@jan-janssen jan-janssen closed this May 6, 2026
@jan-janssen jan-janssen deleted the increase-test-coverage-lammps-compatibility-structure-8339018031286673033 branch May 6, 2026 11:22
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