Skip to content
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

Replace np.ndarray with npt.NDArray for improved type hinting #4899

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

tanishac25
Copy link
Contributor

@tanishac25 tanishac25 commented Mar 7, 2025

Description

This PR updates the type hints by replacing np.ndarray with npt.NDArray from numpy.typing. It was necessary because using npt.NDArray is the recommended way to define NumPy arrays in type hints.

Fixes #4512

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

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

@tanishac25 tanishac25 requested a review from a team as a code owner March 7, 2025 20:53
Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks, @tanishac25!

@agriyakhetarpal agriyakhetarpal enabled auto-merge (squash) March 7, 2025 21:33
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.71%. Comparing base (298e306) to head (9b4dcfb).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4899   +/-   ##
========================================
  Coverage    98.71%   98.71%           
========================================
  Files          304      304           
  Lines        23495    23509   +14     
========================================
+ Hits         23193    23207   +14     
  Misses         302      302           

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

@agriyakhetarpal agriyakhetarpal merged commit ee68f87 into pybamm-team:develop Mar 7, 2025
45 of 46 checks passed
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.

Use numpy.typing.NDArray instead of np.ndarray
2 participants