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:
- google calendar: https://github.com/LabNeuroCogDevel/LNCDcal.py
- qualtrics -
Qualtrics.py
schedule.py is in the path on the main LNCD server.
- connect to
rhea(via Mobaxterm/ssh) - run scheduler:
schedule.py
make installwill usepipenvto manage the python virtual environment.requirements.txtalso exists, but is currently (2021-11-30) only for travis CI.make testruns tests. see Testing section and Travis CI
for an example postgres database, see make lncddb_test (scripts/fake_db.bash creates lncddb_test DB with example data)
qtcreatorfor visualuifiles (designer.exewith anaconda on windows)- consider
__name == "__main__"tests for individual modules so they can be run indpenednetly withsys.argv(exampleCheckinVisit.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.
- python: https://www.anaconda.com/download/#windows (install as user, not system)
- python libaries/dependencies:anaconda navigator -> environments -> root play -> terminal
- upmc cert issue:
conda config --set ssl_verify False - version control:
conda install git - LNCDcal:
pip install --trusted-host github.com git+https://github.com/LabNeuroCogDevel/LNCDcal.py - sql:
conda install psycopg2pip install pyesql - gui:
conda install pyQt5
- upmc cert issue:
- app:
- anaconda navigator -> projects -> import -> from folder
20190712 - pyqt5 update issue, current fix pip install pyqt5==5.12.2
pyinstaller/pyinstaller#4293
There are two files needed but not in the repo. These carry google (gcal), qualtircs (api), and database authentication.
config.iniconfiguration settings (db info, qualtrics, cal info). Seeconfig.ini.example.*.p12gcal cred file for service account
use make test, same as pipenv run python -m pytest
- Depends on
pytest,pytest-qtandpytest-pgsql. seemake install(pipenv install --dev) - within
testsdirectory, but expects to be run at root directory (./sql/and./*pyfiles) - makes use of pytest autoloaded
conftest.pyto provided schema loading through shared test fixturecreate_db
qtbotw/lncdappfixture (defined intests/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.
- See
scripts/fake_db.bashto build a testing database. DBeaveris 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 action
Schema and triggers are in sql/ they mirror database building code (not public, ~/src/db/mdb_psql_clj/resources/sql/)
