<commit_before>from __future__ import absolute_import, division, print_function

import pytest
from datashape import discover, dshape
bcolz = pytest.importorskip('bcolz')

import numpy as np

from blaze.bcolz import into, chunks
from blaze.expr import Symbol
from blaze.compute.core import compute


b = bcolz.ctable([[1, 2, 3], [1., 2., 3.]],
                 names=['a', 'b'])

t = Symbol('t', 'var * {a: int32, b: float64}')


to = Symbol('to', 'var * {a: int32, b: float64}')
bo = bcolz.ctable([[1, 2, 3], [1., 2., np.nan]],
                  names=['a', 'b'])


def test_discover():
    assert discover(b) == dshape('3 * {a: int64, b: float64}')
    assert discover(b['a']) == dshape('3 * int64')<commit_msg>bcolz test specifies dtype explicitly<commit_after>from __future__ import absolute_import, division, print_function

import pytest
from datashape import discover, dshape
bcolz = pytest.importorskip('bcolz')

import numpy as np

from blaze.bcolz import into, chunks
from blaze.expr import Symbol
from blaze.compute.core import compute


b = bcolz.ctable([[1, 2, 3], [1., 2., 3.]],
                 names=['a', 'b'])

t = Symbol('t', 'var * {a: int32, b: float64}')


to = Symbol('to', 'var * {a: int32, b: float64}')
bo = bcolz.ctable(np.array([(1, 1.), (2, 2.), (3, np.nan)],
                           dtype=[('a', 'i8'), ('b', 'f8')]))


def test_discover():
    assert discover(b) == dshape('3 * {a: int64, b: float64}')
    assert discover(b['a']) == dshape('3 * int64')
{'fraction_non_alphanumeric': 0.183591123066577, 'fraction_numerical': 0.03765971755211836, 'mean_word_length': 3.606811145510836, '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': '4926654', 'n_tokens_mistral': 578, 'n_tokens_neox': 544, 'n_words': 159}