Skip to content

Add BmiStub for partial BMI implementations - #84

Merged
mcflugen merged 1 commit into
csdms:masterfrom
mcflugen:add-bmistub
Oct 19, 2026
Merged

mcflugen merged 1 commit into
csdms:masterfrom
mcflugen:add-bmistub

Conversation

@mcflugen

Copy link
Copy Markdown
Member

I've added BmiStub that implements all of the Bmi methods by raising NotImplementedError for each of them. Users can subclass it to build partial BMI implementations without having to override every abstract method.

@mcflugen
mcflugen requested a balanced review from Copilot October 18, 2026 22:38
@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.31%. Comparing base (3605f3b) to head (802e7d9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #84      +/-   ##
==========================================
+ Coverage   96.25%   97.31%   +1.05%     
==========================================
  Files           8       10       +2     
  Lines         267      372     +105     
  Branches       11       11              
==========================================
+ Hits          257      362     +105     
  Misses          8        8              
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes implement the intended interface with focused tests and no identified blocking issues.

No open issues 🎉

What changed in this PR

Adds BmiStub so users can implement part of the BMI interface without overriding every abstract method.

Changes:

  • Adds and publicly exports a concrete stub whose methods raise NotImplementedError.
  • Tests instantiation, exception behavior, and signature compatibility.
  • Updates docstring checks to accommodate stub methods.
File Description
tests/​stub_test.py Tests completeness, exceptions, and matching signatures.
src/​bmipy/​_stub.py Implements the concrete BMI stub.
src/​bmipy/​__init__.py Exports BmiStub publicly.
.pre-commit-config.yaml Updates source paths and adds stub-specific docstring checks.

Review effort: Balanced

@mcflugen
mcflugen force-pushed the add-bmistub branch 2 times, most recently from 382b967 to 00eabe5 Compare October 19, 2026 01:11

@mdpiper mdpiper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be really handy!

@mcflugen

Copy link
Copy Markdown
Member Author

This will be really handy!

I think so too. Thanks for having a look at this.

@mcflugen
mcflugen merged commit c9ffb42 into csdms:master Oct 19, 2026
21 checks passed
@mcflugen
mcflugen deleted the add-bmistub branch October 19, 2026 21:01
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.

4 participants