Skip to content

Commit

Permalink
Add register function for eval experiments.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 533549209
  • Loading branch information
joshgreaves authored and JesseFarebro committed Jun 2, 2023
1 parent 7b29f6f commit b5ef4dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion putting_dune/experiments/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from putting_dune.experiments import experiments



# -------------------- AGENTS --------------------


Expand Down Expand Up @@ -369,6 +368,16 @@ def _get_human_prior_rates_config() -> experiments.SimulatorConfig:
)


def register_eval_experiment(
name: str, eval_experiment: experiments.EvalExperiment
):
global _EVAL_EXPERIMENTS
if name not in _EVAL_EXPERIMENTS:
_EVAL_EXPERIMENTS = frozendict.frozendict(
{name: eval_experiment, **_EVAL_EXPERIMENTS}
)


def create_microscope_experiment(name: str) -> experiments.MicroscopeExperiment:
if name not in _MICROSCOPE_EXPERIMENTS:
raise ValueError(f'Unknown microscope experiment {name}.')
Expand Down

0 comments on commit b5ef4dc

Please sign in to comment.