From 47e29b71f53a38e0c756f2a65e0232d53f8f9e66 Mon Sep 17 00:00:00 2001 From: "Daniel G. Krakowczyk" Date: Fri, 1 Sep 2023 14:56:59 +0200 Subject: [PATCH] fix: Fix broken load method (#489) --- src/pymovements/dataset/dataset_definition.py | 5 ----- src/pymovements/dataset/dataset_files.py | 2 ++ src/pymovements/datasets/gazebase.py | 6 +++++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pymovements/dataset/dataset_definition.py b/src/pymovements/dataset/dataset_definition.py index bf01bd9f9..272f90390 100644 --- a/src/pymovements/dataset/dataset_definition.py +++ b/src/pymovements/dataset/dataset_definition.py @@ -85,8 +85,3 @@ class DatasetDefinition: position_columns: list[str] | None = None velocity_columns: list[str] | None = None acceleration_columns: list[str] | None = None - - def __post_init__(self) -> None: - if len(self.column_map) > 0: - self.custom_read_kwargs['columns'] = list(self.column_map.keys()) - self.custom_read_kwargs['new_columns'] = list(self.column_map.values()) diff --git a/src/pymovements/dataset/dataset_files.py b/src/pymovements/dataset/dataset_files.py index cf2ba4a9c..24a7be514 100644 --- a/src/pymovements/dataset/dataset_files.py +++ b/src/pymovements/dataset/dataset_files.py @@ -213,6 +213,8 @@ def load_gaze_files( custom_read_kwargs=definition.custom_read_kwargs, ) + gaze_data = gaze_data.rename(definition.column_map) + # Add fileinfo columns to dataframe. gaze_data = add_fileinfo( definition=definition, diff --git a/src/pymovements/datasets/gazebase.py b/src/pymovements/datasets/gazebase.py index 7481b77bb..da74cf8ac 100644 --- a/src/pymovements/datasets/gazebase.py +++ b/src/pymovements/datasets/gazebase.py @@ -153,4 +153,8 @@ class GazeBase(DatasetDefinition): }, ) - custom_read_kwargs: dict[str, Any] = field(default_factory=dict) + custom_read_kwargs: dict[str, Any] = field( + default_factory=lambda: { + 'null_values': 'NaN', + }, + )