taskcheck 0.3.2.post1__tar.gz → 0.3.2.post2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {taskcheck-0.3.2.post1/taskcheck.egg-info → taskcheck-0.3.2.post2}/PKG-INFO +5 -1
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/README.md +4 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/pyproject.toml +1 -1
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck/parallel.py +23 -9
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2/taskcheck.egg-info}/PKG-INFO +5 -1
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/LICENSE +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/setup.cfg +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck/__main__.py +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck/common.py +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck/ical.py +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck/install.py +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck/report.py +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck.egg-info/SOURCES.txt +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck.egg-info/dependency_links.txt +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck.egg-info/entry_points.txt +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck.egg-info/requires.txt +0 -0
- {taskcheck-0.3.2.post1 → taskcheck-0.3.2.post2}/taskcheck.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: taskcheck
|
|
3
|
-
Version: 0.3.2.
|
|
3
|
+
Version: 0.3.2.post2
|
|
4
4
|
Summary: Automatic scheduler for taskwarrior
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -144,3 +144,7 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
|
|
|
144
144
|
-i, --install: install taskcheck configuration
|
|
145
145
|
-r, --report: show tasks planned until a certain time
|
|
146
146
|
```
|
|
147
|
+
|
|
148
|
+
## TODO
|
|
149
|
+
|
|
150
|
+
- [ ] Consider due dates are nearer while planning in the future
|
|
@@ -131,3 +131,7 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
|
|
|
131
131
|
-i, --install: install taskcheck configuration
|
|
132
132
|
-r, --report: show tasks planned until a certain time
|
|
133
133
|
```
|
|
134
|
+
|
|
135
|
+
## TODO
|
|
136
|
+
|
|
137
|
+
- [ ] Consider due dates are nearer while planning in the future
|
|
@@ -80,10 +80,7 @@ def check_tasks_parallel(config, verbose=False):
|
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
for day_offset in range(days_ahead):
|
|
83
|
-
|
|
84
|
-
allocate_time_for_day(
|
|
85
|
-
task_info, day_offset, date, urgency_coefficients, verbose
|
|
86
|
-
)
|
|
83
|
+
allocate_time_for_day(task_info, day_offset, urgency_coefficients, verbose)
|
|
87
84
|
|
|
88
85
|
update_tasks_with_scheduling_info(task_info, verbose)
|
|
89
86
|
|
|
@@ -118,7 +115,8 @@ def initialize_task_info(tasks, time_maps, days_ahead, urgency_coefficients, cal
|
|
|
118
115
|
return task_info
|
|
119
116
|
|
|
120
117
|
|
|
121
|
-
def allocate_time_for_day(task_info, day_offset,
|
|
118
|
+
def allocate_time_for_day(task_info, day_offset, urgency_coefficients, verbose):
|
|
119
|
+
date = datetime.today().date() + timedelta(days=day_offset)
|
|
122
120
|
total_available_hours = compute_total_available_hours(task_info, day_offset)
|
|
123
121
|
# if verbose:
|
|
124
122
|
# print(f"Day {date}, total available hours: {total_available_hours:.2f}")
|
|
@@ -156,6 +154,12 @@ def allocate_time_for_day(task_info, day_offset, date, urgency_coefficients, ver
|
|
|
156
154
|
],
|
|
157
155
|
)
|
|
158
156
|
continue
|
|
157
|
+
|
|
158
|
+
wait = info["task"].get("wait")
|
|
159
|
+
if wait and date <= datetime.strptime(wait, "%Y%m%dT%H%M%SZ").date():
|
|
160
|
+
if verbose:
|
|
161
|
+
print(f"Skipping task {info['task']['id']} due to wait date {wait}")
|
|
162
|
+
continue
|
|
159
163
|
allocation = allocate_time_to_task(info, day_offset, day_remaining_hours)
|
|
160
164
|
if allocation > 0:
|
|
161
165
|
day_remaining_hours -= allocation
|
|
@@ -216,8 +220,17 @@ def recompute_urgencies(tasks_remaining, urgency_coefficients):
|
|
|
216
220
|
if started_by_scheduler and not started_by_user:
|
|
217
221
|
# If the task was started by the scheduler, apply the active task coefficient
|
|
218
222
|
info["urgency"] += urgency_coefficients.active
|
|
223
|
+
info["started"] = False
|
|
219
224
|
|
|
220
225
|
if urgency_coefficients.inherit:
|
|
226
|
+
# Build reverse dependencies mapping
|
|
227
|
+
reverse_deps = {} # Map from task_uuid to list of tasks that depend on it
|
|
228
|
+
for task_uuid, info in tasks_remaining.items():
|
|
229
|
+
for dep_uuid in info["task"].get("depends", []):
|
|
230
|
+
if dep_uuid not in reverse_deps:
|
|
231
|
+
reverse_deps[dep_uuid] = []
|
|
232
|
+
reverse_deps[dep_uuid].append(task_uuid)
|
|
233
|
+
|
|
221
234
|
# Define a recursive function to compute the maximum urgency
|
|
222
235
|
def get_max_urgency(info, visited):
|
|
223
236
|
task_uuid = info["task"]["uuid"]
|
|
@@ -226,8 +239,8 @@ def recompute_urgencies(tasks_remaining, urgency_coefficients):
|
|
|
226
239
|
# Start with the current task's urgency
|
|
227
240
|
urgency = info["urgency"]
|
|
228
241
|
visited[task_uuid] = urgency # Mark as visited
|
|
229
|
-
# Recursively compute urgencies of
|
|
230
|
-
for dep_uuid in
|
|
242
|
+
# Recursively compute urgencies of tasks that depend on this task
|
|
243
|
+
for dep_uuid in reverse_deps.get(task_uuid, []):
|
|
231
244
|
if dep_uuid in tasks_remaining:
|
|
232
245
|
dep_info = tasks_remaining[dep_uuid]
|
|
233
246
|
dep_urgency = get_max_urgency(dep_info, visited)
|
|
@@ -235,7 +248,7 @@ def recompute_urgencies(tasks_remaining, urgency_coefficients):
|
|
|
235
248
|
visited[task_uuid] = urgency # Update with the maximum urgency found
|
|
236
249
|
return urgency
|
|
237
250
|
|
|
238
|
-
# Update urgencies based on
|
|
251
|
+
# Update urgencies based on tasks that depend on them
|
|
239
252
|
for info in tasks_remaining.values():
|
|
240
253
|
visited = {} # Reset visited dictionary for each task
|
|
241
254
|
max_urgency = get_max_urgency(info, visited)
|
|
@@ -257,9 +270,10 @@ def allocate_time_to_task(info, day_offset, day_remaining_hours):
|
|
|
257
270
|
if allocation <= 0.05:
|
|
258
271
|
return 0
|
|
259
272
|
|
|
273
|
+
if info["remaining_hours"] == info["task"]["estimated"]:
|
|
274
|
+
info["started"] = True
|
|
260
275
|
info["remaining_hours"] -= allocation
|
|
261
276
|
info["task_time_map"][day_offset] -= allocation
|
|
262
|
-
info["started"] = True
|
|
263
277
|
|
|
264
278
|
return allocation
|
|
265
279
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: taskcheck
|
|
3
|
-
Version: 0.3.2.
|
|
3
|
+
Version: 0.3.2.post2
|
|
4
4
|
Summary: Automatic scheduler for taskwarrior
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -144,3 +144,7 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
|
|
|
144
144
|
-i, --install: install taskcheck configuration
|
|
145
145
|
-r, --report: show tasks planned until a certain time
|
|
146
146
|
```
|
|
147
|
+
|
|
148
|
+
## TODO
|
|
149
|
+
|
|
150
|
+
- [ ] Consider due dates are nearer while planning in the future
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|