You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor branch is authoritative — conflicts resolved in favor of refactor.
Brings in the public pnpl package refactor (mixin-based architecture, task-
based dataset, compat wrappers) plus the preload_h5 option lifted onto the
shared ContinuousH5Mixin (supersedes fa8f92c).
Copy file name to clipboardExpand all lines: README.md
+21-29Lines changed: 21 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
> The current primary use of the PNPL library is for the LibriBrain competition. [Click here](https://neural-processing-lab.github.io/2025-libribrain-competition/) to learn more and get started!
4
4
5
-
Welcome to PNPL — a Python toolkit for loading and processing brain datasets for deep learning. It provides ready‑to‑use dataset classes (PyTorch `Dataset`) and utilities with a simple, consistent API.
5
+
Welcome to PNPL — a Python toolkit for loading and processing brain datasets for deep learning. The package ships the LibriBrain 2025 dataset family plus shared preprocessing and task utilities.
6
6
7
7
## Features
8
8
- Friendly dataset APIs backed by real MEG recordings
@@ -16,45 +16,37 @@ Welcome to PNPL — a Python toolkit for loading and processing brain datasets f
16
16
pip install pnpl
17
17
```
18
18
19
-
This will also take care of all requirements.
19
+
This installs the package and its core dependencies.
20
20
21
21
## Usage
22
-
The core functionality of the library is contained in the two Dataset classes `LibriBrainSpeech` and `LibriBrainPhoneme`.
23
-
Check out the basic usage:
22
+
A common entry point uses a task object:
24
23
25
-
### LibriBrainSpeech
26
-
This wraps the LibriBrain dataset for use in speech detection problems.
27
24
```python
28
-
from pnpl.datasets import LibriBrainSpeech
25
+
from pnpl.datasets import LibriBrain
26
+
from pnpl.tasks import SpeechDetection
29
27
30
-
speech_example_data = LibriBrainSpeech(
31
-
data_path="./data/",
32
-
include_run_keys= [("0","1","Sherlock1","1")]
28
+
dataset = LibriBrain(
29
+
data_path="./data/LibriBrain",
30
+
task=SpeechDetection(tmin=0.0, tmax=0.5),
31
+
partition="train",
33
32
)
34
33
35
-
sample_data, label = speech_example_data[0]
36
-
37
-
# Print out some basic info about the sample
38
-
print("Sample data shape:", sample_data.shape)
39
-
print("Label shape:", label.shape)
34
+
sample_data, label = dataset[0]
35
+
print(sample_data.shape, label.shape)
40
36
```
41
37
42
-
### LibriBrainSpeech
43
-
This wraps the LibriBrain dataset for use in phoneme classification problems.
44
-
```python
45
-
from pnpl.datasets import LibriBrainPhoneme
38
+
Dataset-specific wrapper classes are also available:
46
39
47
-
phoneme_example_data = LibriBrainPhoneme(
48
-
data_path="./data/",
49
-
include_run_keys= [("0","1","Sherlock1","1")]
50
-
)
51
-
sample_data, label = phoneme_example_data[0]
40
+
```python
41
+
from pnpl.datasets import LibriBrainSpeech, LibriBrainPhoneme
Copy file name to clipboardExpand all lines: docs/_build/html/_sources/install.md
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,11 @@ pip install pnpl
12
12
13
13
Core scientific dependencies include `numpy`, `pandas`, `torch`, `h5py`, `mne`, `mne_bids`, and `huggingface_hub`.
14
14
15
-
```{tip}
16
-
To use private/internal datasets as part of the same `pnpl` namespace, also install the overlay package `pnpl-internal` from your private index (or editable checkout). The overlay depends on `pnpl` and contributes additional modules under `pnpl.*`.
<p>To use private/internal datasets as part of the same <codeclass="docutils literal notranslate"><spanclass="pre">pnpl</span></code> namespace, also install the overlay package <codeclass="docutils literal notranslate"><spanclass="pre">pnpl-internal</span></code> from your private index (or editable checkout). The overlay depends on <codeclass="docutils literal notranslate"><spanclass="pre">pnpl</span></code> and contributes additional modules under <codeclass="docutils literal notranslate"><spanclass="pre">pnpl.*</span></code>.</p>
376
-
</div>
377
373
<sectionid="development-install-editable">
378
374
<h2>Development install (editable)<aclass="headerlink" href="#development-install-editable" title="Link to this heading">#</a></h2>
Copy file name to clipboardExpand all lines: docs/index.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: PNPL
7
7
PNPL is a friendly Python toolkit for loading and processing brain datasets for deep learning. It ships with ready‑to‑use dataset classes (PyTorch `Dataset`) and simple utilities so you can focus on modeling, not file plumbing.
Copy file name to clipboardExpand all lines: docs/install.md
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,11 @@ pip install pnpl
12
12
13
13
Core scientific dependencies include `numpy`, `pandas`, `torch`, `h5py`, `mne`, `mne_bids`, and `huggingface_hub`.
14
14
15
-
```{tip}
16
-
To use private/internal datasets as part of the same `pnpl` namespace, also install the overlay package `pnpl-internal` from your private index (or editable checkout). The overlay depends on `pnpl` and contributes additional modules under `pnpl.*`.
0 commit comments