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

Cleanup formatting in error messages #4565

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

kratman
Copy link
Contributor

@kratman kratman commented Nov 5, 2024

Description

I noticed some of the longer f-strings printed out with large indents. This PR is to clean that up a bit. There are still some triple quoted strings that could be cleaned up, but these are the easy ones to catch.

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@kratman kratman self-assigned this Nov 5, 2024
@agriyakhetarpal
Copy link
Member

Out of lazy curiosity, is there a pre-commit hook that can clean things like these?

Copy link
Contributor Author

@kratman kratman left a comment

Choose a reason for hiding this comment

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

Fixing two mistakes

src/pybamm/discretisations/discretisation.py Outdated Show resolved Hide resolved
src/pybamm/expression_tree/operations/convert_to_casadi.py Outdated Show resolved Hide resolved
@kratman
Copy link
Contributor Author

kratman commented Nov 5, 2024

Out of lazy curiosity, is there a pre-commit hook that can clean things like these?

Probably, these just annoyed me when I was debugging something and it only took me a couple minutes to do it. I know there are a few "some text {} {}".replace() and "some text {} {}".format() cases that are trickier to fix.

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.29%. Comparing base (19a7738) to head (697b056).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4565      +/-   ##
===========================================
- Coverage    99.42%   99.29%   -0.14%     
===========================================
  Files          300      300              
  Lines        22774    22776       +2     
===========================================
- Hits         22643    22615      -28     
- Misses         131      161      +30     

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

@kratman kratman enabled auto-merge (squash) November 5, 2024 00:54
@kratman kratman merged commit b0382e6 into pybamm-team:develop Nov 5, 2024
24 of 25 checks passed
@kratman kratman deleted the feat/cleanupFormat branch November 7, 2024 16:36
pkalbhor pushed a commit to pkalbhor/PyBaMM that referenced this pull request Nov 15, 2024
* Remove some unneeded links

* Cleaning up some formatting

* Update src/pybamm/discretisations/discretisation.py

* Update src/pybamm/expression_tree/operations/convert_to_casadi.py
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.

2 participants