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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcheck
3
- Version: 0.3.2
3
+ Version: 0.3.2.post1
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "taskcheck"
3
- version = "0.3.2"
3
+ version = "0.3.2-1"
4
4
  description = "Automatic scheduler for taskwarrior"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -2,7 +2,6 @@ import tomllib
2
2
  import argparse
3
3
 
4
4
  from taskcheck.parallel import check_tasks_parallel
5
- from taskcheck.sequential import check_tasks_sequentially
6
5
  from taskcheck.common import config_dir
7
6
 
8
7
  arg_parser = argparse.ArgumentParser()
@@ -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
- # Compute the urgency
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
- print(f"Day {date}, total available hours: {total_available_hours:.2f}")
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: (tasks_remaining[x]["urgency"], 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
- print(f"Unused time on {date}: {day_remaining_hours:.2f} hours")
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcheck
3
- Version: 0.3.2
3
+ Version: 0.3.2.post1
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
File without changes
File without changes
File without changes