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

Timing improvements #2557

Merged
merged 5 commits into from Aug 8, 2019
Merged

Timing improvements #2557

merged 5 commits into from Aug 8, 2019

Conversation

peircej
Copy link
Member

@peircej peircej commented Aug 8, 2019

Using the Window.getFutureFlipTime(), created for PTB sound timing, we can make more accurate timing decisions for Builder output code as well.

Now providing a default window to sync to (like the when arg in play())
Fixed issue with extra stopping logging items
In the past we were deciding whether to draw for one more frame based on
a guess about when the next frame will occur, but not trying to determine
how far we are from that flip time:
```
if tDesired > (t-frameInterval*0.5):
  #guess we switch
```

Window now has a method to estimate time of next flip:
```
timeNextFlip = win.getFutureFlipTime()
if tDesired > timeNextFlip-tolerance:
  #we're more confident based on actual predicted frame time
```

On my tests this has made the stimulus timing very accurate
whereas before it was often out by a frame
…ming-improvements

# Conflicts:
#	psychopy/experiment/components/sound/__init__.py
#	psychopy/sound/backend_ptb.py
#	psychopy/visual/window.py
@codecov-io
Copy link

Codecov Report

Merging #2557 into master will increase coverage by 0.02%.
The diff coverage is 45.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2557      +/-   ##
==========================================
+ Coverage   44.43%   44.45%   +0.02%     
==========================================
  Files         234      234              
  Lines       41255    41275      +20     
  Branches     7115     7121       +6     
==========================================
+ Hits        18331    18349      +18     
- Misses      20966    20970       +4     
+ Partials     1958     1956       -2
Impacted Files Coverage Δ
psychopy/tools/attributetools.py 66.17% <ø> (ø) ⬆️
psychopy/sound/backend_ptb.py 0% <0%> (ø) ⬆️
psychopy/experiment/components/pump/__init__.py 8.19% <0%> (ø) ⬆️
...chopy/experiment/components/joyButtons/__init__.py 59.34% <0%> (ø) ⬆️
...sychopy/experiment/components/keyboard/__init__.py 64.47% <0%> (ø) ⬆️
...sychopy/experiment/components/joystick/__init__.py 54.04% <0%> (ø) ⬆️
...chopy/experiment/components/eyetracker/__init__.py 19.75% <0%> (ø) ⬆️
...sychopy/experiment/components/settings/__init__.py 75.46% <100%> (+0.07%) ⬆️
psychopy/experiment/components/ioLabs/__init__.py 71.96% <100%> (ø) ⬆️
...hopy/experiment/components/parallelOut/__init__.py 77.04% <100%> (ø) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4011fe0...12d4781. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 49.204% when pulling 12d4781 on peircej:timing-improvements into 4011fe0 on psychopy:master.

@peircej peircej merged commit bacf23f into psychopy:master Aug 8, 2019
@peircej peircej deleted the timing-improvements branch August 8, 2019 14:24
@peircej
Copy link
Member Author

peircej commented Aug 8, 2019

This pull request introduces 1 alert and fixes 1 when merging 12d4781 into 4011fe0 - view on LGTM.com

new alerts:

  • 1 for Unused import

fixed alerts:

  • 1 for Unused local variable

This project has automated code review enabled, but doesn't use the LGTM GitHub App. Migrate over by installing the app. Read about the benefits of migrating to GitHub Apps in the blog.


Comment posted by LGTM.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants