EERF is a Django web app and some helper tools to manage and analyze evoked electrophysiological response data. The data can be analyzed in real-time and complex features can be extracted from the data to drive feedback.
- django-eerf is a python package containing my eerfapp Django web app and eerfhelper to facilitate use of this app outside of the web server context.
- eerfapp.sql Is some SQL to add some functionality when using non-Django API.
- eerfmatlab contains some tools for working with the data in Matlab (this is very outdated).
- standalone.py has some examples for how to interact with the data in Python without running a webserver.
- Install Django and all its dependencies. See INSTALL.md for how I setup my system.
- Install django-eerf
- Optional (mandatory if you will use the database backend outside the Django/Python context (e.g., Matlab ORM)): Additional SQL triggers to
- Automatically log a new entry or a change to subject_detail_value
- Automatically set the stop_time field of a datum to +1s for trials or +1 day for days/periods.
- Automatically set the number of a new datum to be the next integer greater than the latest for that subject/span_type.
- From shell/terminal, run
mysql -uroot expdb < eerfapp.sql
The web app, and especially its database backend, should now be installed.
See django-eerf.
See standalone.py for an example of how to load the data into Python without using a web server.
BCPyElectrophys should now be able to use this ORM.
e.g. Matlab
Note that I cannot currently get non-Django interfaces to do CASCADE ON DELETE. This is because Django creates foreign keys with a unique hash, and I cannot use custom SQL (e.g., via migrations) to access the key name, drop it, then add a new foreign key constraint with CASCADE ON DELETE set to on.
Thus, to delete using an API other than Django, you'll have to delete items in order so as not to violate foreign key constraints. For example, to delete a subject, you'll have to delete all of its data in this order:
DatumFeatureValue > DatumDetailValue > DatumStore > Datum > SubjectDetailValue > SubjectLog > Subject