Skip to content

About

Jupyter book to go along with Data Science for Psych & Neuro

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Data Explorations

An R-based Jupyter Book on scientific data analysis in psychology and neuroscience.

The active curriculum is book/_toc.yml. Earlier slide PDFs and videos are retained unchanged; the written chapters and practical material are the revised teaching reference. Files outside the active TOC, including .old notebooks and TOC backups, are historical and are not built or executed.

Build and verify

Use Python 3.11 and R 4.2 or newer. Create a virtual environment, then install the fully resolved Python environment:

python3.11 -m venv .venv
.venv/bin/python -m pip install -r requirements-build.lock.txt
.venv/bin/python -m pip check
Rscript scripts/setup_r.R
make build

make defaults to .venv/bin/python, regardless of the active shell or Conda environment. An explicit PYTHON=/path/to/python override is available for another prepared build environment.

setup_r.R installs declared R packages into the active R library if missing and registers IRkernel in the project virtual environment. Set JUPYTER_PREFIX to another virtual-environment path if needed. Setup does not run during a lesson or build. The root renv.lock records versions used for verification; install renv and call renv::restore() to reproduce those R package versions. R itself and system libraries must be provisioned separately. See VALIDATION.md for the tested environment and results.

make check validates the active TOC, notebook schemas, and local source links. make execute prepares an internal working copy under build/work/book and executes worked notebooks and foundations in fresh R kernels. Exercises remain unexecuted assignments. Source notebook outputs remain empty; the working copy holds verified execution outputs and the execution manifest.

make build renders a fresh site, checks warnings and local links, then replaces book/_build. The one canonical HTML entry point is book/_build/html/index.html. Publish the contents of book/_build/html using your GitHub Pages publishing workflow. The build does not commit or push anything. Generated HTML is not ignored by Git, consistent with this repository's existing tracked HTML files; the staging files and execution cache are ignored.

A failed render leaves the previous successful site intact. A successful render replaces the generated output completely so removed pages and outdated notebook downloads cannot linger. WORK_DIR can override the internal execution-cache location; it does not change the public output path. Use make build for the full workflow: running Jupyter Book directly on the unexecuted source notebooks skips the notebook-execution step.

Teaching structure

  • 27 chapters, each with a question-led investigation, discussion, and independent exercise.
  • Optional R/functions, matrix, and calculus foundations.
  • Shared reporting and assessment rubric.
  • Offline annotation-audit and modern-model-comparison labs.
  • Synthetic recurring lexical-decision data, with optional bundled lexical/HCP data extensions.

The revision and scope are documented in REVISION_NOTES.md. Data in book/exercises/lexDat and book/exercises/hcp_data are retained; consult their original provenance and access conditions before redistribution or external AI use.

Troubleshooting dependency warnings

If pip reports that pandas, pyannote, torchmetrics, or other unrelated packages require a missing NumPy, check which interpreter is being used. Run .venv/bin/python -m pip check for the book environment. Bare pip and python may refer to a shared Conda environment instead. Use the explicit setup commands above and make build from the repository root.

The book's R-based lessons do not require NumPy in the Python build environment. Adding NumPy to the book requirements does not repair an unrelated shared environment. A warning about an invalid ~umpy distribution indicates a separate installation problem in that environment; repairing it requires inspecting its own package constraints.

Notebook links in the compiled book

The HTML notebook download uses the same local notebook content as the rendered page. Colab and Binder launch buttons are disabled because the revised local sources have not been published to the configured GitHub branch. Enable those buttons only after publishing matching notebooks and their supporting files. For local execution, use notebooks inside book/notebooks (or the executed copy in build/work/book/notebooks); a standalone downloaded notebook may also need book/R/course.R and any referenced data in their relative locations.

About

Jupyter book to go along with Data Science for Psych & Neuro

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages