Split out subproject

This commit is contained in:
benjamin melançon 2021-06-01 16:43:57 -04:00
parent 960008bdae
commit ab951f5b86

View file

@ -141,6 +141,11 @@ for preferred, alternatives in replacement_project_names.items():
alternatives = [item.lower() for item in alternatives] alternatives = [item.lower() for item in alternatives]
timelog.loc[timelog.project.str.lower().isin(alternatives), "project"] = preferred timelog.loc[timelog.project.str.lower().isin(alternatives), "project"] = preferred
# If a compound project was specified, break that out into a sub-project (in
# Harvest, we use Task, which is really task type, for this.
timelog['subproject'] = (np.where(timelog['project'].str.contains(': '), timelog['project'].str.split(': ', 1).str[1], None))
timelog['project'] = (np.where(timelog['project'].str.contains(': '), timelog['description'].str.split(': ', 1).str[0], timelog['description']))
# Condense duplicate entries by date, summing the minutes spent, and listing # Condense duplicate entries by date, summing the minutes spent, and listing
# the first started and last recorded times for each task. # the first started and last recorded times for each task.
# The fillna is essential or we drop entries with blank ('None') projects. # The fillna is essential or we drop entries with blank ('None') projects.