def _test_NrgCingRdb(self): cingDirTmpTest = os.path.join( cingDirTmp, getCallerName() ) mkdirs( cingDirTmpTest ) self.failIf(os.chdir(cingDirTmpTest), msg = "Failed to change to test directory for files: " + cingDirTmpTest) host = 'localhost' if 1: # DEFAULT False host = '143.210.218.192' schema=RECOORD_DB_SCHEMA #@UnusedVariable schema=NRG_DB_NAME m = NrgCingRdb(host=host, schema=schema) # self.assertFalse( m.showCounts()) # self.assertFalse( m.createScatterPlots()) self.assertFalse(m.createPlotsCompareBetweenDb(other_schema=NMR_REDO_DB_SCHEMA)) if False: a = m.getPdbIdList() nTdebug("pdbIdList length: %d %s" % (len(a), a)) self.assertTrue(a) if 0 and a: # DEFAULT 0 watch out! lToRemove = \ '1sae 1sah 1saj 1sak 1sal 1y0j 2k0a 2kiu 2ku2 2kx7 2ky5 2l0l 2l0m 2l0n 2l0o 2l2f 2l2x 2l3r 2l8m 2rqf 3sak'.split() for entry_code in lToRemove: self.assertFalse( m.removeEntry(entry_code))
def _test_NrgCingRdb(self): cingDirTmpTest = os.path.join( cingDirTmp, getCallerName() ) mkdirs( cingDirTmpTest ) self.failIf(os.chdir(cingDirTmpTest), msg = "Failed to change to test directory for files: " + cingDirTmpTest) host = 'localhost' if 1: # DEFAULT False host = 'nmr.cmbi.umcn.nl' schema=RECOORD_DB_SCHEMA #@UnusedVariable schema=NRG_DB_NAME m = NrgCingRdb(host=host,schema=schema) # self.assertFalse( m.showCounts()) # self.assertFalse( m.createScatterPlots()) self.assertFalse( m.createPlotsCompareBetweenDb(other_schema=NMR_REDO_DB_SCHEMA)) if False: a = m.getPdbIdList() nTdebug("pdbIdList length: %d %s" % (len(a), a)) self.assertTrue(a) if 0 and a: # DEFAULT 0 watch out! lToRemove = \ '1sae 1sah 1saj 1sak 1sal 1y0j 2k0a 2kiu 2ku2 2kx7 2ky5 2l0l 2l0m 2l0n 2l0o 2l2f 2l2x 2l3r 2l8m 2rqf 3sak'.split() for entry_code in lToRemove: self.assertFalse( m.removeEntry(entry_code))
def __init__( self, useTopos=False, getTodoList=True, max_entries_todo=1, max_time_to_wait=86400, # one day. 2p80 took the longest: 5.2 hours. # But <Molecule "2ku1" (C:7,R:1659,A:36876,M:30)> is taking longer. 2ku2 is taking over 12 hrs now. processes_max=None, prepareInput=False, writeWhyNot=True, writeTheManyFiles=False, updateIndices=True, # isProduction=True ): kwds = NTdict( useTopos=useTopos, # There must be an introspection possible for this. getTodoList=getTodoList, max_entries_todo=max_entries_todo, max_time_to_wait=max_time_to_wait, # one day. 2p80 took the longest: 5.2 hours. # But <Molecule "2ku1" (C:7,R:1659,A:36876,M:30)> is taking longer. 2ku2 is taking over 12 hrs now. processes_max=processes_max, prepareInput=prepareInput, writeWhyNot=writeWhyNot, writeTheManyFiles=writeTheManyFiles, updateIndices=updateIndices, # isProduction=isProduction, ) kwds = kwds.toDict() NrgCing.__init__(self, **kwds) # Steal most from super class. self.results_base = results_base_recoord self.entry_to_delete_count_max = 0 # can be as many as fail every time. self.usedCcpnInput = 0 # For NMR_REDO it is not from the start. self.validateEntryExternalDone = 0 self.nrgCing = NrgCing() # Use as little as possible thru this inconvenience variable. self.archive_id = ARCHIVE_RECOORD_ID self.validateEntryExternalDone = False # DEFAULT: True # in the future and then it won't change but for NrgCing it is True from the start. self.updateDerivedResourceSettings() # The paths previously initialized in NrgCing. Will also chdir. if 1: nTmessage("Going to use specific entry_list_todo in prepare") # self.entry_list_done = readLinesFromFile('/Library/WebServer/Documents/NRG-CING/list/entry_list_recoord_nrgcing_shuffled.csv') m = NrgCingRdb(schema=self.schema_id) self.entry_list_done = m.getPdbIdList(fromCing=True) self.entry_list_done = NTlist(*self.entry_list_done) if 0: self.entry_list_todo.clear() # Random set of 10 from RECOORD still present in PDB. # self.entry_list_todo += "1mmc 1ks0 1b4r 1nxi 1eww 1hp3 1iox 2u2f 1kjs 1orx".split() self.entry_list_todo += "1brv".split() if 0: # DEFAULT: 0 nTmessage("Going to use specific entry_list_todo in prepare") self.entry_list_todo = readLinesFromFile( "/Library/WebServer/Documents/NRG-CING/list/entry_list_recoord_nrgcing_shuffled.csv" ) self.entry_list_todo = NTlist(*self.entry_list_todo)
def __init__( self, useTopos=False, getTodoList=True, max_entries_todo=1, max_time_to_wait=86400, # one day. 2p80 took the longest: 5.2 hours. # But <Molecule "2ku1" (C:7,R:1659,A:36876,M:30)> is taking longer. 2ku2 is taking over 12 hrs now. processes_max=None, prepareInput=False, writeWhyNot=True, writeTheManyFiles=False, updateIndices=True, # isProduction=True ): kwds = NTdict( useTopos= useTopos, # There must be an introspection possible for this. getTodoList=getTodoList, max_entries_todo=max_entries_todo, max_time_to_wait= max_time_to_wait, # one day. 2p80 took the longest: 5.2 hours. # But <Molecule "2ku1" (C:7,R:1659,A:36876,M:30)> is taking longer. 2ku2 is taking over 12 hrs now. processes_max=processes_max, prepareInput=prepareInput, writeWhyNot=writeWhyNot, writeTheManyFiles=writeTheManyFiles, updateIndices=updateIndices, # isProduction=isProduction, ) kwds = kwds.toDict() NrgCing.__init__(self, **kwds) # Steal most from super class. self.results_base = results_base_recoord self.entry_to_delete_count_max = 0 # can be as many as fail every time. self.usedCcpnInput = 0 # For NMR_REDO it is not from the start. self.validateEntryExternalDone = 0 self.nrgCing = NrgCing( ) # Use as little as possible thru this inconvenience variable. self.archive_id = ARCHIVE_RECOORD_ID self.validateEntryExternalDone = False # DEFAULT: True # in the future and then it won't change but for NrgCing it is True from the start. self.updateDerivedResourceSettings( ) # The paths previously initialized in NrgCing. Will also chdir. if 1: nTmessage("Going to use specific entry_list_todo in prepare") # self.entry_list_done = readLinesFromFile('/Library/WebServer/Documents/NRG-CING/list/entry_list_recoord_nrgcing_shuffled.csv') m = NrgCingRdb(schema=self.schema_id) self.entry_list_done = m.getPdbIdList(fromCing=True) self.entry_list_done = NTlist(*self.entry_list_done) if 0: self.entry_list_todo.clear() # Random set of 10 from RECOORD still present in PDB. # self.entry_list_todo += "1mmc 1ks0 1b4r 1nxi 1eww 1hp3 1iox 2u2f 1kjs 1orx".split() self.entry_list_todo += "1brv".split() if 0: # DEFAULT: 0 nTmessage("Going to use specific entry_list_todo in prepare") self.entry_list_todo = readLinesFromFile( '/Library/WebServer/Documents/NRG-CING/list/entry_list_recoord_nrgcing_shuffled.csv' ) self.entry_list_todo = NTlist(*self.entry_list_todo)