Skip to content

Commit 8ece981

Browse files
committed
👔 Remove special characters from activity names
1 parent 41f9d50 commit 8ece981

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/mindlogger_data_export/outputs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ def _prepare_activity_columns(
422422
{
423423
col: self._normalize_column_name(f"{activity_prefix}_{col}")
424424
for col in df.columns
425+
if not col.endswith("")
425426
}
426427
)
427428

@@ -617,7 +618,8 @@ def _format(self, data: MindloggerData) -> list[NamedOutput]:
617618
# Format each activity for REDCap
618619
outputs = []
619620
for wide_output in wide_outputs:
620-
activity_name = wide_output.name
621+
activity_name = wide_output.name.translate({32: None, 45: None, 43: None})
622+
"""Output name without spaces, minuses, or pluses."""
621623
formatted_df = self._format_activity(wide_output.output, activity_name)
622624
outputs.append(NamedOutput(f"{activity_name}_redcap", formatted_df))
623625

0 commit comments

Comments
 (0)