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

Fixed mypy sp check guidelines #4887

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

Conversation

Rishab87
Copy link
Contributor

@Rishab87 Rishab87 commented Mar 2, 2025

Description

Fixing mypy sp check guidelines

Related to #3489

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

@Rishab87
Copy link
Contributor Author

Rishab87 commented Mar 2, 2025

Still 25 mypy errors are left, drafting this so that its easier to communicate changes

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, I've triggered the workflows! I haven't reviewed all the files, because I understand that the PR is still a draft and you have yet to complete the changes.

Checking https://learn.scientific-python.org/development/guides/repo-review/?repo=pybamm-team/pybamm, a few more rules where we have problems have popped up. So we shouldn't mark this PR as one that closes the linked issue. Could you please replace the "Fixes" keyword in the PR description with "Related to"?

It is also possible to add sp-repo-review as a pre-commit hook so that new rules will be checked on every commit. I think we should investigate that and add it if running the checks is not too slow. I'm also curious to hear what @Saransh-cpp has to say about this.

docs/conf.py Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I think we can exclude this file from the Mypy checks. It is not a part of PyBaMM's runtime, and maintaining typing rules here seems tedious.

Copy link

codecov bot commented Mar 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.69%. Comparing base (c9b5930) to head (ba437d6).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4887      +/-   ##
===========================================
- Coverage    98.71%   98.69%   -0.02%     
===========================================
  Files          304      304              
  Lines        23495    23498       +3     
===========================================
- Hits         23192    23191       -1     
- Misses         303      307       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Saransh-cpp
Copy link
Member

It would be great to have repo-review as a pre-commit hook! @agriyakhetarpal maybe you can create a new independent issue for that?

@Rishab87
Copy link
Contributor Author

Rishab87 commented Mar 3, 2025

I've changed the PR description to related to and I also think it would be great to have a pre-commit hook for sp-check-guidelines, I'll investigate its speed after this PR is done

@Rishab87 Rishab87 marked this pull request as ready for review March 3, 2025 08:37
@Rishab87 Rishab87 requested a review from a team as a code owner March 3, 2025 08:37
@Rishab87
Copy link
Contributor Author

Rishab87 commented Mar 3, 2025

I've fixed the remaining errors too

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.

3 participants