651346e6d36fcd7c3bece2187aea9dfd498136cf,tests/test_cgpm.py,,test_unknown_stattype,#,305
Before Change
except ImportError:
pytest.skip("no sklearn")
return
with bayesdb_open(":memory:") as bdb:
bdb.sql_execute("""
CREATE TABLE satellites_ucs (
apogee,
class_of_orbit,
country_of_operator,
launch_mass,
perigee,
period,
relaunches
)""")
for l, f in [
("geo", lambda x, y: x + y**2),
("leo", lambda x, y: math.sin(x + y)),
(None, lambda x, y: x + y**2),
(None, lambda x, y: math.sin(x + y)),
]:
for x in xrange(5):
for y in xrange(5):
countries = ["US", "Russia", "China", "Bulgaria"]
country = countries[bdb._np_prng.randint(0, len(countries))]
mass = bdb._np_prng.normal(1000, 50)
bdb.sql_execute("""
INSERT INTO satellites_ucs
(country_of_operator, launch_mass, class_of_orbit,
apogee, perigee, period, relaunches)
VALUES (?,?,?,?,?,?,?)
""", (country, mass, l, x, y, f(x, y), x + y))
// Nobody will ever create a QUAGGA statistical type!
with pytest.raises(BQLError):
// No such statistical type at the moment.
bdb.execute("""
CREATE POPULATION satellites FOR satellites_ucs (
After Change
except ImportError:
pytest.skip("no sklearn")
return
with cgpm_dummy_satellites_bdb() as bdb:
// Add a column called relaunches, sum of apogee and perigee.
bdb.sql_execute("ALTER TABLE satellites_ucs ADD COLUMN relaunches")
n_rows = bdb.sql_execute("""
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 28
Instances Project Name: probcomp/bayeslite
Commit Name: 651346e6d36fcd7c3bece2187aea9dfd498136cf
Time: 2016-07-21
Author: fsaad@mit.edu
File Name: tests/test_cgpm.py
Class Name:
Method Name: test_unknown_stattype
Project Name: probcomp/bayeslite
Commit Name: 651346e6d36fcd7c3bece2187aea9dfd498136cf
Time: 2016-07-21
Author: fsaad@mit.edu
File Name: tests/test_cgpm.py
Class Name:
Method Name: test_cgpm_kepler
Project Name: probcomp/bayeslite
Commit Name: 651346e6d36fcd7c3bece2187aea9dfd498136cf
Time: 2016-07-21
Author: fsaad@mit.edu
File Name: tests/test_cgpm.py
Class Name:
Method Name: test_unknown_stattype
Project Name: probcomp/bayeslite
Commit Name: 651346e6d36fcd7c3bece2187aea9dfd498136cf
Time: 2016-07-21
Author: fsaad@mit.edu
File Name: tests/test_cgpm.py
Class Name:
Method Name: test_bad_analyze_vars