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

DummyTqdmFile line buffering #960

Merged
merged 2 commits into from Feb 17, 2021
Merged

DummyTqdmFile line buffering #960

merged 2 commits into from Feb 17, 2021

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 2, 2020

Only call tqdm.write (which inserts a newline) if
DummyTqdmFile.write is itself called with a string containing a
newline; otherwise buffer the rest of the string.

See changes in test_tqdm.py for the patterns this allows.

  • I have marked all applicable categories:
    • exception-raising fix
    • visual output fix
    • documentation modification
    • new feature
  • If applicable, I have mentioned the relevant/related issue(s)

Less important but also useful:

  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

@anntzer anntzer requested a review from casperdcl as a code owner May 2, 2020 17:43
@codecov-io
Copy link

codecov-io commented May 2, 2020

Codecov Report

Merging #960 (d649576) into devel (37094ed) will increase coverage by 0.08%.
The diff coverage is 94.11%.

@@            Coverage Diff             @@
##            devel     #960      +/-   ##
==========================================
+ Coverage   84.34%   84.42%   +0.08%     
==========================================
  Files          24       24              
  Lines        1603     1618      +15     
  Branches      264      265       +1     
==========================================
+ Hits         1352     1366      +14     
  Misses        215      215              
- Partials       36       37       +1     

@casperdcl casperdcl self-assigned this May 28, 2020
@casperdcl casperdcl added this to the v5.0.0 milestone May 28, 2020
@casperdcl casperdcl added p2-bug-warning ⚠ Visual output bad to-review 🔍 Awaiting final confirmation labels May 28, 2020
tqdm/contrib/__init__.py Outdated Show resolved Hide resolved
@casperdcl casperdcl added to-merge ↰ Imminent and removed to-review 🔍 Awaiting final confirmation labels Oct 26, 2020
@casperdcl casperdcl added this to Next Release in Casper Oct 26, 2020
@casperdcl casperdcl changed the title Don't insert spurious newlines in DummyTqdmFile. DummyTqdmFile line buffering Oct 26, 2020
@anntzer anntzer force-pushed the writenl branch 2 times, most recently from 285a5d2 to 61d805b Compare February 15, 2021 13:54
@anntzer
Copy link
Contributor Author

anntzer commented Feb 15, 2021

kindly bumping.

@casperdcl
Copy link
Sponsor Member

@anntzer I just made a couple of small fixes - let me know if it works for you.

@casperdcl casperdcl added c1-quick 🕐 Complexity low p3-enhancement 🔥 Much new such feature labels Feb 17, 2021
@anntzer
Copy link
Contributor Author

anntzer commented Feb 17, 2021

Seems reasonable to me.

casperdcl added a commit that referenced this pull request Feb 17, 2021
anntzer and others added 2 commits February 17, 2021 14:59
Only call `tqdm.write` (which inserts a newline) if
`DummyTqdmFile.write` is itself called with a string containing a
newline; otherwise buffer the rest of the string.

See changes in test_tqdm.py for the patterns this allows.
@casperdcl casperdcl changed the base branch from master to devel February 17, 2021 15:09
@casperdcl casperdcl mentioned this pull request Feb 17, 2021
@casperdcl casperdcl merged commit ce08722 into tqdm:devel Feb 17, 2021
Casper automation moved this from Next Release to Done Feb 17, 2021
@anntzer anntzer deleted the writenl branch February 17, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c1-quick 🕐 Complexity low p2-bug-warning ⚠ Visual output bad p3-enhancement 🔥 Much new such feature to-merge ↰ Imminent
Projects
Casper
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants