From a16e50063e41d7613438da58ffe7b637ce67409f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Thu, 20 Jun 2024 18:44:13 -0400 Subject: [PATCH] Trim whitespace from final project/subproject i had 'HW ' come in as a complete surprise not-converted-to-HousingWorks 'unknown' entry. --- pomodoro_to_harvest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pomodoro_to_harvest.py b/pomodoro_to_harvest.py index f29ea82..102a9b1 100644 --- a/pomodoro_to_harvest.py +++ b/pomodoro_to_harvest.py @@ -165,6 +165,10 @@ for preferred, alternatives in compound_project_tasks.items(): timelog['subproject'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[1], None)) timelog['project'] = (np.where(timelog['project'].str.contains(' — '), timelog['project'].str.split(' — ', n=1).str[0], timelog['project'])) +# Trim any surrounding whitespace from final project and sub-project/task. +timelog['subproject'] = timelog['subproject'].str.strip() +timelog['project'] = timelog['project'].str.strip() + # Replace irregular-but-known project names with ones timetracking tools use. harvest_project_names = { "Everyday AI Project": ["EverydayAI", "MIT Scheller Teacher Education Program (STEP) Lab", "Education Arcade", "Everyday AI", "Everday AI", "EA"],