Closed sxu11 closed 5 years ago
I just removed EventDigraph, as was something that Santhosh was playing around with a while ago, but no one using now. Failing on need for some graph library dependency that I don't know. I also removed STRIDEPreAdmitMedConversion as it turns out that data wasn't that useful, and it's crashing on some weird PostgreSQL query syntax that must have some version incompatibility, but more weird that it's trying to modify the database schema in the middle of the conversion script. In future development, could be worth just doing some summary queries to pull out the useful medication class information that was in this table and recreating a "mapped_meds" table that includes that.
The other errors aren't occurring on my system, so must be some other issue. One just looks like need to install matplotlib.
For me, the medinfo\dataconversion\test\TestFeatureMatrixFactory_UMich.py is still failing, even after I completely refactored DBUtil to better allow for different data connector types. Please find a way to patch this, otherwise, if you're not actually using this module, then the answer is to just delete FeatureMatrixFactory_UMich from the repository.
Traceback (most recent call last): File "C:\HealthRex\CDSS\medinfo\dataconversion\test\TestFeatureMatrixFactory_UMich.py", line 56, in setUp self._insertUMichTestRecords() File "C:\HealthRex\CDSS\medinfo\dataconversion\test\TestFeatureMatrixFactory_UMich.py", line 85, in _insertUMichTestRecords self.factory.setPatientEpisodeInput(self.cursor, "pat_id", "order_time") File "medinfo\dataconversion\FeatureMatrixFactory.py", line 178, in setPatientEpisodeInput raise TypeError("patientEpisodeInput must be DB cursor or TSV file.") TypeError: patientEpisodeInput must be DB cursor or TSV file.
Traceback (most recent call last): File "C:\HealthRex\CDSS\medinfo\dataconversion\test\TestFeatureMatrixFactory_UMich.py", line 56, in setUp self._insertUMichTestRecords() File "C:\HealthRex\CDSS\medinfo\dataconversion\test\TestFeatureMatrixFactory_UMich.py", line 73, in _insertUMichTestRecords df.to_sql(table_name, conn, if_exists="append", index=False) File "C:\Dev\Python27\lib\site-packages\pandas\core\generic.py", line 1362, in to_sql chunksize=chunksize, dtype=dtype) File "C:\Dev\Python27\lib\site-packages\pandas\io\sql.py", line 471, in to_sql chunksize=chunksize, dtype=dtype) File "C:\Dev\Python27\lib\site-packages\pandas\io\sql.py", line 1506, in to_sql table.insert(chunksize) File "C:\Dev\Python27\lib\site-packages\pandas\io\sql.py", line 666, in insert self._execute_insert(conn, keys, chunk_iter) File "C:\Dev\Python27\lib\contextlib.py", line 24, in exit self.gen.next() File "C:\Dev\Python27\lib\site-packages\pandas\io\sql.py", line 1388, in run_transaction self.con.commit() OperationalError: database is locked
Thanks for the fix. I removed TestFMF_UMich.py and all tests passed now. Will integrate the useful components of TestFMF_UMich.py into TestFMF.py as now the functionalities of FMF_UMich are combined into FMF.py anyway.
====================================================================== ERROR: analysis.test.TestAccuracyPerTopItems (unittest.loader.ModuleImportFailure)
ImportError: Failed to import test module: analysis.test.TestAccuracyPerTopItems Traceback (most recent call last): File "/Users/songxu/miniconda2/lib/python2.7/unittest/loader.py", line 254, in _find_tests module = self._get_module_from_name(name) File "/Users/songxu/miniconda2/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name import(name) File "/Users/songxu/healthrex/CDSS/medinfo/analysis/test/TestAccuracyPerTopItems.py", line 14, in
from medinfo.analysis.AccuracyPerTopItems import AccuracyPerTopItems;
File "medinfo/analysis/AccuracyPerTopItems.py", line 14, in
import pylab;
File "/Users/songxu/miniconda2/lib/python2.7/site-packages/pylab.py", line 1, in
from matplotlib.pylab import *
File "/Users/songxu/miniconda2/lib/python2.7/site-packages/matplotlib/pylab.py", line 252, in
from matplotlib import cbook, mlab, pyplot as plt
File "/Users/songxu/miniconda2/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/songxu/miniconda2/lib/python2.7/site-packages/matplotlib/backends/init.py", line 62, in pylab_setup
[backend_name], 0)
File "/Users/songxu/miniconda2/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 17, in
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.
====================================================================== ERROR: dataconversion.test.TestEventDigraph (unittest.loader.ModuleImportFailure)
ImportError: Failed to import test module: dataconversion.test.TestEventDigraph Traceback (most recent call last): File "/Users/songxu/miniconda2/lib/python2.7/unittest/loader.py", line 254, in _find_tests module = self._get_module_from_name(name) File "/Users/songxu/miniconda2/lib/python2.7/unittest/loader.py", line 232, in _get_module_from_name import(name) File "/Users/songxu/healthrex/CDSS/medinfo/dataconversion/test/TestEventDigraph.py", line 11, in
from medinfo.dataconversion.EventDigraph import EventDigraph
File "medinfo/dataconversion/EventDigraph.py", line 10, in
from graph_tool.all import *
ImportError: No module named graph_tool.all
====================================================================== ERROR: test_dataConversion_maxMixtureCount (dataconversion.test.TestSTRIDEPreAdmitMedConversion.TestSTRIDEPreAdmitMedConversion)
Traceback (most recent call last): File "/Users/songxu/healthrex/CDSS/medinfo/dataconversion/test/TestSTRIDEPreAdmitMedConversion.py", line 249, in test_dataConversion_maxMixtureCount self.converter.convertSourceItems(convOptions); File "medinfo/dataconversion/STRIDEPreAdmitMedConversion.py", line 48, in convertSourceItems rxcuiDataByMedId = self.loadRXCUIData(conn=conn); File "medinfo/dataconversion/STRIDEPreAdmitMedConversion.py", line 81, in loadRXCUIData DBUtil.execute(query) File "medinfo/db/DBUtil.py", line 304, in execute cur.execute( query, parameters ) ProgrammingError: syntax error at or near "NOT" LINE 4: ADD COLUMN IF NOT EXISTS ^
====================================================================== ERROR: test_dataConversion_normalized (dataconversion.test.TestSTRIDEPreAdmitMedConversion.TestSTRIDEPreAdmitMedConversion)
Traceback (most recent call last): File "/Users/songxu/healthrex/CDSS/medinfo/dataconversion/test/TestSTRIDEPreAdmitMedConversion.py", line 124, in test_dataConversion_normalized self.converter.convertSourceItems(convOptions); File "medinfo/dataconversion/STRIDEPreAdmitMedConversion.py", line 48, in convertSourceItems rxcuiDataByMedId = self.loadRXCUIData(conn=conn); File "medinfo/dataconversion/STRIDEPreAdmitMedConversion.py", line 81, in loadRXCUIData DBUtil.execute(query) File "medinfo/db/DBUtil.py", line 304, in execute cur.execute( query, parameters ) ProgrammingError: syntax error at or near "NOT" LINE 4: ADD COLUMN IF NOT EXISTS ^
====================================================================== ERROR: test_recommender (cpoe.test.TestOrderSetRecommender.TestOrderSetRecommender)
Traceback (most recent call last): File "/Users/songxu/healthrex/CDSS/medinfo/cpoe/test/TestOrderSetRecommender.py", line 31, in setUp ClinicalItemDataLoader.build_clinical_item_psql_schemata(); File "stride/clinical_item/ClinicalItemDataLoader.py", line 97, in build_clinical_item_psql_schemata DBUtil.runDBScript(schema_file) File "medinfo/db/DBUtil.py", line 393, in runDBScript conn = connection() File "medinfo/db/DBUtil.py", line 125, in connection return psycopg2.connect(host=connParams["HOST"], database=connParams["DSN"], user=connParams["UID"], password=connParams["PWD"]); File "/Users/songxu/.local/lib/python2.7/site-packages/psycopg2/init.py", line 130, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) OperationalError: FATAL: database "test" does not exist DETAIL: It seems to have just been dropped or renamed.
====================================================================== ERROR: test_analyzePatientItems (cpoe.test.TestTripleAssociationAnalysis.TestTripleAssociationAnalysis)
Traceback (most recent call last): File "/Users/songxu/healthrex/CDSS/medinfo/cpoe/test/TestTripleAssociationAnalysis.py", line 22, in setUp DBTestCase.setUp(self); File "medinfo/db/test/Util.py", line 49, in setUp DBUtil.createDatabase(medinfo.db.Env.DB_PARAM); File "medinfo/db/DBUtil.py", line 191, in createDatabase execute("CREATE DATABASE %s" % dbParams["DSN"], conn=defaultConn); File "medinfo/db/DBUtil.py", line 304, in execute cur.execute( query, parameters ) IntegrityError: duplicate key value violates unique constraint "pg_database_datname_index" DETAIL: Key (datname)=(test) already exists.
Ran 122 tests in 184.699s