Skip to content

Added type hints to constant_concentration.py #4956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

JC230903
Copy link
Contributor

@JC230903 JC230903 commented Apr 6, 2025

Description

This is a trial PR to test adding type hints. I’ve verified that it doesn’t change any mypy behavior at this stage, but it’s intended to gather feedback on approach and clarity. Happy to change this to a draft if needed.
Fixes #4954

Type of change

This PR focuses on:

Adding type hints to helper functions that return basic types.

Adding hints to class methods with simple input/output signatures.

Ensuring compatibility with existing code and mypy.

Motivation

I’d like to familiarize myself with PyBaMM’s contribution process and get early feedback on:

Type hinting conventions

Review expectations

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@JC230903 JC230903 requested a review from a team as a code owner April 6, 2025 05:43
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.70%. Comparing base (5b8cda0) to head (4c1e383).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...ls/electrolyte_diffusion/constant_concentration.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4956      +/-   ##
===========================================
- Coverage    98.70%   98.70%   -0.01%     
===========================================
  Files          304      304              
  Lines        23701    23704       +3     
===========================================
+ Hits         23394    23396       +2     
- Misses         307      308       +1     

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

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.

[Typing] Trial PR: Adding Type Hints to Simple Functions in pybamm.models
2 participants