#2763 start improving latexify#2764
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
This code snippet would allow us to update print names semi-automatically, not sure if it's a good idea though since it uses import pybamm
var2 = pybamm.Variable("var")
test = pybamm.Variable("c_e")
loc = {k: v for k, v in locals().items() if isinstance(v, pybamm.Symbol)}
for key, value in loc.items():
value.print_name = key
print(var2.print_name) # prints var2
print(test.print_name) # prints testCombined with this it might be fully automatable |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2764 +/- ##
===========================================
- Coverage 99.68% 99.68% -0.01%
===========================================
Files 272 272
Lines 19031 19027 -4
===========================================
- Hits 18972 18968 -4
Misses 59 59
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
actualpriyanshu
left a comment
There was a problem hiding this comment.
A lot of code changed. Looks good to me!
|
I was struggling to understand the regex code so just rewrote it |
Description
Start improving latexify. Goal is for the output of SPM, SPMe, and DFN to be clean.
Fixes #2763
Fixes #2762
Type of change
Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
Key checklist:
$ pre-commit run(see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all$ python run-tests.py --doctestYou can run unit and doctests together at once, using
$ python run-tests.py --quick.Further checks: