latexify_py
                                
                                 latexify_py copied to clipboard
                                
                                    latexify_py copied to clipboard
                            
                            
                            
                        Fix brackets display
Overview
Fix brackets display, replace \left( to \mathopen{}\left( and \right) to \mathclose{}\right)
Details
Modify function def _wrap_operand in the src/latexify/function_codegen.py line by 422, Change the original brackets string to fix the display.
- 
before  
- 
after  
References
#90
@jianan1104 Thanks! You also need to fix all tests that are related to this change. Running ./checks.sh could check if the test passes or not.
@jianan1104 Thanks! You also need to fix all tests that are related to this change. Running
./checks.shcould check if the test passes or not.
Thank you for reviewing. No problem. I'll fix it asap.
@odashi Hi, odashi. just fix and test the code, please check it.
It looks the CI accidentally passes though it detected some errors:
Run python -m pflake8 src
src/integration_tests/regression_test.py:91:89: E501 line too long ([11](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:12)4 > 88 characters)
src/integration_tests/regression_test.py:99:89: E501 line too long (115 > 88 characters)
src/integration_tests/regression_test.py:227:89: E501 line too long (132 > 88 characters)
src/latexify/__init__.py:7:1: E722 do not use bare 'except'
src/latexify/codegen/function_codegen_test.py:59:89: E501 line too long (107 > 88 characters)
src/latexify/codegen/function_codegen_test.py:75:89: E501 line too long (108 > 88 characters)
src/latexify/codegen/function_codegen_test.py:104:89: E501 line too long (107 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[12](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:13)0:89: E501 line too long (108 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[14](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:15)5:89: E501 line too long (103 > 88 characters)
src/latexify/codegen/function_codegen_test.py:149:89: E501 line too long (105 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[15](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:16)3:89: E501 line too long (115 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[17](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:18)7:89: E501 line too long (125 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[19](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:20)4:89: E501 line too long (91 > 88 characters)
src/latexify/codegen/function_codegen_test.py:198:89: E501 line too long (109 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[20](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:21)3:89: E501 line too long (93 > 88 characters)
src/latexify/codegen/function_codegen_test.py:[22](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:23)3:89: E501 line too long (119 > 88 characters)
src/latexify/codegen/function_codegen_test.py:2[28](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:29):89: E501 line too long (114 > 88 characters)
src/latexify/codegen/function_codegen_test.py:229:89: E501 line too long (111 > 88 characters)
It looks the CI accidentally passes though it detected some errors:
Run python -m pflake8 src src/integration_tests/regression_test.py:91:89: E501 line too long ([11](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:12)4 > 88 characters) src/integration_tests/regression_test.py:99:89: E501 line too long (115 > 88 characters) src/integration_tests/regression_test.py:227:89: E501 line too long (132 > 88 characters) src/latexify/__init__.py:7:1: E722 do not use bare 'except' src/latexify/codegen/function_codegen_test.py:59:89: E501 line too long (107 > 88 characters) src/latexify/codegen/function_codegen_test.py:75:89: E501 line too long (108 > 88 characters) src/latexify/codegen/function_codegen_test.py:104:89: E501 line too long (107 > 88 characters) src/latexify/codegen/function_codegen_test.py:[12](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:13)0:89: E501 line too long (108 > 88 characters) src/latexify/codegen/function_codegen_test.py:[14](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:15)5:89: E501 line too long (103 > 88 characters) src/latexify/codegen/function_codegen_test.py:149:89: E501 line too long (105 > 88 characters) src/latexify/codegen/function_codegen_test.py:[15](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:16)3:89: E501 line too long (115 > 88 characters) src/latexify/codegen/function_codegen_test.py:[17](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:18)7:89: E501 line too long (125 > 88 characters) src/latexify/codegen/function_codegen_test.py:[19](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:20)4:89: E501 line too long (91 > 88 characters) src/latexify/codegen/function_codegen_test.py:198:89: E501 line too long (109 > 88 characters) src/latexify/codegen/function_codegen_test.py:[20](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:21)3:89: E501 line too long (93 > 88 characters) src/latexify/codegen/function_codegen_test.py:[22](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:23)3:89: E501 line too long (119 > 88 characters) src/latexify/codegen/function_codegen_test.py:2[28](https://github.com/google/latexify_py/actions/runs/3476330689/jobs/5811657602#step:5:29):89: E501 line too long (114 > 88 characters) src/latexify/codegen/function_codegen_test.py:229:89: E501 line too long (111 > 88 characters)
I do not know if any lint tool can fix automatically? or just edit line by line?
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 main. I will fix it first ASAP.
It looks the accident around flake8 was reported recently: https://github.com/csachs/pyproject-flake8/issues/19
@jianan1104 I fixed CIs. Could you merge the main into this pull request so that the flake8 errors kill the CI appropriately?
@jianan1104 I fixed CIs. Could you merge the
maininto this pull request so that the flake8 errors kill the CI appropriately?
Sure. merged. wait for ci result...
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
main. I will fix it first ASAP.It looks the accident around flake8 was reported recently: csachs/pyproject-flake8#19
@odashi Done
Fixes #90
Really great work, thanks!
Glad to be a contributor.