Skip to content

Reduce duplicate code into hidden _auxiliary module#30

Merged
c-randall merged 2 commits into
mainfrom
feature/auxiliary
May 14, 2026
Merged

Reduce duplicate code into hidden _auxiliary module#30
c-randall merged 2 commits into
mainfrom
feature/auxiliary

Conversation

@c-randall

Copy link
Copy Markdown
Collaborator

Description

Some functions had repeated logic across modules (e.g., inferring states, computing SOC, detecting pulses, etc.). A new auxiliary module was added for developers to put these helper functions into one place instead of scattering and repeating them all over. Depending on how useful some of these functions are, they may also be considered to be user-facing at a later point.

This is a smaller PR to initialize this new module. An additional PR will include functions to infer steps, cycles, add a cumulative steps column, and to detect pulses (mentioned above, but not included here).

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.

…e user-facing later, depending on usefulness
@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.26%. Comparing base (da4e7c5) to head (df74e92).

Files with missing lines Patch % Lines
src/ampworks/hppc/_extract_impedance.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   60.16%   60.26%   +0.10%     
==========================================
  Files          42       43       +1     
  Lines        1998     2001       +3     
==========================================
+ Hits         1202     1206       +4     
+ Misses        796      795       -1     
Flag Coverage Δ
unittests 60.26% <92.85%> (+0.10%) ⬆️

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 May 14, 2026 17:13
@c-randall
c-randall merged commit beadf35 into main May 14, 2026
23 checks passed
@c-randall
c-randall deleted the feature/auxiliary branch May 14, 2026 17:14
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