Skip to content

Commit 271efbf

Browse files
Eliminate legacy models. Nobody cares any more!
1 parent edf6519 commit 271efbf

File tree

7 files changed

+27
-407
lines changed

7 files changed

+27
-407
lines changed

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ include src/grammar.sha256
114114
include src/grammar.y
115115
include tests/dha.csv
116116
include tests/dha_codebook.csv
117-
include tests/dha_models.pkl.gz
118117
include tests/test_bql.py
119118
include tests/test_codebook.py
120119
include tests/test_column_dep.py
@@ -123,7 +122,6 @@ include tests/test_correlation.py
123122
include tests/test_csv.py
124123
include tests/test_geweke.py
125124
include tests/test_guess.py
126-
include tests/test_legacy.py
127125
include tests/test_math_util.py
128126
include tests/test_metamodels.py
129127
include tests/test_parse.py

shell/src/core.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def __init__(self, bdb, metamodel, stdin=None, stdout=None, stderr=None):
6969
self._installcmd('guess', self.dot_guess)
7070
self._installcmd('help', self.dot_help)
7171
self._installcmd('hook', self.dot_hook)
72-
self._installcmd('legacymodels', self.dot_legacymodels)
7372
self._installcmd('open', self.dot_open)
7473
self._installcmd('pythexec', self.dot_pythexec)
7574
self._installcmd('python', self.dot_python)
@@ -499,33 +498,6 @@ def dot_guess(self, line):
499498
except Exception:
500499
self.stdout.write(traceback.format_exc())
501500

502-
def dot_legacymodels(self, line):
503-
'''load legacy models
504-
<generator> <table> </path/to/models.pkl.gz>
505-
506-
Create a Crosscat generator named <generator> for the table
507-
<table> from the legacy models stored in
508-
</path/to/models.pkl.gz>.
509-
'''
510-
# XXX Lousy, lousy tokenizer.
511-
tokens = line.split()
512-
if len(tokens) != 3:
513-
self.stdout.write('Usage:'
514-
' .legacymodels <generator> <table>'
515-
' </path/to/models.pkl.gz>\n')
516-
return
517-
generator = tokens[0]
518-
table = tokens[1]
519-
pathname = tokens[2]
520-
try:
521-
bayeslite.bayesdb_load_legacy_models(self._bdb, generator, table,
522-
self._metamodel, pathname,
523-
create=True)
524-
except IOError as e:
525-
self.stdout.write('%s\n' % (e,))
526-
except Exception:
527-
self.stdout.write(traceback.format_exc())
528-
529501
def dot_describe(self, line):
530502
'''describe BayesDB entities
531503
[table(s)|generator(s)|columns|model(s)] [<name>...]

shell/tests/test_shell.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -153,20 +153,19 @@ def test_help_returns_list_of_commands(spawnbdb):
153153
c = spawnbdb
154154
c.sendexpectcmd('.help')
155155
c.expect_lines([
156-
' .codebook load codebook for table',
157-
' .csv create table from CSV file',
158-
' .describe describe BayesDB entities',
159-
' .guess guess data generator',
160-
' .help show help for commands',
161-
' .hook add custom commands from a python source file',
162-
' .legacymodels load legacy models',
163-
' .open close existing database and open new one',
164-
' .pythexec execute a Python statement',
165-
' .python evaluate a Python expression',
166-
' .read read a file of shell commands',
167-
' .sql execute a SQL query',
168-
' .trace trace queries',
169-
' .untrace untrace queries',
156+
' .codebook load codebook for table',
157+
' .csv create table from CSV file',
158+
' .describe describe BayesDB entities',
159+
' .guess guess population schema',
160+
' .help show help for commands',
161+
' .hook add custom commands from a python source file',
162+
' .open close existing database and open new one',
163+
' .pythexec execute a Python statement',
164+
' .python evaluate a Python expression',
165+
' .read read a file of shell commands',
166+
' .sql execute a SQL query',
167+
' .trace trace queries',
168+
' .untrace untrace queries',
170169
"Type `.help <cmd>' for help on the command <cmd>.",
171170
])
172171
c.expect_prompt()
@@ -378,21 +377,20 @@ def test_hook(spawnbdb):
378377
c.expect_prompt()
379378
c.sendexpectcmd('.help')
380379
c.expect_lines([
381-
' .codebook load codebook for table',
382-
' .csv create table from CSV file',
383-
' .describe describe BayesDB entities',
384-
' .guess guess data generator',
385-
' .help show help for commands',
386-
' .hook add custom commands from a python source file',
387-
' .legacymodels load legacy models',
388-
' .myhook myhook help string',
389-
' .open close existing database and open new one',
390-
' .pythexec execute a Python statement',
391-
' .python evaluate a Python expression',
392-
' .read read a file of shell commands',
393-
' .sql execute a SQL query',
394-
' .trace trace queries',
395-
' .untrace untrace queries',
380+
' .codebook load codebook for table',
381+
' .csv create table from CSV file',
382+
' .describe describe BayesDB entities',
383+
' .guess guess population schema',
384+
' .help show help for commands',
385+
' .hook add custom commands from a python source file',
386+
' .myhook myhook help string',
387+
' .open close existing database and open new one',
388+
' .pythexec execute a Python statement',
389+
' .python evaluate a Python expression',
390+
' .read read a file of shell commands',
391+
' .sql execute a SQL query',
392+
' .trace trace queries',
393+
' .untrace untrace queries',
396394
"Type `.help <cmd>' for help on the command <cmd>."
397395
])
398396
c.expect_prompt()

src/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
from bayeslite.codebook import bayesdb_load_codebook_csv_file
7373
from bayeslite.exception import BayesDBException
7474
from bayeslite.exception import BQLError
75-
from bayeslite.legacy_models import bayesdb_load_legacy_models
7675
from bayeslite.metamodel import IBayesDBMetamodel
7776
from bayeslite.metamodel import bayesdb_builtin_metamodel
7877
from bayeslite.metamodel import bayesdb_deregister_metamodel
@@ -102,7 +101,6 @@ def bql_quote_name(name):
102101
'BayesDBTxnError',
103102
'bayesdb_deregister_metamodel',
104103
'bayesdb_load_codebook_csv_file',
105-
'bayesdb_load_legacy_models',
106104
'bayesdb_open',
107105
'bayesdb_read_csv',
108106
'bayesdb_read_csv_file',

0 commit comments

Comments
 (0)