PiRSquared17 / cing

Automatically exported from code.google.com/p/cing
0 stars 0 forks source link

CING somehow leaves data in CCPN datamodel MemopsRoot that prevents another read into #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run default unit check:
cing --test -v 0
I have disabled all regular unit tests except for the 2 shown below.

What is the expected output? What do you see instead?
I expect to see both pass. The second fails. The second 
cing.PluginCode.test.test_ccpn.AllChecks succeeds fine if it's not preceeded by 
the other one.
The 2nd tries to read in a project named 1brv just like the first.

My suspicion is the CING python holds on to some core CCPN data which gives the 
ApiError below.
I would like to know how to empty the data CCPN holds on to.
I see no clean, remove, init.. or so in api doc.
The workaround I use now is to test with a different entry in 
cing.PluginCode.test.test_NmrStar.AllChecks

jd:stella/~/ python -u $CINGROOT/python/cing/main.py --test
================================================================================
======================
| CING: Common Interface for NMR structure Generation version 0.9 (r656)        
AW,JFD,GWV 2004-2009 |
================================================================================
======================
User: jd              on: stella.cmbi.umcn.nl (darwin)                  at: Fri 
Oct 30 14:54:59 2009
testNmrStar (cing.PluginCode.test.test_NmrStar.AllChecks) ... Moving CCPN 
directory from [linkNmrStarData] to [1brv]
==> Importing data from Ccpn project "1brv"
Non-standard (residues and their) atoms added:
GLU : [ 189]
==> Molecule 1brv: Potential disulfide bridges: 2. applying bonds: True
==> Ccpn molecule '1brv' imported
==> Ccpn project imported
-------------------------------------------------------
==> Saving <Project 1brv>
Running Wim Vranken's FormatConverter from script 
$CINGROOT/python/cing/Scripts/FC/convertCcpn2Nmrstar.py
==> NMR-STAR project written at /Users/jd/tmp/cingTmp/1brv.str
ok

----------------------------------------------------------------------
Ran 1 test in 8.683s

OK

testInitCcpn (cing.PluginCode.test.test_ccpn.AllChecks) ... Moving CCPN 
directory from [1brv] to [1brv_cs_pk_2mdl]
==> Importing data from Ccpn project "1brv"
Error loading file for:  <ccp.molecule.MolSystem.MolSystem ['1brv']>
Reading:  <open file 
'/Users/jd/tmp/cingTmp/1brv_cs_pk_2mdl/ccp/molecule/MolSystem/1brv+1brv_user_200
9-04-09-07-57-25-178_00002.xml', mode 'r' at 0x62d8800>
Last xml tag read:  MOLS.MolSystem.chains
Parser state was:  handling version compatibility
Object stack was empty
ERROR

======================================================================
ERROR: testInitCcpn (cing.PluginCode.test.test_ccpn.AllChecks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jd/workspace34/cing/python/cing/PluginCode/test/test_ccpn.py", line 78, in testInitCcpn
    self.assertTrue(project.initCcpn(ccpnFolder = ccpnFile, modelCount=modelCount))
  File "/Users/jd/workspace34/cing/python/cing/PluginCode/Ccpn.py", line 2262, in initCcpn
    if not ccpn.importFromCcpn(modelCount = modelCount):
  File "/Users/jd/workspace34/cing/python/cing/PluginCode/Ccpn.py", line 331, in importFromCcpn
    if not self.importFromCcpnMolecule(modelCount = modelCount):
  File "/Users/jd/workspace34/cing/python/cing/PluginCode/Ccpn.py", line 405, in importFromCcpnMolecule
    if not self._getCcpnMolSystemList():
  File "/Users/jd/workspace34/cing/python/cing/PluginCode/Ccpn.py", line 291, in _getCcpnMolSystemList
    ccpnMolSystemList = self.ccpnProject.sortedMolSystems()
  File "/Users/jd/workspace34/ccpn/python/memops/api/Implementation.py", line 21522, in sortedMolSystems
    root.refreshTopObjects('ccp.molecule.MolSystem')
  File "/Users/jd/workspace34/ccpn/python/memops/api/Implementation.py", line 16976, in refreshTopObjects
    topObject = XmlIO.loadFromFile(self, filePath, partialLoad=True)
  File "/Users/jd/workspace34/ccpn/python/memops/format/xml/XmlIO.py", line 251, in loadFromFile
    partialLoad=partialLoad)
  File "/Users/jd/workspace34/ccpn/python/memops/format/xml/XmlIO.py", line 267, in loadFromStream
    partialLoad=partialLoad)
  File "/Users/jd/workspace34/ccpn/python/memops/xml/Implementation.py", line 4968, in loadFromStream
    linkChildData(delayDataDict, result, mapping, linkTopToParent, doOutOfPackage)
  File "/Users/jd/workspace34/ccpn/python/memops/xml/Implementation.py", line 5175, in linkChildData
    + ": %s:%s:%s" % (obj.getQualifiedName(), obj.getParent(), key)
ApiError: Cannot add child - key already in use: 
ccp.molecule.MolSystem.MolSystem:<memops.Implementation.MemopsRoot 
id:105142224>:1brv

----------------------------------------------------------------------
Ran 1 test in 0.426s

FAILED (errors=1)

CING started at : Fri Oct 30 14:54:55 2009
CING stopped at : Fri Oct 30 14:55:08 2009
CING took       : 12.783 s

Original issue reported on code.google.com by jurge...@gmail.com on 30 Oct 2009 at 2:04

GoogleCodeExporter commented 9 years ago
Tim, this should be an easy one to knock off.

What's the command for clearing everything in Memops so this bug doesn't occur?
Should I ask Rasmus?

Original comment by jurge...@gmail.com on 4 Jan 2010 at 12:06

GoogleCodeExporter commented 9 years ago
From Rasmus:

There might be something, but it is hard to check when you do not have the test 
system to hand.

It is unlikely to be CCPN holding on to old data. You are making a new project, 
right? That should effectively reset everything.

It looks to me like you have two MolSystem files in the load directory(s) with 
the same MolSystem.code ('1brv'). Either that or you are somehow creating a new 
one with a code that is already in use in a file. The 
solution would be to get rid of one of the files or move it away. So: look in 
the project (or memops/Implementation/projname.xml) to make sure where the 
project is picking up files; then check there which files 
have MolSystem.code '1brv' and figure out how to get rid of them.

In more general terms, any file in the relevant repository will be read when 
apropriate and is conceptually part of the project.

If all else fails you could try to send me the project and code, but it would 
be easier for you to do it yourself.

Original comment by jurge...@gmail.com on 21 Apr 2010 at 2:33

GoogleCodeExporter commented 9 years ago
Rasmus is right. The way I was untarring the CCPN .tgz it would insert new 
MolSystem files from e.g. 1brv_blabla 
into 1brv directory. Fixed in r766 by explicitly removing the CCPN untarred 
directory after using it. In general 
that is not needed but for testing I like it. It's because the rather unusual 
feature of initCcpn to untar whatever is 
in the tar and then copy to the right directory.
Thanks Rasmus!

Original comment by jurge...@gmail.com on 21 Apr 2010 at 3:03