Bookworm-project / BookwormDB

Tools for text tokenization and encoding
MIT License
84 stars 12 forks source link

Trim deprecated functions from SQLAPI.py (was--unused variables) #99

Open organisciak opened 8 years ago

organisciak commented 8 years ago

Each of the following lines is a bug in the current version of SQLAPI.py, but I defer to @bmschmidt as to what the proper resolution is for each.

SQLAPI.py:926:22: F821 undefined name 'smooth_function'
SQLAPI.py:1014:36: F821 undefined name 'pickle'
SQLAPI.py:1185:9: F821 undefined name 'userqueries'
SQLAPI.py:1198:11: F821 undefined name 'headers'

smooth_function seems to be part of a deprecated method that can likely be deleted. The pickle line seems to be expecting import pickle, not sure if it should be imported or the line removed. The userqueries reference is wrapped in try/except, but it obviously will always do the latter, and the headers line is for what seems to be debug functionality that is no longer supported.

bmschmidt commented 8 years ago

There's a lot of deadwood in SQLAPI.py; I never cleared out the things that became unnecessary with the switch to pandas for merging for fear it make break something running down at Rice.

In each of these cases, it is safe to delete the entire code block that contains the offending line.

There's a lot else that should go besides: a number of code blocks are tagged as deprecated, and I think I altered the line chart GUI to not use those methods.

Plus there's a lot of code for caching that can be deleted as well.

organisciak commented 8 years ago

Great. Unless you have a commit already loaded, I'll remove this code.

bmschmidt commented 8 years ago

No commit on my end; cut away.

I'm expanding the scope of this issue to include the various deprecated blocks.

organisciak commented 8 years ago

I cleaned the issues mentioned in the initial issue's scope with d8307c1f, and followed backward looking for references to the removed code. You'll have to do a more detailed audit of the functions in SQLAPI.py before closing this issue.