-
Notifications
You must be signed in to change notification settings - Fork 393
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
Fix brackets display #112
Fix brackets display #112
Conversation
…ght) to \mathclose{}\right) Fix brackets display
@jianan1104 Thanks! You also need to fix all tests that are related to this change. Running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are other brackets in function_codegen.py
, and it would be great if we fixed all of them.
Thank you for reviewing. No problem. I'll fix it asap. |
replace all \left( to \mathopen{}\left( and \rght) to \mathclose{}\right)
…ht) to \mathclose{}\right)
…d \right) to \mathclose{}\right)
@odashi Hi, odashi. just fix and test the code, please check it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic looks fine, thanks!
It looks some lines exceed the length limit (88 characters) though I didn't realize why Black didn't warn about them. Could you fix them as well?
checks.sh
Outdated
@@ -3,4 +3,4 @@ set -eoux pipefail | |||
|
|||
python -m pytest src -vv | |||
python -m black --check src | |||
python -m pflake8 src | |||
python -m flake8 src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. sorry for this change. I have no experience with pflake8(flake8 for pyproject), so I just edit it by intuition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
import math | ||
from collections.abc import Callable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes about only the import order, which are not related to the essential point of this pull request. Could you revert these changes to prevent breaking the blame history?
(Btw, I think I need to introduce some static checker (e.g., isort) to constrain the style around imports.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
It looks the CI accidentally passes though it detected some errors:
|
I do not know if any lint tool can fix automatically? or just edit line by line? |
Length limit error is usually resolved by running Black, but I guess long string literals couldn't be handled correctly. So (unfortunately) some errors need to be fixed manually. Btw, I also noticed that the list above contains some existing errors in It looks the accident around flake8 was reported recently: |
@jianan1104 I fixed CIs. Could you merge the |
Sure. merged. wait for ci result... |
@odashi Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work, thanks!
Fixes #90 |
Glad to be a contributor. |
Overview
Fix brackets display, replace
\left(
to\mathopen{}\left(
and\right)
to\mathclose{}\right)
Details
Modify function
def _wrap_operand
in thesrc/latexify/function_codegen.py
line by422
, Change the original brackets string to fix the display.before

after

References
#90