neuralset.events.study.SpecialLoader

class neuralset.events.study.SpecialLoader(method: Callable[[...], Any], timeline: dict[str, Any], **kwargs: Any)[source][source]

Loader for special methods that need to be serialized and called later.

Parameters:
  • method (method) – method to use for loading

  • timeline (dict[str, Any]) – parameters defining the timeline (subject, task etc)

  • **kwargs (Any) – any additional (json-able) parameters used to call the method

Example

In _load_timeline_events:

loader = SpecialLoader(method=self._my_method, timeline=timeline, additional_param=...)

In the method:

def _my_method(self, timeline: dict[str, tp.Any], additional_param):
    ...
specs() dict[str, list[str]][source][source]

Extract configurable parameters from the method’s Literal type hints.

Returns a dict mapping parameter names to their allowed values, e.g. {"registration": ["msmall", "none", "mni"], ...}.

specs_json() str[source][source]

JSON string of specs(), suitable for a DataFrame column.