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

Bugfix: POLL_INTERVAL_MS used in QTimer needs to be an int on python 3.10 #5467

Merged

Conversation

psobolewskiPhD
Copy link
Member

Description

Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable POLL_INTERVAL_MS is used by QTimer and the setInterval() needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not tested on 3.10 CI.

POLL_INTERVAL_MS is fairly arbitrary and unused anywhere else, so in this PR I simply assign an int to it, 16 rather than the 16.666 (~1/60).

Type of change

  • Bug-fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

References

Closes #5415

How has this been tested?

  • example: the test suite for my feature covers cases x, y, and z
  • example: all tests pass with my change
  • example: If I enable the experimental features in settings, then napari won't launch on main (as in the issue) but will launch with this branch.

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • If I included new strings, I have used trans. to make them localizable.
    For more information see our translations guide.

@github-actions github-actions bot added the qt Relates to qt label Jan 11, 2023
@codecov
Copy link

codecov bot commented Jan 11, 2023

Codecov Report

Merging #5467 (53ad9da) into main (ed26f41) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #5467      +/-   ##
==========================================
- Coverage   89.29%   89.27%   -0.03%     
==========================================
  Files         600      600              
  Lines       50964    50964              
==========================================
- Hits        45510    45499      -11     
- Misses       5454     5465      +11     
Impacted Files Coverage Δ
napari/_qt/experimental/qt_poll.py 0.00% <0.00%> (ø)
napari/_tests/test_draw.py 36.84% <0.00%> (-63.16%) ⬇️
napari/_qt/widgets/qt_color_swatch.py 71.54% <0.00%> (-3.26%) ⬇️
napari/utils/interactions.py 74.52% <0.00%> (-2.84%) ⬇️
napari/utils/info.py 78.35% <0.00%> (-2.07%) ⬇️
napari/_qt/qt_event_loop.py 81.63% <0.00%> (-0.69%) ⬇️
napari/_qt/qt_main_window.py 74.56% <0.00%> (-0.18%) ⬇️
napari/_qt/qt_viewer.py 78.89% <0.00%> (+0.20%) ⬆️
napari/_qt/dialogs/qt_package_installer.py 81.67% <0.00%> (+0.39%) ⬆️
napari/utils/theme.py 92.89% <0.00%> (+0.59%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@andy-sweet andy-sweet merged commit 29c90a4 into napari:main Jan 19, 2023
@psobolewskiPhD psobolewskiPhD added the bugfix PR with bugfix label Feb 8, 2023
@psobolewskiPhD psobolewskiPhD added this to the 0.5.0 milestone Feb 8, 2023
@Czaki Czaki mentioned this pull request Jun 7, 2023
@Czaki Czaki modified the milestones: 0.5.0, 0.4.18 Jun 16, 2023
@Czaki Czaki added the triaged-0.4.18 To mark PR that is triaged in 0.4.18 release process label Jun 16, 2023
Czaki pushed a commit that referenced this pull request Jun 16, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Czaki pushed a commit that referenced this pull request Jun 17, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Czaki pushed a commit that referenced this pull request Jun 18, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Czaki pushed a commit that referenced this pull request Jun 19, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Czaki pushed a commit that referenced this pull request Jun 21, 2023
…3.10 (#5467)

# Description
Python 3.10 no longer casts floats to ints
python/cpython#82180

The variable `POLL_INTERVAL_MS` is used by QTimer and the
`setInterval()` needs an int (in milliseconds), see:
https://doc.qt.io/qt-5/qtimer.html

This means that in python 3.10 the existing value (16.666) results in a
TypeError (see #5415 ) and napari doesn't even launch.

Note: This is part of the experimental async/octree and apparently not
tested on 3.10 CI.

`POLL_INTERVAL_MS` is fairly arbitrary and unused anywhere else, so in
this PR I simply assign an int to it, `16` rather than the `16.666`
(~1/60).


## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Bug-fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

# References

Closes #5415 

# How has this been tested?
<!-- Please describe the tests that you ran to verify your changes. -->
- [ ] example: the test suite for my feature covers cases x, y, and z
- [ ] example: all tests pass with my change
- [x] example: If I enable the experimental features in settings, then
napari won't launch on main (as in the issue) but will launch with this
branch.

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] If I included new strings, I have used `trans.` to make them
localizable.
For more information see our [translations
guide](https://napari.org/developers/translations.html).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR with bugfix qt Relates to qt triaged-0.4.18 To mark PR that is triaged in 0.4.18 release process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

napari 0.4.17 fails with QtPoll error on a virgin install on windows. Works on the nightly build
4 participants