v0.5.0a0 - ~The Data Modeling Edition~
A lot. Namely a whole rewriting of the
This is being released as an alpha version while we finish working out a few of the kinks in the data modeling system because Jonny is finishing their dissertation and has a deadline determined by the viscera of institutional science rather than software development!
Upgrading From <v0.5.0
The subject class will attempt to update any of your existing .h5 files to the new format – it should be nondestructive (making a backup of the whole file first and then making backups up any tables that it can’t create a new version of that fully preserves the data from the previous version), but don’t be alarmed when your subject files start updating! We advise, as we always do, making a full backup of your data directory before making this update.
Change references in
TrialDatadeclarations in plugin tasks to use the new
Nafc.TrialDatafor an example. The old pytables IsDescriptor style descriptions will still work, but you will be given a warning every time.
We advise updating pigpio to at least
3c23715to avoid warnings and make use of some new functionality.
autopilot.coremodule was removed entirely, and was split into
autopilot.gui(described in module documentation) now has all the GUI modules, split out by type rather than all in one file.
autopilot.datawas created from
autopilot.core.subject, see below.
autopilot.rootcontains root classes:
Autopilot_Type- types and data models for handling and saving live data
Autopilot_Object- General root metaclass, beneath which will be top-level metaclasses for each of the major class hierarchies that are currently separate.
Autopilot_Pref- Stub for later converting prefs and environmental configuration parameters from their scattered state.
autopilot.exceptionswill be used for more explicit exception handling.
Code files were given
755permissions to allow execution (as opposed to
The unused git submodules for pigpio and an old temperature sensor were removed.
autopilot.datais the major change in this release! See the module-level doc page for more details
autopilot.core.subjectwas moved to
autopilot.data.subjectand remains the main interface to autopilot data. It was effectively rewritten to accomodate the use of data models, and many of its public methods were made private to make its use more obvious.
The subject structure that determines which things are located where has been made into its own class
Making new subjects is now done with the
Subject.new()class method rather than from the
open_hdfmethod has been replaced with the
_h5fprivate method that is a more explicit context manager allowing locking read/write access and nonlocking read access
The subject file now explicitly handles updates between different versions of the Subject class.
Subject will check if the protocol
.jsonfile has been updated from when it was assigned and automatically update to the new version, logging the change.
All trial data is now saved with a
session_uuidunique identifier column that is an always-unique key in case of any overlapping session IDs from reassignments, etc.
Many attributes were replaced by properties that return data models:
autopilot.data.interfacescontains classes to relate abstract data models to different representations and formats
autopilot.data.modelinghas basic types for use in data models
autopilot.data.modelshas the models themselves
autopilot.data.unitsstub module for using explicit units instead of anonymous floats
A new set of general model filling widgets -
widgets.model- were created that will eventually replace much of the existing GUI which suffers from code duplication problems from minor variations between representations of parameters, etc.
LOG_FORMATSwere added to allow programmatic loading of logfiles, and
utils.log_parserswas added to allow recovery of structured data (eg. from logged trial data). Loggers now use the rich logging handler for much more readable logs in stderr.
Jack_Soundclasses now put all frames at once into the processing queue, rather than one at a time for much less variability in sound onset jitter. The
JackClientclass was updated to reflect that as well by adding a
play_q_sizeargument that controls the size of the deque used to store frames to play (rather than pulling each from a Queue as was done before).
JackClientalso has an optional
disable_gc(False by default) parameter that allows the garbage collector to be disabled in the process for further (unquantified) jitter reduction.
Terminalnow closes cleanly (still with a warning of leaked semaphors) without hanging.
external.start_jackd()first check if the process is already started
Digital_Out.set()now has a
resultargument for faster setting that doesn’t confirm the result when
Messages now provide clearer support for compression in serialization, and automatically detect and handle a compressed message when deserializing. This is also carried through to the
run_scriptfunctions no longer uses the totally unreadable white on green ANSI code combo that I have no idea why i ever used in the first place.
picamera_legacyscript was added for enabling the picamera on bullseye.
Two utility functions
common.flatten_dicts()were added to make handling nested dictionaries a bit easier.
The Subject class would incorrectly overwrite data given a mismatch in system times between the Terminal and Pilot. The subject class should now ideally no longer overwrite anything ever.
The subject class would drop trial data silently if it was not in the TrialData description. En route to making the table automatically expand to accomodate unexpected data, dropped data is now logged as an exception.
The prefs manager handles being launched from within ipython and other processes better, but is still a bit buggy. Now it uses the check used internally in the multiprocessing module to see if a manager can be launched, and falls back to using a standard dictionary if not.
jackd_sourcescript uses correct
_TASK_LISTwas added to
utils.registryto support deprecated task specifications.
With additional checking for monotonic increases in
trial_numand checks that prevent data overwriting, individual writes of trial data are now a bit slower, which should be optimized for when we complete the transition to uniform data models throughout the library.
True, start pigpiod on pilot start
Stubs were created for converting the prefs to using data models, but they have not been filled yet.
AUTOPILOT_NO_PREFS_MANAGERenvironment variable now controls the use of a multiprocessing manager explicit. Documentation for environmental variables is forthcoming.
AUTOPILOT_WARN_DEFAULTSenvironment variable controls whether warnings should be printed for when a default pref value is retrieved, because that warning is a good one but can be really annoying.
Packaging & Dependencies
Autopilot is now packaged with Poetry! This allows for fully deterministic installation with the poetry.lock file and updates from the old setuptools style of dependency specification.
The source repository has moved from https://github.com/wehr-lab/autopilot to https://github.com/auto-pi-lot/autopilot
MANIFEST.inhas been replaced by the
autopilot.__version__is now determined by
importlib.metadataand specified in the
pyproject.tomlfile rather than in the
bloscwas replaced with
pyzmq 18.1.* -> ^22.3.0
tornado >=5.0.0 -> ^6.1.0
numpy >=1.16.5 -> ^1.20.0
scipy >=1.6.0 -> ^1.7.0
pandas >=0.19.2 -> ^1.3.0 on python 3.7 and ^1.4.0 on >=3.8
tables >=3.4.2 -> ^3.7.0
Sphinx >=3.1.2 -> ^4.3.1
A lot more dependencies were taken from being implicit versions to explicit by the conversion to using Poetry…
Configuration was moved to its own page, documenting setting up the system as well as the contents of the user directory.
A faq page was stubbed out (but is still pretty skeletal)
The overview was updated with some more information in the module tour
Virtual environment usage was moved from the setup page to its own subpage linked from the FAQ.
make serveoption was added to the docs makefile that makes use of sphinx-autobuild to livereload docs while editing them.
autopilot_theme.csswas updated to be compatible with the new version of sphinx-rtd-theme that apparently changed the way that TOC buttons were made, as well as remove incorrect references to fonts no longer packaged.
myst_parserextensions were added – and we will be moving towards using MyST rather than hellish ReST for future narrative docs!
Private methods and functions are now no longer rendered in the main documentation, and the library will over time use the public/private distinction more systematically to make it more understandable.
Examples was split off into its own folder and links to wiki plugins. Blink was moved with it
We have started importing some of the pigpio mocking tools from the People’s Ventilator Project to start writing GPIO tests!