Skip to content

Commit

Permalink
Merge pull request #6 from VyperCore/default-apply-goals
Browse files Browse the repository at this point in the history
default apply goals when only default goal
  • Loading branch information
Alldred authored Nov 17, 2023
2 parents 85674dc + 5e7cb44 commit 761a391
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fcov/coverpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __init__(self, name: str, description: str, trigger=None):
self.setup(ctx=CoverageContext.get())

self.axis_names = [x.name for x in self.axes]
# TODO Check if goalsDict only has 1 entry
goals = SimpleNamespace(**self._goal_dict)
for cursor in self.all_axis_value_combinations():
bucket = SimpleNamespace(**dict(zip(self.axis_names, cursor, strict=True)))
Expand Down Expand Up @@ -79,7 +78,8 @@ def add_goal(self, name, amount, description):
self._goal_dict[formatted_name] = GoalItem(name, amount, description)

def apply_goals(self, bucket=None, goals=None):
# This should be implemented by the coverpoint when requried
if len(self._goal_dict) == 1:
return self._goal_dict["DEFAULT"]
raise NotImplementedError("This needs to be implemented by the coverpoint")

def sample():
Expand Down

0 comments on commit 761a391

Please sign in to comment.