Skip to content

Support nested experiment/namespace base on PlanOut

License

Notifications You must be signed in to change notification settings

xiachufang/outplan

Repository files navigation

outplan

Build Status GitHub

Support nested experiment/namespace base on PlanOut

Install

pip install outplan

Usage

from outplan import NamespaceItem, ExperimentItem, GroupItem, ExperimentGroupClient

SimpleNamespace = NamespaceItem(
    name="namespace_1",
    bucket=10,
    experiment_items=[
        ExperimentItem(
            name="exp_1",
            bucket=10,
            group_items=[
                GroupItem(name="a", weight=0.5),
                GroupItem(name="b", weight=0.5),
            ]
        ),
    ]
)

client = ExperimentGroupClient([SimpleNamespace])

print(client.get_group("namespace_1", unit="your_unit"))


# nested experiment/namespace is defined at `tests/test_experiment.py`

Dev

# install deps (once)
pip install -e .[test]

# run test
make test

# commit
pip install pre-commit
# and commit here