Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update docstring of didec dataset definition #822

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
32 changes: 30 additions & 2 deletions src/pymovements/datasets/didec.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class DIDEC(DatasetDefinition):
name: str
The name of the dataset.
has_files: dict[str, bool]
Indicate whether the dataset contains 'gaze', 'precomputed_events', and
'precomputed_reading_measures'.
mirrors: dict[str, tuple[str, ...]]
A tuple of mirrors of the dataset. Each entry must be of type `str` and end with a '/'.
Expand All @@ -59,6 +63,9 @@ class DIDEC(DatasetDefinition):
experiment: Experiment
The experiment definition.
extract: dict[str, bool]
Decide whether to extract the data.
filename_format: dict[str, str]
Regular expression which will be matched before trying to load the file. Namedgroups will
appear in the `fileinfo` dataframe.
Expand All @@ -67,6 +74,27 @@ class DIDEC(DatasetDefinition):
If named groups are present in the `filename_format`, this makes it possible to cast
specific named groups to a particular datatype.
trial_columns: list[str]
The name of the trial columns in the input data frame. If the list is empty or None,
the input data frame is assumed to contain only one trial. If the list is not empty,
the input data frame is assumed to contain multiple trials and the transformation
methods will be applied to each trial separately.
time_column: str
The name of the timestamp column in the input data frame. This column will be renamed to
``time``.
time_unit: str
The unit of the timestamps in the timestamp column in the input data frame. Supported
units are 's' for seconds, 'ms' for milliseconds and 'step' for steps. If the unit is
'step' the experiment definition must be specified. All timestamps will be converted to
milliseconds.
pixel_columns: list[str]
The name of the pixel position columns in the input data frame. These columns will be
nested into the column ``pixel``. If the list is empty or None, the nested ``pixel``
column will not be created.
column_map: dict[str, str]
The keys are the columns to read, the values are the names to which they should be renamed.
Expand Down Expand Up @@ -122,8 +150,6 @@ class DIDEC(DatasetDefinition):
},
)

extract: dict[str, bool] = field(default_factory=lambda: {'gaze': True})

experiment: Experiment = Experiment(
screen_width_px=1680,
screen_height_px=1050,
Expand All @@ -134,6 +160,8 @@ class DIDEC(DatasetDefinition):
sampling_rate=1000,
)

extract: dict[str, bool] = field(default_factory=lambda: {'gaze': True})

filename_format: dict[str, str] = field(
default_factory=lambda: {
'gaze':
Expand Down
Loading