<commit_before>import pytest

from bokeh.charts.stats import Bins
from bokeh.models import ColumnDataSource


@pytest.fixture
def ds(test_data):
    return ColumnDataSource(test_data.auto_data)


def test_explicit_bin_count(ds):
    b = Bins(source=ds, column='mpg', bin_count=2)
    assert len(b.bins) == 2


def test_auto_bin_count(ds):
    b = Bins(source=ds, column='mpg', bin_count=2)
    assert len(b.bins) == 2<commit_msg>Add auto binning test to stats.<commit_after>import pytest

from bokeh.charts.stats import Bins
from bokeh.models import ColumnDataSource


@pytest.fixture
def ds(test_data):
    return ColumnDataSource(test_data.auto_data)


def test_explicit_bin_count(ds):
    b = Bins(source=ds, column='mpg', bin_count=2)
    assert len(b.bins) == 2


def test_auto_bin_count(ds):
    b = Bins(source=ds, column='mpg')
    assert len(b.bins) == 12

{'fraction_non_alphanumeric': 0.11445086705202312, 'fraction_numerical': 0.009248554913294798, 'mean_word_length': 4.891156462585034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7368891', 'n_tokens_mistral': 333, 'n_tokens_neox': 319, 'n_words': 69}