Skip to content

Releases: jfkominsky/PyHab

Version 0.10.7: Updating the online version and adding two new features

08 Mar 08:49
Compare
Choose a tag to compare

This release adds two new experiment control flow features: a minimum duration setting for individual trial types, and a new habituation mode that's well-suited for neuroimaging. In addition, the online version has been "caught up" to the in-person version in all of its features (i.e., it's now based on a clone of 0.10.7 rather than the 0.9 version it was based on previously).

Note that the changes to the ONLINE version are breaking changes. You will have to remake any online experiments from scratch to get access to the new features. For the in-person version, the changes should not break any experiment made in version 0.10.1 or later, so if you want the bug fixes in an existing experiment, just copy over the PyHabClass, PyHabClassPL, PyHabClassHPP, and PyHabBuilder files into that experiment's PyHab folder.

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

New features

  • Minimum Trial Duration: A new advanced trial setting that will require a trial to run for a minimum amount of time, even if it's gaze-contingent. If the conditions to end the trial are met before the minimum duration, the trial will end as soon as it hits the minimum duration. This setting will take priority over the "end on movie end" setting, so I don't recommend using them together.
  • Fixed Trial Length Habituation Mode: Primarily designed for neuroimaging studies, this new habituation mode assumes that each individual trial is not gaze-contingent and runs for a fixed amount of time. Habituation in this case is based on a criterion of "The infant looked away for X consecutive seconds in each of Y consecutive habituation trials".
  • Online version catch-up: The online version is separate from the in-person version for a variety of reasons, but as a result, it hasn't kept up with the new features I've added to the in-person version. The online version is now fully caught up, meaning that it also has the two new features in this update, as well as all the features from 0.10.1 and later that hadn't made their way over yet. However, just as 0.10 was a breaking change for the in-person version, this is a breaking change for the online version, so if you want to use the new features in an online study, you have to remake it from scratch.

Bug fixes

  • All bug fixes from the in-person version after 0.9 have now been incorporated into the online version.
  • Additional update to fix "redo" behavior in certain situations.

Version 0.10.6: Bug fixes, backend updates, new summary data, and new habituation settings

15 Feb 12:01
c8810df
Compare
Choose a tag to compare

This release fixes a few bugs, moves PyHab to the newer PsychoPy movie presentation system if you are running a sufficiently new version of PsychoPy (it has backwards compatibility for earlier versions), and adds a couple little new features. The manual has also been updated.

The changes should not break any experiment made in version 0.10.1 or later, so if you want the bug fixes in an existing experiment, just copy over the PyHabClass, PyHabClassPL, PyHabClassHPP, and PyHabBuilder files into that experiment's PyHab folder.

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

New features

  • Summary data now records "first look" for each trial in addition to total looking time. This information was always accessible in the verbose data, it's now just easier to extract from the main data file.
  • Improved/fixed the "Threshold" habituation type and added a "maximum trials to set a habituation criterion" setting. The threshold setting now only computes a habituation criterion if the previous N habituation trials have a total looking time over the threshold you set, and you can use an additional setting to make it so that if a habituation criterion has not been set after some number of habituation trials, then the habituation block simply ends (primarily useful for exclusions, prevents experiments from dragging on if the kid is not engaged).
  • PyHab will now use the newer PsychoPy MovieStim backend or any version of PsychoPy from 2023 or later. The new version of MovieStim is much more reliable and efficient than MovieStim3 (and will continue to receive updates, which MovieStim3 will not), though it still has occasional issues. However, for PsychoPy 2023 and later, the new MovieStim is the best option now that it has a working 'seek' function and a way to check the timestamp of the playback.
  • Added a window flip to clear the "Measuring frame rate" text from the stimulus screen(s) when launching an experiment in newer versions of PsychoPy, so it will now show a blank screen (if there is no pre-experiment image set).

