Skip to content

Add checks module and cleanup code, prep for labels module#25

Merged
c-randall merged 2 commits intomainfrom
feature/checks
Apr 3, 2026
Merged

Add checks module and cleanup code, prep for labels module#25
c-randall merged 2 commits intomainfrom
feature/checks

Conversation

@c-randall
Copy link
Copy Markdown
Collaborator

Description

There are many places in the code where it makes sense to check types of verify required columns are provided for particular routines. Instead of having duplicate code everywhere to raise these errors, there is now a new _checks module. This is not intended to be exposed to the user and thus is not imported into the main __init__. Rather, the checks are imported in functions locally where they are needed. Presently, there are checks to do the following:

  1. Check types
  2. Check inner types of sequences
  3. Check a Dataset for required columns
  4. Check that exactly one of a set of conditions is True to avoid conflicting settings/options
  5. Check that a literal option exists within a valid set of options

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that improves speed/readability/etc.)
  • Bug fix (non-breaking change which fixes an issue)
  • Chore (any other clean up, maintenance, etc.)

Key checklist:

  • No style issues: $ nox -s linter [-- format]
  • Code is free of misspellings: $ nox -s codespell [-- write]
  • All tests pass: $ nox -s tests

Further checks:

  • The documentation builds: $ nox -s docs.
  • Code is commented, particularly in hard-to-understand areas.
  • Tests are added that prove fix is effective or that feature works.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 67.64706% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.75%. Comparing base (24873bd) to head (295e653).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/ampworks/_core/_read.py 0.00% 7 Missing ⚠️
src/ampworks/dqdv/_dqdv_spline.py 0.00% 5 Missing ⚠️
src/ampworks/dqdv/__init__.py 0.00% 4 Missing ⚠️
src/ampworks/_core/_dataset.py 0.00% 2 Missing ⚠️
src/ampworks/dqdv/_tables.py 0.00% 2 Missing ⚠️
src/ampworks/hppc/_extract_impedance.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
+ Coverage   50.02%   50.75%   +0.72%     
==========================================
  Files          39       40       +1     
  Lines        1777     1795      +18     
==========================================
+ Hits          889      911      +22     
+ Misses        888      884       -4     
Flag Coverage Δ
unittests 50.75% <67.64%> (+0.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@c-randall c-randall marked this pull request as ready for review April 3, 2026 20:53
@c-randall c-randall merged commit 2b49848 into main Apr 3, 2026
13 checks passed
@c-randall c-randall deleted the feature/checks branch April 3, 2026 20:53
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