Releases: jfkominsky/PyHab
Version 0.11.1: Two bug fixes
This release is only compatible with PsychoPy versions 2024.1.0 and later.
This release fixes two bugs that are relatively small but made certain features unusable. You can get the fixes by just taking the PyHabBuilder.py and PyHabClass.py files and replacing the files of the same name in any experiment made with 0.11.0 OR 0.10.x, as long as you are using PsychoPy version 2024.2.2 or later. That PsychoPy release added some backwards compatibility features that mean older experiments now work on newer versions of PsychoPy without modification.
Installation and quickstart guide
As always, please join the PyHab announcements mailing list!
Bug fixes
- Fixed a bug in the builder that would generate an (incorrect) warning message and also made it impossible to change the ITI jitter setting.
- Fixed a bug with audio-only stimuli where it would not play because PyHab was checking whether the playback had already started in an outdated way. In short it thought that playback had not started so it kept calling "play" on every frame, which restarted the audio, so it never played past the first 16ms.
Version 0.11.0: PsychoPy 2024 compatibility, new features
This release is only compatible with PsychoPy versions 2024.1.0 and later. It deals with some under-the-hood changes in PsychoPy and makes PyHab more resilient to future updates. However, it will not work with versions of PsychoPy prior to 2024.1.0. This update applies to both the in-person and online versions.
It is possible to update version 0.10.x experiments to work with PsychoPy2024 and later with these updates: You can update old experiments to use the new PyHabClass and PyHabBuilder files. The only tricky one is the launcher - copy everything from the new launcher file BELOW the line that has the settings file, and paste it BELOW the line that has the settings file in your old launcher script.
EDIT 10 September 2024: There was one residual bug in the builder that has now been fixed.
In addition it adds a few little features requested by users over the past year.
Installation and quickstart guide
As always, please join the PyHab announcements mailing list!
New features
- Inter-Trial-Interval settings: In the "universal settings" you can now set an ITI that pauses the experiment for some time between trials (not to be confused with ISI, which is a pause between loops of a stimulus within a trial). The setting has a constant and "jitter" field, the constant represents the minimum ITI, and a random value between 0 and the "jitter" is added to it, allowing for partially randomized ITIs.
- Automatic eye-tracking coding for preferential looking mode: It is now possible to fully automate a preferential-looking study with a Tobii eye-tracker. Previously, you could record eye-tracking data in addition to manual coding, but now the same automatic control that was available for single-target experiments is available to preferential looking designs as well. However, right now the AOIs are extremely coarse: it just checks whether the fixation is to the left or right of the center of the screen.
- More informative startup screen for eye-tracking studies: Doing the calibration sequence for an eye-tracking study is not the most intuitive process; added some instruction text to help experimenters remember how to start it and how to finish validation. This text appears on the stimulus screen because the coder window can't safely be opened until after calibration is finished (it's complicated).
- New "cross-trial" habituation criterion: This is an esoteric option but if you are doing a "fixed trial length" habituation design, it is now possible to set a habituation criterion that looks at consecutive gaze-off events across trials (i.e., if they look away, and they are still looking away when the next trial starts, this mode counts it as one consecutive gaze-off event). Read the manual for more details.
Bug fixes
- Fixed a bug with the condition interface that was preventing stimuli from being added to trials in a condition. I don't know why the bug was happening in the first place, but I redid the code with a different approach and it went away, so good enough.
- Dealt with the changes to PsychoPy's dialog box system in 2024.1.0
- Improved "skip" behavior
- "First look" column in single-target studies wasn't being added to data by default; now included.
Version 0.10.7: Updating the online version and adding two new features
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
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
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!
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
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
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
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
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).