Schedule and record visits to the Laboratory of NeuroCognitive Development.
This is unlikely to be too useful to the world at large. Integrations are specific to the lab's tools (gcal, qualtrics) and firewall. The database schema is tied to internal organization of multimodal experiments with human participates.
Instead see components:
Qualtrics.py
schedule.py is in the path on the main LNCD server.
rhea
(via Mobaxterm/ssh)schedule.py
make install
will use pipenv
to manage the python virtual environment. requirements.txt
also exists, but is currently (2021-11-30) only for travis CI.make test
runs tests. see Testing section and Travis CIfor an example postgres database, see make lncddb_test
(scripts/fake_db.bash
creates lncddb_test
DB with example data)
qtcreator
for visual ui
files (designer.exe
with anaconda on windows)__name == "__main__"
tests for individual modules so they can be run indpenednetly with sys.argv
(example CheckinVisit.py
)hook | runs | script |
---|---|---|
commit | black |
scripts/pre-commit |
push | pytest w/optional Xvfb | scripts/pre-push |
Hooks are installed by by make install
(ln -s $(pwd)/scripts/pre-* .git/hooks/
).
They can be ingored using git push --no-verify
Use anaconda to manage python and the dependencies.
conda config --set ssl_verify False
conda install git
pip install --trusted-host github.com git+https://github.com/LabNeuroCogDevel/LNCDcal.py
conda install psycopg2
pip install pyesql
conda install pyQt5
20190712 - pyqt5 update issue, current fix pip install pyqt5==5.12.2
https://github.com/pyinstaller/pyinstaller/issues/4293
There are two files needed but not in the repo. These carry google (gcal), qualtircs (api), and database authentication.
config.ini
configuration settings (db info, qualtrics, cal info). See config.ini.example
.*.p12
gcal cred file for service accountuse make test
, same as pipenv run python -m pytest
pytest
, pytest-qt
and pytest-pgsql
. see make install
(pipenv install --dev
)tests
directory, but expects to be run at root directory (./sql/
and ./*py
files)conftest.py
to provided schema loading through shared test fixture create_db
qtbot
w/lncdapp
fixture (defined in tests/conftest.py
)create_db
fixture in tests/conftest.py
uses transacted_postgresql_db
from pytest-pgsql
. This creates a mocked database using the same sql/*csv
files with which scripts/fake_db.bash
creates an actual testing postgres dblncddb_test
.
scripts/fake_db.bash
to build a testing database. DBeaver
is an excellent tool to visually explore.Visit has some confusing views (with triggers):
visits_view
: json columns full info for visit, no drop infovisits_summary
: most recent note (+ drop values) and actionSchema and triggers are in sql/
they mirror database building code (not public, ~/src/db/mdb_psql_clj/resources/sql/
)