neuralset.events.study.Study¶
- pydantic model neuralset.events.study.Study[source][source]¶
Interface to an external dataset: loads events from raw recordings.
Subclass
Studyto create an interface to a new dataset. Overrideiter_timelines()to enumerate timelines and_load_timeline_events()to load events for each one.- Parameters:
path (Path) – Root directory for the study data. All studies can use the same
path(e.g.path="/data"): each study automatically resolves its own subfolder (e.g./data/MyStudy), so you only need to configure one path for your entire data store.timelines (TimelineLoader) – Per-timeline loader;
timelines.infrasets how loads are dispatched and cached (default: a process pool). Disable the pool viainfra=None(inline, uncached) orinfra.derive("Cached")(cached, in-process).version (str) – Cache-busting key kept in the uid; bump when loading logic changes.
query (Query or None) – Optional filter applied after loading (e.g.
"timeline_index < 5").
Examples
# Direct instantiation: study = MyStudy(path="/data/studies") # path auto-resolves to /data/studies/MyStudy if that subfolder exists events = study.run() # By name (auto-imports the study class): study = Study(name="MyStudy", path="/data/studies") events = study.run()
Note
Studies reference third-party datasets that are subject to their own licenses. You may have other legal obligations or restrictions that govern your use of that content. Check each study’s
licenceandurlattributes for details.- Fields:
- field timelines: TimelineLoader = TimelineLoader(** { 'infra': { 'backend': 'ProcessPool', 'folder': None, 'keep_in_ram': True, 'max_jobs': 128, 'mode': 'cached'}, 'name': 'TimelineLoader'} )[source]¶
- classmethod catalog() dict[str, Type[Study]][source][source]¶
All registered Study subclasses, keyed by name.
Triggers lazy imports so that studies from all installed packages (e.g. neuralfetch) are discovered.
- classmethod neuro_types() frozenset[str][source][source]¶
Neural recording event types from
_info, empty if_infois not set.
- branches(item: Any) list[dict[str, Any]][source][source]¶
Query-selected timeline dicts to load, one per branch (
itemis unused).
- take(item: Any, branch: dict[str, Any]) DataFrame[source][source]¶
The body’s input for one branch (required; e.g.
item[branch]).Called once per branch, lazily where the body consumes it – in-worker when the body runs off-process.
- study_summary(apply_query: bool = True) DataFrame[source][source]¶
Returns a dataframe with 1 row per timeline and study attributes as columns.
queryparameter is used on this dataframe for subselectionParameter¶
- apply_query: bool
if False returns the full summary, otherwise filter it according to the query
Virtual query columns¶
The following columns are not present in the returned DataFrame but are auto-generated by
query_with_index()whenapply_query=Trueand thequerystring references them:subject_index: intthe index of the subject in the study
timeline_index: intthe index of the timeline in the study (equivalent to “index”)
subject_timeline_index: intthe index of the timeline among a subject’s timelines in the study (used for querying at most
ntimelines per subjects)