Skip to content

Commit

Permalink
fix: Fix broken load method (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrako authored Sep 1, 2023
1 parent efe6057 commit 47e29b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/pymovements/dataset/dataset_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
2 changes: 2 additions & 0 deletions src/pymovements/dataset/dataset_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/pymovements/datasets/gazebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
)

0 comments on commit 47e29b7

Please sign in to comment.