taskcheck 0.3.2__tar.gz → 0.3.2.post1__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/taskcheck.egg-info → taskcheck-0.3.2.post1}/PKG-INFO +1 -1
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/pyproject.toml +1 -1
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck/__main__.py +0 -1
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck/parallel.py +18 -9
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1/taskcheck.egg-info}/PKG-INFO +1 -1
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/LICENSE +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/README.md +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/setup.cfg +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck/common.py +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck/ical.py +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck/install.py +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck/report.py +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck.egg-info/SOURCES.txt +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck.egg-info/dependency_links.txt +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck.egg-info/entry_points.txt +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck.egg-info/requires.txt +0 -0
- {taskcheck-0.3.2 → taskcheck-0.3.2.post1}/taskcheck.egg-info/top_level.txt +0 -0
|
@@ -64,9 +64,7 @@ def compute_estimated_urgency(remaining_hours, urgency_coefficients):
|
|
|
64
64
|
key=lambda x: abs(pdth_to_hours(x) - remaining_hours),
|
|
65
65
|
)
|
|
66
66
|
coefficient = urgency_coefficients.estimated[closest_match]
|
|
67
|
-
|
|
68
|
-
estimated_urgency = coefficient * remaining_hours
|
|
69
|
-
return estimated_urgency
|
|
67
|
+
return coefficient
|
|
70
68
|
|
|
71
69
|
|
|
72
70
|
def check_tasks_parallel(config, verbose=False):
|
|
@@ -122,8 +120,8 @@ def initialize_task_info(tasks, time_maps, days_ahead, urgency_coefficients, cal
|
|
|
122
120
|
|
|
123
121
|
def allocate_time_for_day(task_info, day_offset, date, urgency_coefficients, verbose):
|
|
124
122
|
total_available_hours = compute_total_available_hours(task_info, day_offset)
|
|
125
|
-
if verbose:
|
|
126
|
-
|
|
123
|
+
# if verbose:
|
|
124
|
+
# print(f"Day {date}, total available hours: {total_available_hours:.2f}")
|
|
127
125
|
if total_available_hours <= 0:
|
|
128
126
|
return
|
|
129
127
|
|
|
@@ -134,7 +132,7 @@ def allocate_time_for_day(task_info, day_offset, date, urgency_coefficients, ver
|
|
|
134
132
|
recompute_urgencies(tasks_remaining, urgency_coefficients)
|
|
135
133
|
sorted_task_ids = sorted(
|
|
136
134
|
tasks_remaining.keys(),
|
|
137
|
-
key=lambda x:
|
|
135
|
+
key=lambda x: tasks_remaining[x]["urgency"],
|
|
138
136
|
reverse=True,
|
|
139
137
|
)
|
|
140
138
|
|
|
@@ -146,6 +144,17 @@ def allocate_time_for_day(task_info, day_offset, date, urgency_coefficients, ver
|
|
|
146
144
|
info = tasks_remaining[uuid]
|
|
147
145
|
if any(d in tasks_remaining for d in info["task"].get("depends", [])):
|
|
148
146
|
# cannot execute this task until all its dependencies are completed
|
|
147
|
+
if verbose:
|
|
148
|
+
print(
|
|
149
|
+
"Skipping task",
|
|
150
|
+
info["task"]["id"],
|
|
151
|
+
"due to dependency on:",
|
|
152
|
+
[
|
|
153
|
+
tasks_remaining[_d]["task"]["id"]
|
|
154
|
+
for _d in info["task"].get("depends", [])
|
|
155
|
+
if _d in tasks_remaining
|
|
156
|
+
],
|
|
157
|
+
)
|
|
149
158
|
continue
|
|
150
159
|
allocation = allocate_time_to_task(info, day_offset, day_remaining_hours)
|
|
151
160
|
if allocation > 0:
|
|
@@ -155,7 +164,7 @@ def allocate_time_for_day(task_info, day_offset, date, urgency_coefficients, ver
|
|
|
155
164
|
update_task_scheduling(info, allocation, date_str)
|
|
156
165
|
if verbose:
|
|
157
166
|
print(
|
|
158
|
-
f"Allocated {allocation:.2f} hours to task {info['task']['id']} on {date}"
|
|
167
|
+
f"Allocated {allocation:.2f} hours to task {info['task']['id']} on {date} with urgency {info['urgency']:.2f} and estimated-related urgency {info['estimated_urgency']:.2f}"
|
|
159
168
|
)
|
|
160
169
|
if (
|
|
161
170
|
info["remaining_hours"] <= 0
|
|
@@ -166,8 +175,8 @@ def allocate_time_for_day(task_info, day_offset, date, urgency_coefficients, ver
|
|
|
166
175
|
break
|
|
167
176
|
if not allocated:
|
|
168
177
|
break
|
|
169
|
-
if verbose and day_remaining_hours > 0:
|
|
170
|
-
|
|
178
|
+
# if verbose and day_remaining_hours > 0:
|
|
179
|
+
# print(f"Unused time on {date}: {day_remaining_hours:.2f} hours")
|
|
171
180
|
|
|
172
181
|
|
|
173
182
|
def compute_total_available_hours(task_info, day_offset):
|
|
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
|