Skip to content

Commit

Permalink
Fix some issues with Problems
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Aug 15, 2024
1 parent 1e598ab commit f284faf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
8 changes: 4 additions & 4 deletions estimage/problems/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ReasonableOutdated(ProblemCategory):
name = "reasonable_outdated"
summary = "Likely Outdated Estimates"
description = "Current estimate is inconsistent with children tasks, but lower than their nominal size and greater than the size of tasks not yet completed."
solution = solutions.SolutionByUpdatingSelf
solution = solutions.SolutionByUpdatingSelfDueChildren
weight = 20

required_tags = frozenset([
Expand All @@ -99,7 +99,7 @@ class SuppliedInput(ProblemCategory):
name = "supplied_input"
summary = "Estimated in Estimagus"
description = "The task has been estimated in Estimagus, which overrides the different estimate in the tracker."
solution = solutions.SolutionByUpdatingSelf
solution = solutions.SolutionByUpdatingSelfDueTracker
weight = 10

required_tags = set([
Expand Down Expand Up @@ -127,7 +127,7 @@ class UnestimatedParent(ProblemCategory):
name = "unestimated_parent"
summary = "Unestimated Parent"
description = "Task with children has no size estimated, while children have estimates."
solution = solutions.SolutionByUpdatingSelf
solution = solutions.SolutionByUpdatingSelfDueChildren
weight = 15

required_tags = set([
Expand All @@ -140,7 +140,7 @@ class UnestimatedParent(ProblemCategory):
class GenericInconsistent(ProblemCategory):
name = "generic_inconsistent"
summary = "Generic Inconsistency"
solution = solutions.SolutionByUpdatingSelf
solution = solutions.SolutionByUpdatingSelfDueChildren
weight = 80

required_tags = frozenset(["inconsistent_estimate"])
Expand Down
18 changes: 16 additions & 2 deletions estimage/problems/solutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,29 @@ def solve(self, card, synchro, io_cls):

class SolutionByUpdatingSelf(SolutionByUpdating):
action = "update_points"
description = "Update the respective card, so it is consistent with its children"
description = "Update the respective card, so it is consistent"
solvable = True

def __init__(self, problem: Problem):
super().__init__(problem)
self.updates_model = False

def describe(self):
return f"Update the record of '{self.card_name}', so it matches records of its children."
return f"Update the record of '{self.card_name}'."

def solve(self, card, synchro, io_cls):
synchro.set_tracker_points_of(card, self.problem.value_expected, io_cls)


class SolutionByUpdatingSelfDueTracker(SolutionByUpdatingSelf):
description = "Update the respective card, so it is consistent with the Estimagus estimate"

def describe(self):
return f"Update the record of '{self.card_name}', so it matches the Estimagus estimate."


class SolutionByUpdatingSelfDueChildren(SolutionByUpdatingSelf):
description = "Update the respective card, so it is consistent with its children"

def describe(self):
return f"Update the record of '{self.card_name}', so it matches records of its children."
4 changes: 2 additions & 2 deletions estimage/webapp/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class PollsterRouter(UserRouter):
def __init__(self, ** kwargs):
super().__init__(** kwargs)

self.private_pollster = simpledata.AuthoritativePollster()
self.global_pollster = simpledata.UserPollster(self.user_id)
self.global_pollster = simpledata.AuthoritativePollster()
self.private_pollster = simpledata.UserPollster(self.user_id)
self.pollsters_as_dict = collections.OrderedDict()
self.pollsters_as_dict["global"] = self.global_pollster
self.pollsters_as_dict["private"] = self.private_pollster
Expand Down

0 comments on commit f284faf

Please sign in to comment.