Skip to content

Commit 612c3d3

Browse files
Remove vestiges of model schemas. Failed to revert earlier!
1 parent 95ccf8e commit 612c3d3

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/core.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -529,45 +529,6 @@ def bayesdb_generator_column_numbers(bdb, generator_id):
529529
'''
530530
return [row[0] for row in bdb.sql_execute(sql, (generator_id,))]
531531

532-
def bayesdb_has_model_schema(bdb, name):
533-
"""True if there is a model schema named `name` in `bdb`."""
534-
sql = '''
535-
SELECT COUNT(*) FROM bayesdb_model_schema
536-
WHERE name = ?
537-
'''
538-
return 0 != cursor_value(bdb.sql_execute(sql, (name,)))
539-
540-
def bayesdb_get_model_schema(bdb, name):
541-
"""Return the id of the model schema named `name` in `bdb`.
542-
543-
The id is persistent across savepoints: ids are 64-bit integers
544-
that increase monotonically and are never reused.
545-
546-
`bdb` must have a generator named `name`. If you're not sure,
547-
call :func:`bayesdb_has_model_schema` first.
548-
"""
549-
sql = 'SELECT id FROM bayesdb_model_schema WHERE name = ?'
550-
cursor = bdb.sql_execute(sql, (name,))
551-
try:
552-
row = cursor.next()
553-
except StopIteration:
554-
raise ValueError('No such model schema: %r' % (name,))
555-
else:
556-
assert isinstance(row[0], int)
557-
return row[0]
558-
559-
def bayesdb_model_schema_generator(bdb, model_schema_id):
560-
"""Return the id of the generator for the specified model schema."""
561-
sql = 'SELECT generator_id FROM bayesdb_model_schema WHERE id = ?'
562-
cursor = bdb.sql_execute(sql, (model_schema_id,))
563-
try:
564-
row = cursor.next()
565-
except StopIteration:
566-
raise ValueError('No such model schema: %r' % (model_schema_id,))
567-
else:
568-
assert isinstance(row[0], int)
569-
return row[0]
570-
571532
def bayesdb_generator_has_model(bdb, generator_id, modelno):
572533
"""True if `generator_id` has a model numbered `modelno`."""
573534
sql = '''

0 commit comments

Comments
 (0)