Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename cluster-exps to ab-lab #207

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cluster-experiments
pip install ab-lab
pip freeze
- name: Test with pytest
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- rename-ablab

jobs:
build-and-deploy:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
Clone repo and go to the project directory:

```bash
git clone [email protected]:david26694/cluster-experiments.git
cd cluster-experiments
git clone [email protected]:david26694/ab-lab.git
cd ab-lab
```

Create virtual environment and activate it:
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.PHONY: clean clean-test clean-pyc clean-build

black:
black cluster_experiments tests setup.py --check
black ab_lab tests setup.py --check

ruff:
ruff cluster_experiments tests setup.py
ruff ab_lab tests setup.py

test:
pytest --cov=./cluster_experiments
pytest --cov=./ab_lab

coverage_xml:
coverage xml
Expand Down Expand Up @@ -68,7 +68,7 @@ prep-dist: clean
uv build

pypi: prep-dist
twine upload --repository cluster-experiments dist/*
twine upload --repository ab-lab dist/*

pypi-gh-actions: prep-dist
# todo: fix this
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<img src="theme/icon-cluster.png" width=200 height=200 align="right">

# cluster_experiments
# ab_lab

[![Downloads](https://static.pepy.tech/badge/cluster-experiments)](https://pepy.tech/project/cluster-experiments)
[![PyPI](https://img.shields.io/pypi/v/cluster-experiments)](
https://pypi.org/project/cluster-experiments/)
[![Unit tests](https://github.com/david26694/cluster-experiments/workflows/Release%20unit%20Tests/badge.svg)](https://github.com/david26694/cluster-experiments/actions)
[![Downloads](https://static.pepy.tech/badge/ab-lab)](https://pepy.tech/project/cluster-experiments)
[![PyPI](https://img.shields.io/pypi/v/ab-lab)](
https://pypi.org/project/ab-lab/)
[![Unit tests](https://github.com/david26694/ab-lab/workflows/Release%20unit%20Tests/badge.svg)](https://github.com/david26694/ab-lab/actions)
[![CodeCov](
https://codecov.io/gh/david26694/cluster-experiments/branch/main/graph/badge.svg)](https://app.codecov.io/gh/david26694/cluster-experiments/)
![License](https://img.shields.io/github/license/david26694/cluster-experiments)
[![Pypi version](https://img.shields.io/pypi/pyversions/cluster-experiments.svg)](https://pypi.python.org/pypi/cluster-experiments)
https://codecov.io/gh/david26694/ab-lab/branch/main/graph/badge.svg)](https://app.codecov.io/gh/david26694/ab-lab/)
![License](https://img.shields.io/github/license/david26694/ab-lab)
[![Pypi version](https://img.shields.io/pypi/pyversions/ab-lab.svg)](https://pypi.python.org/pypi/ab-lab)

A Python library for end-to-end A/B testing workflows, featuring:
- Experiment analysis and scorecards
Expand Down Expand Up @@ -58,7 +58,7 @@ A Python library for end-to-end A/B testing workflows, featuring:
```python
import numpy as np
import pandas as pd
from cluster_experiments import PowerAnalysis, NormalPowerAnalysis
from ab_lab import PowerAnalysis, NormalPowerAnalysis

# Create sample data
N = 1_000
Expand Down Expand Up @@ -112,7 +112,7 @@ print(power, power_line_normal, power_normal, mde, mde_timeline)
```python
import numpy as np
import pandas as pd
from cluster_experiments import AnalysisPlan, SimpleMetric, Variant, Dimension
from ab_lab import AnalysisPlan, SimpleMetric, Variant, Dimension

N = 1_000
experiment_data = pd.DataFrame({
Expand Down Expand Up @@ -157,7 +157,7 @@ print(results.to_dataframe())
```python
import numpy as np
import pandas as pd
from cluster_experiments import (
from ab_lab import (
AnalysisPlan,
SimpleMetric,
Variant,
Expand Down Expand Up @@ -221,10 +221,10 @@ print(results.to_dataframe())
You can install this package via `pip`.

```bash
pip install cluster-experiments
pip install ab-lab
```

For detailed documentation and examples, visit our [documentation site](https://david26694.github.io/cluster-experiments/).
For detailed documentation and examples, visit our [documentation site](https://david26694.github.io/ab-lab/).

## Features

Expand Down
24 changes: 12 additions & 12 deletions cluster_experiments/__init__.py → ab_lab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from cluster_experiments.cupac import EmptyRegressor, TargetAggregation
from cluster_experiments.experiment_analysis import (
from ab_lab.cupac import EmptyRegressor, TargetAggregation
from ab_lab.experiment_analysis import (
ClusteredOLSAnalysis,
ExperimentAnalysis,
GeeExperimentAnalysis,
Expand All @@ -9,12 +9,12 @@
SyntheticControlAnalysis,
TTestClusteredAnalysis,
)
from cluster_experiments.inference.analysis_plan import AnalysisPlan
from cluster_experiments.inference.dimension import Dimension
from cluster_experiments.inference.hypothesis_test import HypothesisTest
from cluster_experiments.inference.metric import Metric, RatioMetric, SimpleMetric
from cluster_experiments.inference.variant import Variant
from cluster_experiments.perturbator import (
from ab_lab.inference.analysis_plan import AnalysisPlan
from ab_lab.inference.dimension import Dimension
from ab_lab.inference.hypothesis_test import HypothesisTest
from ab_lab.inference.metric import Metric, RatioMetric, SimpleMetric
from ab_lab.inference.variant import Variant
from ab_lab.perturbator import (
BetaRelativePerturbator,
BetaRelativePositivePerturbator,
BinaryPerturbator,
Expand All @@ -26,9 +26,9 @@
SegmentedBetaRelativePerturbator,
UniformPerturbator,
)
from cluster_experiments.power_analysis import NormalPowerAnalysis, PowerAnalysis
from cluster_experiments.power_config import PowerConfig
from cluster_experiments.random_splitter import (
from ab_lab.power_analysis import NormalPowerAnalysis, PowerAnalysis
from ab_lab.power_config import PowerConfig
from ab_lab.random_splitter import (
BalancedClusteredSplitter,
BalancedSwitchbackSplitter,
ClusteredSplitter,
Expand All @@ -40,7 +40,7 @@
StratifiedSwitchbackSplitter,
SwitchbackSplitter,
)
from cluster_experiments.washover import ConstantWashover, EmptyWashover, Washover
from ab_lab.washover import ConstantWashover, EmptyWashover, Washover

__all__ = [
"ExperimentAnalysis",
Expand Down
2 changes: 1 addition & 1 deletion cluster_experiments/cupac.py → ab_lab/cupac.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TargetAggregation(BaseEstimator):
Usage:
```python
import pandas as pd
from cluster_experiments.cupac import TargetAggregation
from ab_lab.cupac import TargetAggregation

df = pd.DataFrame({"agg_col": ["a", "a", "b", "b", "c", "c"], "target_col": [1, 2, 3, 4, 5, 6]})
new_df = pd.DataFrame({"agg_col": ["a", "a", "b", "b", "c", "c"]})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from pandas.api.types import is_numeric_dtype
from scipy.stats import ttest_ind, ttest_rel

from cluster_experiments.synthetic_control_utils import get_w
from cluster_experiments.utils import HypothesisEntries
from ab_lab.synthetic_control_utils import get_w
from ab_lab.utils import HypothesisEntries


@dataclass
Expand Down Expand Up @@ -279,7 +279,7 @@ class GeeExperimentAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import GeeExperimentAnalysis
from ab_lab.experiment_analysis import GeeExperimentAnalysis
import pandas as pd

df = pd.DataFrame({
Expand Down Expand Up @@ -426,7 +426,7 @@ class ClusteredOLSAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import ClusteredOLSAnalysis
from ab_lab.experiment_analysis import ClusteredOLSAnalysis
import pandas as pd

df = pd.DataFrame({
Expand Down Expand Up @@ -568,7 +568,7 @@ class TTestClusteredAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import TTestClusteredAnalysis
from ab_lab.experiment_analysis import TTestClusteredAnalysis
import pandas as pd

df = pd.DataFrame({
Expand Down Expand Up @@ -645,7 +645,7 @@ class PairedTTestClusteredAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import PairedTTestClusteredAnalysis
from ab_lab.experiment_analysis import PairedTTestClusteredAnalysis
import pandas as pd

df = pd.DataFrame({
Expand Down Expand Up @@ -764,7 +764,7 @@ class OLSAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import OLSAnalysis
from ab_lab.experiment_analysis import OLSAnalysis
import pandas as pd

df = pd.DataFrame({
Expand Down Expand Up @@ -908,7 +908,7 @@ class MLMExperimentAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import MLMExperimentAnalysis
from ab_lab.experiment_analysis import MLMExperimentAnalysis
import pandas as pd

df = pd.DataFrame({
Expand Down Expand Up @@ -1005,7 +1005,7 @@ class SyntheticControlAnalysis(ExperimentAnalysis):
Usage:

```python
from cluster_experiments.experiment_analysis import SyntheticControlAnalysis
from ab_lab.experiment_analysis import SyntheticControlAnalysis
import pandas as pd
import numpy as np
from itertools import product
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import pandas as pd

from cluster_experiments.experiment_analysis import ExperimentAnalysis
from cluster_experiments.inference.analysis_results import AnalysisPlanResults
from cluster_experiments.inference.dimension import Dimension
from cluster_experiments.inference.hypothesis_test import HypothesisTest
from cluster_experiments.inference.metric import Metric
from cluster_experiments.inference.variant import Variant
from ab_lab.experiment_analysis import ExperimentAnalysis
from ab_lab.inference.analysis_results import AnalysisPlanResults
from ab_lab.inference.dimension import Dimension
from ab_lab.inference.hypothesis_test import HypothesisTest
from ab_lab.inference.metric import Metric
from ab_lab.inference.variant import Variant

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import pandas as pd

from cluster_experiments.cupac import CupacHandler
from cluster_experiments.experiment_analysis import ExperimentAnalysis, InferenceResults
from cluster_experiments.inference.analysis_results import AnalysisPlanResults
from cluster_experiments.inference.dimension import DefaultDimension, Dimension
from cluster_experiments.inference.metric import Metric
from cluster_experiments.inference.variant import Variant
from cluster_experiments.power_config import analysis_mapping
from ab_lab.cupac import CupacHandler
from ab_lab.experiment_analysis import ExperimentAnalysis, InferenceResults
from ab_lab.inference.analysis_results import AnalysisPlanResults
from ab_lab.inference.dimension import DefaultDimension, Dimension
from ab_lab.inference.metric import Metric
from ab_lab.inference.variant import Variant
from ab_lab.power_config import analysis_mapping


class HypothesisTest:
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions cluster_experiments/perturbator.py → ab_lab/perturbator.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def perturbate(
Usage:

```python
from cluster_experiments.perturbator import ConstantPerturbator
from ab_lab.perturbator import ConstantPerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 2, 3], "treatment": ["A", "B", "A"]})
perturbator = ConstantPerturbator()
Expand Down Expand Up @@ -121,7 +121,7 @@ def perturbate(
Usage:

```python
from cluster_experiments.perturbator import UniformPerturbator
from ab_lab.perturbator import UniformPerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 2, 3], "treatment": ["A", "B", "A"]})
perturbator = UniformPerturbator()
Expand Down Expand Up @@ -186,7 +186,7 @@ def perturbate(
Usage:

```python
from cluster_experiments.perturbator import NormalPerturbator
from ab_lab.perturbator import NormalPerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 2, 3], "treatment": ["A", "B", "A"]})
perturbator = NormalPerturbator()
Expand Down Expand Up @@ -250,7 +250,7 @@ def perturbate(
"""
Usage:
```python
from cluster_experiments.perturbator import RelativePositivePerturbator
from ab_lab.perturbator import RelativePositivePerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 2, 3], "treatment": ["A", "B", "A"]})
perturbator = RelativePositivePerturbator()
Expand Down Expand Up @@ -354,7 +354,7 @@ def perturbate(
"""
Usage:
```python
from cluster_experiments.perturbator import BetaRelativePositivePerturbator
from ab_lab.perturbator import BetaRelativePositivePerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 2, 3], "treatment": ["A", "B", "A"]})
perturbator = BetaRelativePositivePerturbator()
Expand Down Expand Up @@ -478,7 +478,7 @@ def perturbate(
"""
Usage:
```python
from cluster_experiments.perturbator import BetaRelativePerturbator
from ab_lab.perturbator import BetaRelativePerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 2, 3], "treatment": ["A", "B", "A"]})
perturbator = BetaRelativePerturbator(range_min = -0.5, range_max = 2)
Expand Down Expand Up @@ -731,7 +731,7 @@ def perturbate(
Usage:

```python
from cluster_experiments.perturbator import BinaryPerturbator
from ab_lab.perturbator import BinaryPerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, 0, 1], "treatment": ["A", "B", "A"]})
perturbator = BinaryPerturbator()
Expand Down Expand Up @@ -776,7 +776,7 @@ def perturbate(
Usage:

```python
from cluster_experiments.perturbator import RelativeMixedPerturbator
from ab_lab.perturbator import RelativeMixedPerturbator
import pandas as pd
df = pd.DataFrame({"target": [1, -2, 3], "treatment": ["A", "B", "A"]})
perturbator = RelativeMixedPerturbator()
Expand Down
Loading
Loading