Skip to content

TST: fixed eng_formatter doctest for #42671 #42705

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

Merged
merged 26 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7bef135
doctest fix for #42671
Jul 25, 2021
cc55377
doctest fix for #42671(added format.py to doctest scripts)
Jul 25, 2021
e7a5a91
doctest fix for #42670
Jul 26, 2021
170cc45
doctest fix for #42670 (whitespace removal)
Jul 26, 2021
fad0bab
doctest fix for #42670
Jul 26, 2021
a340b16
doctest fix for #42670 (reverted formatting changes pycharm auto form…
Jul 26, 2021
93d5565
doctest fix for #42670
Jul 27, 2021
314aee5
Merge branch 'master' into doctest-fix-2
KrishnaSai2020 Jul 27, 2021
3074c66
doctest fix for #42670
Jul 27, 2021
f5756ce
doctest fix for #42670
Jul 27, 2021
2ddfc4c
doctest fix for #42670 + EngFormatter code fix
Jul 27, 2021
eb44c51
doctest fix for #42670
Jul 27, 2021
8f8763e
doctest fix for #42670 linting
Jul 27, 2021
2ab00ac
doctest fix for #42670
Jul 27, 2021
1a08c3e
doctest fix for #42670
Jul 27, 2021
9543b90
Update format.py
KrishnaSai2020 Jul 27, 2021
5b1d96f
Update format.py
KrishnaSai2020 Jul 27, 2021
98cab71
Update format.py
KrishnaSai2020 Jul 27, 2021
e79d33c
.
Jul 27, 2021
a966c3b
Merge branch 'master' into doctest-fix-2
Jul 27, 2021
9608782
made requested changes
Jul 27, 2021
96b447d
Merge https://github.com/pandas-dev/pandas into doctest-fix-2
Jul 28, 2021
8ec062d
Merge branch 'master' into doctest-fix-2
KrishnaSai2020 Jul 29, 2021
e898934
Update code_checks.sh
KrishnaSai2020 Jul 29, 2021
d4b326b
Merge branch 'pandas-dev:master' into doctest-fix-2
KrishnaSai2020 Jul 29, 2021
4899867
Merge branch 'pandas-dev:master' into doctest-fix-2
KrishnaSai2020 Jul 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
pandas/io/parsers/ \
pandas/io/sas/ \
pandas/io/sql.py \
pandas/tseries/
pandas/tseries/ \
pandas/io/formats/format.py
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi
Expand Down
5 changes: 4 additions & 1 deletion pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ def __call__(self, num: int | float) -> str:
"""
Formats a number in engineering notation, appending a letter
representing the power of 1000 of the original number. Some examples:

>>> format_eng = EngFormatter()
>>> format_eng(0) # for self.accuracy = 0
' 0'

Expand All @@ -1983,6 +1983,9 @@ def __call__(self, num: int | float) -> str:
return "inf"

sign = 1
if dnum == 0:
formatted = ' 0'
return formatted

if dnum < 0: # pragma: no cover
sign = -1
Expand Down