Skip to content

Commit 0ed5d7f

Browse files
committed
bump version, merge pull request #1629 from tqdm/fix-gui
misc fixes
2 parents 35a6ee9 + a2d5f1c commit 0ed5d7f

File tree

6 files changed

+13
-19
lines changed

6 files changed

+13
-19
lines changed

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8686
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8787
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
88+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8889
finish:
8990
name: pytest cov
9091
continue-on-error: ${{ github.event_name != 'push' }}

.meta/requirements-test.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pre-commit
22
pytest
3-
pytest-asyncio
3+
pytest-asyncio>=0.24
44
pytest-cov
55
pytest-timeout
6-
nbval
6+
git+https://github.com/casperdcl/nbval.git@master#egg=nbval
77
ipywidgets

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ repos:
3737
- numpy
3838
- pandas
3939
- pytest-timeout
40-
- pytest-asyncio>0.21
40+
- pytest-asyncio>=0.24
4141
- repo: https://github.com/PyCQA/flake8
4242
rev: 7.1.1
4343
hooks:

environment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ dependencies:
2020
- pytest
2121
- pytest-cov
2222
- pytest-timeout
23-
- pytest-asyncio
24-
- nbval
23+
- pytest-asyncio>=0.24
2524
- coverage
2625
# extras
2726
- dask # dask
@@ -35,12 +34,13 @@ dependencies:
3534
- rich # rich
3635
- argopt # `cd wiki && pymake`
3736
- twine # `pymake check pypi`
38-
- build # `python -m build`
37+
- python-build # `python -m build`
3938
# `cd docs && pymake`
4039
- mkdocs-material
4140
- pygments
4241
- pymdown-extensions
4342
- pip:
43+
- git+https://github.com/casperdcl/nbval.git@master#egg=nbval # tests (native)
4444
- py-make >=0.1.0 # `make/pymake`
4545
- mkdocs-minify-plugin # `cd docs && pymake`
4646
- git+https://github.com/tqdm/jsmin@fix-pip#egg=jsmin # `cd docs && pymake`

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ classifiers = [
8484
dependencies = ['colorama; platform_system == "Windows"']
8585

8686
[project.optional-dependencies]
87-
dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-xdist"]
87+
dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-asyncio>=0.24", "nbval"]
8888
discord = ["requests"]
8989
slack = ["slack-sdk"]
9090
telegram = ["requests"]

tqdm/gui.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def display(self, *_, **__):
122122
ax = self.ax
123123
line1 = self.line1
124124
line2 = self.line2
125+
hspan = getattr(self, 'hspan', None)
125126
# instantaneous rate
126127
y = delta_it / delta_t
127128
# overall rate
@@ -148,18 +149,10 @@ def display(self, *_, **__):
148149
if total:
149150
line1.set_data(xdata, ydata)
150151
line2.set_data(xdata, zdata)
151-
try:
152-
poly_lims = self.hspan.get_xy()
153-
except AttributeError:
154-
self.hspan = self.plt.axhspan(0, 0.001, xmin=0, xmax=0, color='g')
155-
poly_lims = self.hspan.get_xy()
156-
poly_lims[0, 1] = ymin
157-
poly_lims[1, 1] = ymax
158-
poly_lims[2] = [n / total, ymax]
159-
poly_lims[3] = [poly_lims[2, 0], ymin]
160-
if len(poly_lims) > 4:
161-
poly_lims[4, 1] = ymin
162-
self.hspan.set_xy(poly_lims)
152+
if hspan:
153+
hspan.set_xy((0, ymin))
154+
hspan.set_height(ymax - ymin)
155+
hspan.set_width(n / total)
163156
else:
164157
t_ago = [cur_t - i for i in xdata]
165158
line1.set_data(t_ago, ydata)

0 commit comments

Comments
 (0)