Bug fixes

  • Fixed a bug that would cause occasional crashes when coding a habituation experiment without stimulus presentation.
  • Fixed a bug that could cause habituation designs with a single trial following habituation to skip the test trial. This would only be a problem if there was exactly one trial after the habituation block, and since nobody has emailed me about it, I'm assuming it hasn't been a major issue.
  • Fixed a bug with saving a new experiment by modifying an existing one. The calibration stimuli for eye-tracking will now copy over correctly.

Version 0.10.5: Bug fixes and a new feature for advanced users

02 Aug 13:47
Compare
Choose a tag to compare

This release fixes a few bugs and adds a new type of stimulus display that is recommended only for advanced users.

The changes should not break any experiment made in version 0.10.1 or later, so if you want the bug fixes in an existing experiment, just copy over the PyHabClass and PyHabBuilder files into that experiment's PyHab folder.

As of this release, I strongly recommend using PsychoPy version 2023.2.0 or later. Most of the audio issues that were present in 2023.1 have been resolved, and the new version is the most stable and reliable to date. Furthermore, it doesn't seem to break older experiments.

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

New feature: PsychoPy Animation stimuli

  • Added a new type of stimuli called 'Animations'. These are basically a way to use custom-programmed PsychoPy animations as stimuli that otherwise behave exactly like any other PyHab stimulus type (i.e., relatively modular and doesn't affect recording gaze on/off or data).
  • Using this stimulus type requires modifying the code of PyHabClass.py to create the animations themselves.
  • There is some demo code included in PyHabClass.py in the "DispAnimationStim" function so you can get an idea of how to make it work, but this is really a feature for advanced users with some programming experience. Contact me if you have questions.

Bug fixes

  • Fixed a bug that could mess with the conditions file if you tried to randomize more than once.
  • Fixed a builder crash with block settings.
  • Added a little safety measure for detecting which version of PsychoPy is being used and selecting the audio library most likely to work.
  • Fixed some problems with manually inserting habituation trials at the end of a habituation block.
  • Fixed a timing issue with the simulated attention-getter used for offline coding. Accounting for human reflexes, it should now be easier to align offline coding with the start of a trial based on when you hear the attention-getter.

Version 0.10.4: Timing, Tobii eye-tracking, and online studies!

04 Oct 09:42
a7ba1bc
Compare
Choose a tag to compare

This release adds two big new features and starts the process of integrating the "online version" of PyHab with the in-person version.

The changes shouldn't break any existing experiments made in 0.10.1 or later, so if you want the new timing files just copy over the PyHabClass files from the new version to existing experiments. Eye-tracking studies using the new Tobii integration should be made from scratch.

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

New features:

  • PyHab now records timing files that catalog the start and end of each attention-getter and trial. These are saved to a separate "timing" sub-folder in the data folder.
  • Tobii eye-tracker integration! Thanks to @yh-luo, PyHab now comes with psychopy_tobii_infant, and it is now possible to interface with Tobii eye-trackers without any additional software. Includes a 5-point calibration, the ability to redo calibration mid-experiment, and the ability to control advancement automatically from eye-tracking rather than manual button presses in single-target experiments. See the PyHab User Manual PDF for more information.
  • It's possible to use other types of eye-trackers in principle but it requires substantial code modification and it's going to be specific to each individual setup. Contact me if you want to use PyHab with an EyeLink, GazePoint, or SMI eye-tracker.

Online studies

  • The "PyHab online edition" is now part of the main PyHab download, but it is still a completely separate system. It has its own sub-folder, and you use the "NewPyHabOnlineProject" file to create one. The manual has more information, start with the manual if you want to do online studies.
  • The online edition has the new timing-file feature. The point of adding the online edition to the main download was to make it easier to keep it up to date. It's still based on an older version of PyHab, but going forward it should get most of PyHab's newer features (if they apply to the online edition).

Bug fixes

  • Fixed a bug that would cause a crash if you pressed the 'redo' key before the first trial.
  • Fixed a bug with updating file paths for attention-getter files.

Version 0.10.3: One small but important bug fix

28 Jul 07:34
Compare
Choose a tag to compare

This release fixes a bug that would make it impossible to change the settings of a trial type in an experiment after the experiment had been saved once. In other words, this bug made it effectively impossible to modify an existing experiment!

You can and should replace the PyHabBuilder.py file in existing experiment folders (in the "PyHab" folder within the experiment folder) as long as the experiment was built in v0.10.0. This version will break any experiment made in 0.9.

Note that this is only for in-person studies. The online version can be found here, just click the green "code" button in the top left and select "download zip".

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

Changes

  • Fixed a bug that would cause the builder to crash when trying to modify a trial type in a study that was loaded from save.

Version 0.10.2: Important habituation bug fix + new end-trial criteria

10 Jul 14:01
837bd63
Compare
Choose a tag to compare

This release has some critical bug-fixes for habituation experiments and a new option for end-of-trial criteria.

You can and should replace the PyHabClass, PyHabClassPL, PyHabClassHPP, and PyHabBuilder files in existing experiment folders as long as the experiment was built in v0.10.0, and especially if those experiments used habituation. This version will break any experiment made in 0.9.

Note that this is only for in-person studies. The online version can be found here, just click the green "code" button in the top left and select "download zip".

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

Changes

  • Critical bug-fix: Ending habituation on the maximum habituation trials: Fixed a bug where, if the habituation block ended because the maximum number of habituation trials was reached, the experiment would skip ahead too many trials or crash.
  • Bug-fix: Fixed end-of-habituation behavior with multiple hab blocks: Fixed an edge case bug where, for entirely different reasons, ending the first habituation block in an experiment with multiple habituation blocks would skip too far ahead.
  • New feature: MaxOff/MaxOn end-of-trial criteria: Added a new gaze-contingent end-of-trial option. This option works almost exactly like the standard gaze-contingent trial, where the trial ends if the infant looks away after looking for the minimum on-time, but adds an additional way of ending the trial, which is if the infant looks for a maximum on-time. So, for example, you could have a trial that ends if the infant looks for at least 1 second then looks away for 2 consecutive seconds, or it ends if the infant looks for cumulative 30 seconds, or if the maximum trial time is reached, whichever of these comes first.
  • UI fixes: Made the button locations in the builder more consistent. Some buttons would appear in different locations depending on when they were added to the interface, and some buttons appeared in places that were a little out of order.
  • Behind the scenes: Made a few changes to the automated testing workflow. Better testing means fewer bugs on release!

Version 0.10.1: Bug fixes and block-level redos

09 Jun 21:42
2a02fc7
Compare
Choose a tag to compare

This release fixes some critical builder bug-fixes and a new feature that allows for redos to occur at the level of the block iteration (see below)

You should be able to replace the PyHabClass, and PyHabBuilder files in existing experiment folders to access the new stuff, as long as the experiment was built in v0.10.0. This version will break any experiment made in 0.9

Note that this is only for in-person studies. The online version can be found here, just click the green "code" button in the top left and select "download zip".

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

Changes

  • New feature: block-level redo. This setting, found in the block-maker interface, makes the "abort" and "redo" functions operate over an entire block rather than the trials within it. This is the default behavior for habituation blocks, but you can now do it with any block! So, for example, if you have a block with trials A, B, C, and this setting is on, if you redo or abort a trial anywhere in the block, it'll rewind to the start of the most recent trial A. If the setting is off, it will rewind to the last trial that had the auto-advance setting turned off.
  • Bug fix: The builder now behaves properly on Windows again. There was an issue where, due to a misplaced if statement, you couldn't open any of the menus on Windows.
  • Known PsychoPy Issue: If you are using a Mac with a retina display, then the builder won't work on PsychoPy 2022.x.x. You need to downgrade to Psychopy 2021.2.3
  • Bug fix: Corrected an edge case where trials with an auto-redo that ended based on an on-time criterion would listen to the off-time criterion as well, even when they weren't supposed to.

Version 0.10.0: Big under the hood changes, new capability

29 May 16:08
a4f6872
Compare
Choose a tag to compare

This release changes some big things under the hood to support new types of experiment designs.

This update has breaking changes. Do NOT update the PyHabClass files of any existing experiments with the files from this update. This version of PyHab should only be used for making new experiments. It just adds new capabilities. That's why it's a major version update rather than an iteration on 0.9.

Changes

  • Habituation is now a property of blocks. There is no such thing as a "habituation trial" anymore, just habituation blocks that can have 1 to any number of trials in them. (Blocks still work as they did before, habituation is just an option you can turn on for any given block.)
  • The "habituation settings" menu is now found by going into the block interface.
  • You can have multiple habituation blocks in the same experiment. Each individual type of habituation block can only be used once (so that they are separated in the output), but you can have more than one type of habituation block in an experiment (even if it uses the same trial types as another habituation block).
  • The builder is now much clearer about what you can and can't name things (and certain names like 'hab' are no longer restricted).

Version 0.9.5: Bug fixes and HPP upgrades

16 May 13:40
32b5334
Compare
Choose a tag to compare

This release fixes some bugs and adds some new functionality to Head-turn Preference Procedure studies (many thanks to Jessica Kosie for beta-testing the HPP systems!)

You should be able to replace the PyHabClass, PyHabClassHPP, and PyHabBuilder files in existing experiment folders to access the new stuff, but in this case I don't recommend it unless you are doing an HPP study specifically.

Note that this is only for in-person studies. The online version can be found here, just click the green "code" button in the top left and select "download zip".

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

Changes

  • New feature: HPP Stim-screen only setting. This setting, found in the Advanced Trial Settings, makes it so that only gazes to screens containing stimuli are counted as gaze-ons for the purposes of determining when trials start and end, as well as habituation criteria. Note that all key-presses are still recorded in the data files, this only affects the flow of the study while it is running. Because it is in the advanced trial settings, this can be set for some trial-types and not others.
  • Bug fix: If the first trial is supposed to auto-advance it won't wait for the first gaze-on, it'll just go as soon as 'A' is pressed the first time.
  • Bug fix: Side screens will now go blank between trials in HPP, even if auto-advance is active.
  • Bug fix: It was possible to have auto-redo on for a trial without setting an on-time deadline, leading to a runtime crash. This makes it so that if the trial is in auto-redo and no deadline is set, it defaults to max trial duration. It will still default to a negative number in the builder, but when the settings are saved it will update to the most current maximum trial duration.

Version 0.9.4: Various bug fixes and updates

19 Nov 16:39
Compare
Choose a tag to compare

It's been over a year since the last release, and PsychoPy has updated some of the underlying system PyHab uses. This update catches PyHab up with PsychoPy, introduces a new setting to help with some issues that might arise with video playback, and a few other little fixes.

You should be able to replace the PyHabClass and PyHabBuilder files in existing experiment folders to access the new stuff.

Note that this is only for in-person studies. The online version can be found here, just click the green "code" button in the top left and select "download zip".

Installation and quickstart guide

As always, please join the PyHab announcements mailing list!

Changes

  • Added a new setting to the universal settings that changes how movies are loaded. This can be helpful for addressing some playback issues and crashes that can arise with movie stimuli. Please see the "troubleshooting" section of the user manual for more information.
  • PyHab now uses the PTB sound library instead of SoundDevice. This should make audio playback faster and more reliable.
  • PyHab's built-in attention-getters are now 'smarter' about display size, so if you are using a lower-resolution display they won't be huge, and if you're using a higher-resolution display they won't be tiny. Does not affect custom attention-getters that are movie files.
  • If you have a trial where the attention-getter ends early if the experimenter indicates a gaze-on, the coder window will now give you feedback about whether the gaze-on key is pressed during the attention-getter.
  • Fixed a builder crash when opening the stimulus options.
  • Fixed an edge case crash that could happen if you had an experiment that was at one point set up for habituation and then you remove the habituation.