Skip to content

Commit

Permalink
fix setting resource in hydra portfolio
Browse files Browse the repository at this point in the history
  • Loading branch information
kw-corne committed Aug 29, 2023
1 parent a366ee0 commit 4f94673
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions autoverify/portfolio/hydra/hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,17 @@ def _updater(
cfg = new_configs[0][0]
# ConfigSpace name is optional, but we require it to
# make a distinction between the different verifiers
assert cfg.config_space.name is not None
name = cfg.config_space.name
assert name is not None

cv = ConfiguredVerifier(cfg.config_space.name, cfg)
cv = ConfiguredVerifier(
name, cfg, self._ResourceTracker.deduct_by_name(name, mock=True)
)
if cv in pf:
logger.info(f"Config {cv} already in portfolio")
self._stop = True
return
if self._scenario.stop_early:
self._stop = True
return

pf.add(cv)

Expand All @@ -320,4 +324,4 @@ def _updater(
)

pf.update_costs(vbs_cost)
self._ResourceTracker.deduct_by_name(cfg.config_space.name)
self._ResourceTracker.deduct_by_name(name)

0 comments on commit 4f94673

Please sign in to comment.