Skip to content

Extend unit test suite to >90% coverage#329

Merged
jan-janssen merged 15 commits into
mainfrom
copilot/extend-unit-test-coverage
May 4, 2026
Merged

Extend unit test suite to >90% coverage#329
jan-janssen merged 15 commits into
mainfrom
copilot/extend-unit-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

Coverage was at 82% (204 uncovered statements). This adds 55 new tests across 4 files to reach 91% (108 uncovered).

New test files

  • tests/test_compatibility_calculate.py — Direct unit tests for compatibility/calculate.py:

    • Deprecated delta_temp/delta_press parameter warnings
    • Error cases: zero/negative temperature in NVT/NPT, too many temperatures, pressure list >6 elements, all-None pressure
    • NPT with array-valued pressure (covers the per-axis pressure string-building branch)
    • tloop parameter, NVE+Langevin warning, NVT/NPT Langevin paths
    • Helpers: _set_initial_velocity (all flag combinations), _pressure_to_lammps (rotation applied/skipped, error paths), _is_isotropic_hydrostatic, _get_rotation_matrix (no-structure warning), _modify_structure_to_allow_requested_deformation (non-diagonal, already-skewed, AttributeError path)
  • tests/test_compatibility_structure.py — Tests for LammpsStructureCompatibility:

    • Init, structure getter, setter with atom_type='atomic' and 'charge'
    • structure_full with empty bond dict via a patched subclass that provides default molecule_ids (the base implementation sets it to None then subscripts it without computing it)
    • get_bonds error tolerance for incompatible structuretoolkit API

Extended test files

  • tests/test_structure.pyUnfoldingPrism with scalar pbc=True/False (covers the isinstance(pbc, bool) branch) and a skewed cell that triggers the prism folding edge-case branches

  • tests/test_output.py — Four new cases:

    • Dump with c_* computes column → populates hdf_generic (line 95)
    • Log with non-generic column (e.g. KinEng) → routes to hdf_lammps (line 114)
    • H5MD dump + non-ortho prism → RuntimeError (line 135)
    • mean_pressure[*] log + ortho prism → rotation applied to mean pressures (lines 311–312)

Copilot AI and others added 3 commits May 4, 2026 05:07
Agent-Logs-Url: https://github.com/pyiron/lammpsparser/sessions/073008b2-5731-4857-b219-c0f9984e4f9a

Co-authored-by: jan-janssen <3854739+jan-janssen@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pyiron/lammpsparser/sessions/073008b2-5731-4857-b219-c0f9984e4f9a

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

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.76%. Comparing base (64de756) to head (6d3beca).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
+ Coverage   82.36%   88.76%   +6.39%     
==========================================
  Files          11       11              
  Lines        1157     1157              
==========================================
+ Hits          953     1027      +74     
+ Misses        204      130      -74     

☔ 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 marked this pull request as ready for review May 4, 2026 05:55
@jan-janssen jan-janssen self-requested a review as a code owner May 4, 2026 05:55
@jan-janssen jan-janssen merged commit 1f8c0d5 into main May 4, 2026
21 checks passed
@jan-janssen jan-janssen deleted the copilot/extend-unit-test-coverage branch May 4, 2026 05:57
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.

3 participants