-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from wehr-lab/2to3
2to3
- Loading branch information
Showing
414 changed files
with
39,916 additions
and
78,648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,7 @@ venv3/ | |
|
||
# viz renders | ||
/*/viz/*.html | ||
venv38 | ||
venv* | ||
transform_scratch.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
[submodule "src/pigpio"] | ||
path = src/pigpio | ||
url = https://github.com/sneakers-the-rat/pigpio/ | ||
[submodule "src/mlx90640-library"] | ||
path = src/mlx90640-library | ||
url = https://github.com/sneakers-the-rat/mlx90640-library/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF | ||
formats: | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
python: | ||
version: 3.7 | ||
install: | ||
- requirements: requirements/requirements_docs.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
sudo: required | ||
|
||
language: python | ||
python: | ||
- "3.7" | ||
|
||
arch: | ||
- amd64 | ||
|
||
os: | ||
- linux | ||
|
||
script: | ||
- echo "One day we will have actual tests I swear!" | ||
|
||
#before_deploy: | ||
# - pip install scikit-build | ||
|
||
deploy: | ||
provider: pypi | ||
username: __token__ | ||
pasword: | ||
secure: mIaKgOMl4tjUvLlpSGwbuUj2A7QK0nMnQzlYygdVN5vCuvXnggScytqwXNqjSqjB3cn0R4EKllCfnREsIqBgYrEsRCRIexwLuz58KDo6qjSad/ycpCjmtz/6nvuJp3I2iJGudzCZ/W1MCpz0ExAvvHXm7k0U4J831bK+mFYqe8RHJxcAuYMJndEUaD5s/Ly+ozqJYx3H9+f/fggpVAlGu/oy5p77so9vQA0xvayodQKzL1XGvNHBXMEKtBtEN33pTKDbOY3bQ7GR0WLE7pd+bg1rZ/r5EsvlHAlHR/rSCWDNq4K0Qk3ZyUeHLX9UjKIImXbhMMyNSyz98DkgUd/TkfGG2K2jyKd7WR1KqOrNjy+clqTdyj1fcHtm8au6YsvYLvR9qmO1prwrGq1vMH0/qvOrcM3+OU3hGdUwtjth3F+TTsc57O22qHjpeq/xlWtFC8vAF92ZHzPWW6xBApYB3+MJZHh27LJL/rdbAv/WoYPZbQWiqxNm869GCaSzjBGZ/Zx5BPpGbJUb8N+pBHgow3gww2TMS1C7W3gDVPm42DL8ehhOEJZBT9FIfzAooeyxzyvUb6gSdtshGUuJPe8HdZhNn5n4rFuSoZ7edCbEEM7bQ/gqOJK9Ccr+4yi/9MHBXB7LsjB32tzlxbsEePG18ac85wJp1Z64QYMpzV5DAi0= | ||
on: | ||
tags: true | ||
branch: master | ||
distributions: "sdist" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(autopilot VERSION 0.3) | ||
#find_package(PythonExtensions REQUIRED) | ||
|
||
# Global settings | ||
#set(GLOBAL_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) | ||
#set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/install) | ||
|
||
# include download project function from https://github.com/Crascit/DownloadProject/ | ||
# include(cmake/DownloadProject.cmake) | ||
|
||
option(PIGPIO "Install pigpio (only possible on the raspberry pi)" OFF) | ||
option(JACK "Install jack audio" OFF) | ||
|
||
message(STATUS "CMAKE_BUILD_DIR: ${CMAKE_BUILD_DIR}") | ||
message(STATUS "CMAKE_INSTALL_DIR: ${CMAKE_INSTALL_DIR}") | ||
message(STATUS "SETUPTOOLS_INSTALL_DIR: ${SETUPTOOLS_INSTALL_DIR}") | ||
message(STATUS "SKBUILD_DIR: ${SKBUILD_DIR}") | ||
|
||
|
||
if(PIGPIO) | ||
add_subdirectory(src/pigpio) | ||
list(APPEND INSTALL_AUTOPILOT_PACKAGES pigpio) | ||
endif() | ||
|
||
if(JACK) | ||
include(cmake/jack.cmake) | ||
|
||
|
||
endif() | ||
|
||
|
||
|
||
|
||
|
||
|
||
if(INSTALL_AUTOPILOT_PACKAGES) | ||
install(TARGETS ${INSTALL_AUTOPILOT_PACKAGES} LIBRARY DESTINATION autopilot/external) | ||
else() | ||
install(FILES "nofile" LIBRARY DESTINATION autopilot/external OPTIONAL) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Contributing docs are just a stub for now!!! | ||
|
||
# Update Checklist | ||
|
||
* Docs up-to-date | ||
* Requirements re-frozen | ||
* Changelog, To-Do are updated | ||
* Build all versions - src, mac, manylinux, armv7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,107 @@ | ||
![PyPI](https://img.shields.io/pypi/v/auto-pi-lot) | ||
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/auto-pi-lot)](https://pypi.org/project/auto-pi-lot/) | ||
[![Documentation Status](https://readthedocs.org/projects/auto-pi-lot/badge/?version=latest)](https://docs.auto-pi-lot.com/en/latest/?badge=latest) | ||
![PyPI - Status](https://img.shields.io/pypi/status/auto-pi-lot) | ||
|
||
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0) | ||
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md) | ||
|
||
# Temporary Hiatus | ||
# Autopilot | ||
|
||
*updated May 28, 2020* | ||
![Autopilot Banner Logo](docs/_images/autopilot_logo_banner.png) | ||
|
||
**Autopilot's development is on temporary hiatus due to covid-19.** Jonny is working on the People's Ventilator Project (https://github.com/CohenLabPrinceton/Ventilator-Dev), developing the GUI and UX for a supply-chain resistant emergency ventilator. | ||
| [Docs](https://docs.auto-pi-lot.com) | [Paper](https://www.biorxiv.org/content/10.1101/807693v1) | [Forum](https://groups.google.com/forum/#!forum/autopilot-users) | [Hardware](https://auto-pi-lot.com/hardware/) | | ||
| :-: | :-: | :-: | :-: | | ||
| [![Read the Docs](docs/_images/docs_link.png)](https://docs.auto-pi-lot.com) | [![Paper](docs/_images/paper_link.png)](https://www.biorxiv.org/content/10.1101/807693v1) | [![Forum](docs/_images/discussion_link.png)](https://groups.google.com/forum/#!forum/autopilot-users) | [![Hardware (Coming Soon!)](docs/_images/hardware_link_construction.png)](https://auto-pi-lot.com/hardware) | ||
|
||
After v1.0 enters FDA testing, Jonny will return to Autopilot with a huge update (that you can see in the `2to3` branch :). This will likely be mid-June. | ||
Autopilot is a Python framework for performing complex, hardware-intensive behavioral experiments with swarms of networked Raspberry Pis. | ||
As a tool, it provides researchers with a toolkit of flexible modules to design experiments without rigid programming & API limitations. | ||
As a vision, it dreams of bridging the chaotic hacky creativity of scientific programmers with a standardized, | ||
communally developed library of reproducible experiment prototypes. | ||
|
||
Autopilot was developed with three primary design principles: | ||
|
||
# Autopilot | ||
* **Flexibility** - Autopilot was designed for any hardware and any experiment -- | ||
its hardware API is designed to give a structured wrapper around the code you already use, and its task design is | ||
entirely non-prescriptive. It attempts to eliminate the need for researchers to use a patchwork of mutually incompatible tools to perform complex | ||
experiments. Autopilot is a hacker's plaything -- rather than a uniform, simplified experience, | ||
its modular design and complete API-level documentation is meant to encourage users to make and break core Autopilot modules. | ||
* **Efficiency** - Autopilot uses Python as a glue around high-performance, low-level libraries, | ||
and is fully concurrent across multiple threads, processes, and computers. Its distributed | ||
design eliminates the hard limits faced by by single-computer | ||
systems, letting researchers use arbitrary numbers and combinations of hardware components | ||
to perform complex, hardware-intensive experiments at scale. | ||
* **Reproducibility** - Autopilot obsessively documents data provenance, | ||
logging the entire history of an Animal's training, including any version and local | ||
code changes. Any part of an experiment that isn't documented is considered a bug. By integrating experiments and producing data that is | ||
clean at the time of acquisition, Autopilot makes it easy to do good science -- its goal is to allow | ||
exact experimental replication from a single file. | ||
|
||
# Distributed Behavior | ||
|
||
Autopilot's premise is simple: to scale experiments, *just use more computers*. | ||
|
||
Autopilot systems consist of multiple "Agents" -- computers with specialized roles in the swarm. | ||
One user-facing "Terminal" agent allows a researcher to control many "Pilots," or computers that perform experiments (typically the beloved Raspberry Pi). | ||
Each Pilot can coordinate one or many "Children" to offload subsets of an experiment's computational or hardware requirements. | ||
Users can use and misuse Autopilot's flexible modules to make whatever agent topology they need <3. | ||
|
||
![Autopilot System Diagram](docs/_images/whole_system_black.png) | ||
|
||
# Module Overview | ||
|
||
Autopilot divides the logical structure of experiments into independent<sup>1</sup> modules: | ||
|
||
| | Module | | ||
| :-: | --- | | ||
| ![Hardware](docs/_images/icon_agent.png) | **Agents - [Pilot](https://docs.auto-pi-lot.com/en/latest/autopilot.core.pilot.html) & [Terminal](https://docs.auto-pi-lot.com/en/latest/autopilot.core.terminal.html)** Runtime classes that encapsulate a computer/Pi's role in the swarm. Terminals provide the user interface and coordinate subjects and tasks, Pilots do the experiments. Formalizing the Agent API to allow additional agents like Compute or Surveillance agents is a major short-term development goal! | | ||
| ![Hardware](docs/_images/icon_hardware.png) | **[Hardware](https://docs.auto-pi-lot.com/en/latest/autopilot.hardware.html)** - Control your tools! Extensible classes to control whatever hardware you've got. | | ||
| ![Hardware](docs/_images/icon_stim.png) | **[Stimuli](https://docs.auto-pi-lot.com/en/latest/autopilot.stim.html)** - Stimulus management and presentation. Parametric sound generation with a realtime audio server built on Jackd. Stubs are present for future development of visual stimuli using Psychopy. | | ||
| ![Hardware](docs/_images/icon_task.png) | **[Tasks](https://docs.auto-pi-lot.com/en/latest/autopilot.tasks.html)** - Build experiments! Write some basic metadata to describe data, plots, and hardware and the rest is up to you :) | | ||
| ![Hardware](docs/_images/icon_data.png) | **[Subject](https://docs.auto-pi-lot.com/en/latest/autopilot.core.subject.html)** - Data management with hdf5 and pyTables. Abstraction layer for keeping obsessive records of subject history and system configuration | | ||
| ![Hardware](docs/_images/icon_transform.png) | **[Transforms](https://docs.auto-pi-lot.com/en/latest/autopilot.transform.html)** - Composable data transformations. Need to control the pitch of a sound with a video? build a transformation pipeline to connect your objects | | ||
| ![Hardware](docs/_images/icon_gui.png) | **[UI](https://docs.auto-pi-lot.com/en/latest/autopilot.core.gui.html)** - UI for controlling swarms of Pilots using Qt5/PySide2 | | ||
| ![Hardware](docs/_images/icon_viz.png) | **[Visualization](https://docs.auto-pi-lot.com/en/latest/autopilot.viz.html)** - (Mostly Prototypes) to do common visualizations | | ||
|
||
|
||
|
||
<sup>1</sup> a continual work in progress! | ||
# Getting Started | ||
|
||
[**All documentation is hosted at https://docs.auto-pi-lot.com**](https://docs.auto-pi-lot.com) | ||
|
||
Installation is simple, just install with pip and use Autopilot's guided setup to configure your environment and preferences. | ||
The initial setup routine uses a CLI interface that is SSH friendly :) | ||
|
||
```bash | ||
pip3 install auto-pi-lot | ||
python3 -m autopilot.setup.setup_autopilot | ||
``` | ||
|
||
![Autopilot Setup Console](docs/_images/installer.png) | ||
|
||
All of Autopilot is quite new, so bugs, incomplete documentation, missing features are very much expected! Don't be shy about | ||
[raising issues](https://github.com/wehr-lab/autopilot/issues) or [asking questions in the forum](https://groups.google.com/forum/#!forum/autopilot-users). | ||
|
||
|
||
|
||
# What's new? | ||
|
||
**[v0.3.0](https://docs.auto-pi-lot.com/en/latest/changelog/v0.3.0.html#changelog-v030)** | ||
|
||
After much ado, we're releasing Autopilot's first major upgrade. Cameras, Continuous data, DeepLabCut, and a lot more! | ||
|
||
- Autopilot has moved to Python 3!! (Tested on 3.6-3.8) | ||
- Capturing video with OpenCV and the Spinnaker SDK is now supported (See autopilot.hardware.cameras) | ||
- An I2C_9DOF motion sensor and the MLX90640 temperature sensor are now supported. | ||
- Timestamps from GPIO events are now microsecond-precise thanks to some modifications to the pigpio library | ||
- GPIO output timing is also microsecond-precise thanks to the use of pigpio scripts, so you can deliver exactly the reward volumes you intend <3 | ||
- Hardware modules have been refactored into their own module, and have been almost wholly rebuilt to have sensible inheritance structure. | ||
- Networking modules are more efficient and automatically compress arrays (like video frames!) on transmission. Streaming is also easier now, check out Net_Node.get_stream() ! | ||
- We now have a detailed development roadmap , so you can see the magnificent future we have planned. | ||
- We have created the autopilot-users discussion board for troubleshooting & coordinating community development :) | ||
|
||
Distributed behavioral experiments with lots of Raspberry Pis | ||
|
||
README coming soon, for now | ||
# What's next? | ||
|
||
* [Read the paper](https://www.biorxiv.org/content/10.1101/807693v1)for an introduction, | ||
* [Read the docs](http://docs.auto-pi-lot.com) to get started, | ||
* [Visit the site](https://auto-pi-lot.com) for more. | ||
[Autopilot Development Todo](https://docs.auto-pi-lot.com/en/latest/todo.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#import core | ||
#import setup | ||
#import stim | ||
#import tasks | ||
#import viz | ||
__version__ = '0.3' | ||
__author__ = 'Jonny Saunders <[email protected]>' | ||
|
||
from autopilot import core | ||
from autopilot.tasks import Task | ||
from autopilot.setup import setup_autopilot |
Oops, something went wrong.