Skip to content

Commit

Permalink
bump version, merge pull request #1629 from tqdm/fix-gui
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
casperdcl committed Nov 12, 2024
2 parents 35a6ee9 + a2d5f1c commit 0ed5d7f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
finish:
name: pytest cov
continue-on-error: ${{ github.event_name != 'push' }}
Expand Down
4 changes: 2 additions & 2 deletions .meta/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pre-commit
pytest
pytest-asyncio
pytest-asyncio>=0.24
pytest-cov
pytest-timeout
nbval
git+https://github.com/casperdcl/nbval.git@master#egg=nbval
ipywidgets
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
- numpy
- pandas
- pytest-timeout
- pytest-asyncio>0.21
- pytest-asyncio>=0.24
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
Expand Down
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ dependencies:
- pytest
- pytest-cov
- pytest-timeout
- pytest-asyncio
- nbval
- pytest-asyncio>=0.24
- coverage
# extras
- dask # dask
Expand All @@ -35,12 +34,13 @@ dependencies:
- rich # rich
- argopt # `cd wiki && pymake`
- twine # `pymake check pypi`
- build # `python -m build`
- python-build # `python -m build`
# `cd docs && pymake`
- mkdocs-material
- pygments
- pymdown-extensions
- pip:
- git+https://github.com/casperdcl/nbval.git@master#egg=nbval # tests (native)
- py-make >=0.1.0 # `make/pymake`
- mkdocs-minify-plugin # `cd docs && pymake`
- git+https://github.com/tqdm/jsmin@fix-pip#egg=jsmin # `cd docs && pymake`
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ classifiers = [
dependencies = ['colorama; platform_system == "Windows"']

[project.optional-dependencies]
dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-xdist"]
dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-asyncio>=0.24", "nbval"]
discord = ["requests"]
slack = ["slack-sdk"]
telegram = ["requests"]
Expand Down
17 changes: 5 additions & 12 deletions tqdm/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def display(self, *_, **__):
ax = self.ax
line1 = self.line1
line2 = self.line2
hspan = getattr(self, 'hspan', None)
# instantaneous rate
y = delta_it / delta_t
# overall rate
Expand All @@ -148,18 +149,10 @@ def display(self, *_, **__):
if total:
line1.set_data(xdata, ydata)
line2.set_data(xdata, zdata)
try:
poly_lims = self.hspan.get_xy()
except AttributeError:
self.hspan = self.plt.axhspan(0, 0.001, xmin=0, xmax=0, color='g')
poly_lims = self.hspan.get_xy()
poly_lims[0, 1] = ymin
poly_lims[1, 1] = ymax
poly_lims[2] = [n / total, ymax]
poly_lims[3] = [poly_lims[2, 0], ymin]
if len(poly_lims) > 4:
poly_lims[4, 1] = ymin
self.hspan.set_xy(poly_lims)
if hspan:
hspan.set_xy((0, ymin))
hspan.set_height(ymax - ymin)
hspan.set_width(n / total)
else:
t_ago = [cur_t - i for i in xdata]
line1.set_data(t_ago, ydata)
Expand Down

0 comments on commit 0ed5d7f

Please sign in to comment.