Menu

#139 Deleting PeakLists causes error in PeakView

3.0.0
closed
nobody
None
3
2017-08-01
2016-08-12
Fogh
No

DUring a session of mixed viewing and deleting PeakLists, I got this error several times. The situation is complex, so I give the entire console log:

Jupyter QtConsole 4.2.1
Python 3.5.1 |Continuum Analytics, Inc.| (default, Jun 15 2016, 15:32:45)
Type "copyright", "credits" or "license" for more information.

IPython 4.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

spectra = project.spectra

print spectra
File "<ipython-input-2-883f1b10117b>", line 1
print spectra
^
SyntaxError: Missing parentheses in call to 'print'</ipython-input-2-883f1b10117b>

print(spectra)
[<ccpn.spectrum:aromnoesy>, <ccpn.spectrum:c13noesy>, <ccpn.spectrum:n15noesy>]</ccpn.spectrum:n15noesy></ccpn.spectrum:c13noesy></ccpn.spectrum:aromnoesy>

for sp in spectra:
print(sp.axisCo
des)
File "<ipython-input-4-bdf1823e3980>", line 3
des)
^
SyntaxError: invalid syntax</ipython-input-4-bdf1823e3980>

for sp in spectra:
print(sp.axisCodes)

('Hc', 'H', 'Ch')
('Hc', 'H', 'Ch')
('Hn', 'H', 'Nh')

for sp in spectra:
ll = sp.axisCodes
sp.axisCodes = [ll[1], ll[0], ll[2]]

for sp in spectra:
print(sp.acquisitionAxisCode)

None
None
None

for sp in spectra:
ll = sp.axisCodes
sp.acquisitionAxisCode = ll[1]

for sp in spectra:
print(sp.acquisitionAxisCode)

Hc
Hc
Hn

for sp in spectra:
print(sp.orifinalPoints)


AttributeError Traceback (most recent call last)
<ipython-input-10-852d1b2db57e> in <module>()
1 for sp in spectra:
----> 2 print(sp.orifinalPoints)
3 </module></ipython-input-10-852d1b2db57e>

AttributeError: 'Spectrum' object has no attribute 'orifinalPoints'

for sp in spectra:
print(sp.originalPoints)


AttributeError Traceback (most recent call last)
<ipython-input-11-087b31ef4b04> in <module>()
1 for sp in spectra:
----> 2 print(sp.originalPoints)
3 </module></ipython-input-11-087b31ef4b04>

AttributeError: 'Spectrum' object has no attribute 'originalPoints'

from ccpn.core.lib.dataIo import loadCyanaPeakList

ImportError Traceback (most recent call last)
<ipython-input-12-c581c0ac65d9> in <module>()
----> 1 from ccpn.core.lib.dataIo import loadCyanaPeakList</module></ipython-input-12-c581c0ac65d9>

ImportError: No module named 'ccpn.core.lib.dataIo'

from ccpn.core.lib.DataIo import loadCyanaPeakList

print spectra
File "<ipython-input-14-883f1b10117b>", line 1
print spectra
^
SyntaxError: Missing parentheses in call to 'print'</ipython-input-14-883f1b10117b>

print (spectra)
[<ccpn.spectrum:aromnoesy>, <ccpn.spectrum:c13noesy>, <ccpn.spectrum:n15noesy>]</ccpn.spectrum:n15noesy></ccpn.spectrum:c13noesy></ccpn.spectrum:aromnoesy>

loadCyanaPeakList(spectra[-1], '/media/sf_ccpn/SharedCcpn/Collaborations/CASD/CASD-NMR/data/m2/2m2e_Org/2m2e_Org.input/restraints/hr8254a_2m2e/hr8254a_N15Noe_refined.peaks', ['Nh', 'H', 'Hn'])

print (project.peakLists)
[<ccpn.peaklist:aromnoesy.1>, <ccpn.peaklist:c13noesy.1>, <ccpn.peaklist:n15noesy.1>, <ccpn.peaklist:n15noesy.2>]</ccpn.peaklist:n15noesy.2></ccpn.peaklist:n15noesy.1></ccpn.peaklist:c13noesy.1></ccpn.peaklist:aromnoesy.1>

project.getByPid('PL:N15Noesy.1').delete()

project.getByPid('PL:C13Noesy.1').delete()

project.getByPid('PL:AromNoesy.1').delete()

print (project.peakLists)
[<ccpn.peaklist:n15noesy.2>]</ccpn.peaklist:n15noesy.2>

loadCyanaPeakList(spectra[-2], '/media/sf_ccpn/SharedCcpn/Collaborations/CASD/CASD-NMR/data/m2/2m2e_Org/2m2e_Org.input/restraints/hr8254a_2m2e/hr8254a_C13Noe_refined.peaks', ['Ch', 'H', 'Hc'])

RuntimeError Traceback (most recent call last)
<ipython-input-22-ed64562e95e0> in <module>()
----> 1 loadCyanaPeakList(spectra[-2], '/media/sf_ccpn/SharedCcpn/Collaborations/CASD/CASD-NMR/data/m2/2m2e_Org/2m2e_Org.input/restraints/hr8254a_2m2e/hr8254a_C13Noe_refined.peaks', ['Ch', 'H', 'Hc'])</module></ipython-input-22-ed64562e95e0>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/lib/DataIo.py in loadCyanaPeakList(spectrum, peakFile, axisCodes)
135 reordering = [axisCodes.index(x) for x in spectrum.axisCodes]
136
--> 137 peakList = spectrum.newPeakList()
138 project._appBase._echoBlocking += 1
139 try:

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/PeakList.py in _newPeakList(self, title, comment, isSimulated, serial)
414 result = None
415 try:
--> 416 obj = apiDataSource.newPeakList(name=title, details=comment, isSimulated=isSimulated)
417 result = self._project._data2Obj.get(obj)
418 if serial is not None:

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpnmodel/ccpncore/api/ccp/nmr/Nmr.py in newPeakList(self, **attrlinks)
14519 Factory function to create ccp.nmr.Nmr.PeakList
14520 """

14521 return PeakList(self, attrlinks)
14522
14523 def newSampledDataDim(self,
attrlinks):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpnmodel/ccpncore/api/ccp/nmr/Nmr.py in init(self, parent, **attrlinks)
65515 if ll:
65516 for notify in ll:

65517 notify(self)
65518
65519 if (notIsReading):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/Project.py in _newApiObject(self, wrappedData, cls)
707 result = factoryFunction(self, wrappedData)
708 #
--> 709 result._finaliseAction('create')
710
711

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/_implementation/AbstractWrapperObject.py in _finaliseAction(self, action)
651 self._project._logger.debug('finaliseAction notifier: %s; %s; %s'
652 % (action, self, notifier))
--> 653 notifier(self)
654
655 def _startFunctionCommandBlock(self, funcName, *params, values=None, defaults=None, parName=None):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/modules/PeakTable.py in _updatePeakLists(self, value)
192 def _updatePeakLists(self, value):
193 self.peakTable.objectLists = self.project.peakLists
--> 194 self.peakTable._updateSelectorContents()
195
196

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/modules/GuiTableGenerator.py in _updateSelectorContents(self)
116 texts = ['%s' % objectList.pid for objectList in self.objectLists]
117
--> 118 self.selector.setData(texts=texts, objects=self.objectLists)
119 if not self.objectList.shortClassName == 'PL':
120 if '<all>' not in self.selector.texts:</all>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/widgets/PulldownList.py in setData(self, texts, objects, index, icons)
165 icons = [None] * n
166
--> 167 self.clear()
168 for i, text in enumerate(texts):
169 self.addItem(text, objects[i], icons[i])

RuntimeError: wrapped C/C++ object of type PulldownList has been deleted

COmmand shell:

|starTest/CASD/bmrb/2m2e_docr> INFO:Gui:echoCommands: newPeakList = project.getByPid('SP:N15Noesy').newPeakList()
INFO:Gui:echoCommands: newPeakList = project.getByPid('SP:N15Noesy').newPeakList()
INFO:Framework:showPeakTable: application.showPeakTable()
INFO:Framework:showPeakTable: application.showPeakTable()
INFO:Gui:echoCommands: project.deleteObjects('PL:N15Noesy.1')
INFO:Gui:echoCommands: project.deleteObjects('PL:N15Noesy.1')
INFO:Gui:echoCommands: project.deleteObjects('PL:C13Noesy.1')
INFO:Gui:echoCommands: project.deleteObjects('PL:C13Noesy.1')
INFO:Gui:echoCommands: project.deleteObjects('PL:AromNoesy.1')
INFO:Gui:echoCommands: project.deleteObjects('PL:AromNoesy.1')
INFO:Framework:showPeakTable: application.showPeakTable()
INFO:Framework:showPeakTable: application.showPeakTable()
start generating output : ccp.nmr.Nmr.NmrProject
start generating output : ccpnmr.gui.Task.GuiTask
==> Project successfully saved
INFO:Gui:echoCommands: newPeakList = project.getByPid('SP:C13Noesy').newPeakList()

=========================================================

loadCyanaPeakList(spectra[-2], '/media/sf_ccpn/SharedCcpn/Collaborations/CASD/CASD-NMR/data/m2/2m2e_Org/2m2e_Org.input/restraints/hr8254a_2m2e/hr8254a_AromNoe_refined.peaks', ['Ch', 'H', 'Hc'])

TypeError Traceback (most recent call last)
<ipython-input-5-88c1d201b27c> in <module>()
----> 1 loadCyanaPeakList(spectra[-2], '/media/sf_ccpn/SharedCcpn/Collaborations/CASD/CASD-NMR/data/m2/2m2e_Org/2m2e_Org.input/restraints/hr8254a_2m2e/hr8254a_AromNoe_refined.peaks', ['Ch', 'H', 'Hc'])</module></ipython-input-5-88c1d201b27c>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/lib/DataIo.py in loadCyanaPeakList(spectrum, peakFile, axisCodes)
148 params['volume'] = float(ll[6])
149 params['volumeError'] = float(ll[7])
--> 150 peakList.newPeak(**params)
151 finally:
152 project._appBase._echoBlocking -= 1

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/Peak.py in _newPeak(self, height, volume, heightError, volumeError, figureOfMerit, annotation, comment, position, positionError, pointPosition, serial)
442 # DO creation notifications
443 if serial is not None:
--> 444 result._finaliseAction('rename')
445 result._finaliseAction('create')
446

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/_implementation/AbstractWrapperObject.py in _finaliseAction(self, action)
634 for dd in iterator:
635 for notifier in dd:
--> 636 notifier(self, oldPid)
637
638 for obj in self._getDirectChildren():

TypeError: _refreshPeakTable() takes 2 positional arguments but 3 were given

pls[2].delete()

RuntimeError Traceback (most recent call last)
<ipython-input-8-c429c38e6e1a> in <module>()
----> 1 pls[2].delete()</module></ipython-input-8-c429c38e6e1a>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/_implementation/AbstractWrapperObject.py in delete(self)
311 # NBNB clean-up of wrapper structure is done via notifiers.
312 # NBNB some child classes must override this function
--> 313 self._wrappedData.delete()
314
315 def getByPid(self, pidstring:str) :

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpnmodel/ccpncore/api/memops/Implementation.py in delete(self)
3574 for obj in reversed(objsToBeDeleted):
3575 for notify in obj.class._notifies.get('delete', ()):
-> 3576 notify(obj)
3577
3578 for notify in self.class._notifies.get('endDeleteBlock', ()):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/Project.py in _finaliseApiDelete(self, wrappedData)
727 pid = obj.pid
728
--> 729 obj._finaliseAction('delete')
730
731 # remove from wrapped2Obj

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/_implementation/AbstractWrapperObject.py in _finaliseAction(self, action)
651 self._project._logger.debug('finaliseAction notifier: %s; %s; %s'
652 % (action, self, notifier))
--> 653 notifier(self)
654
655 def _startFunctionCommandBlock(self, funcName, *params, values=None, defaults=None, parName=None):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/modules/PeakTable.py in _updatePeakLists(self, value)
192 def _updatePeakLists(self, value):
193 self.peakTable.objectLists = self.project.peakLists
--> 194 self.peakTable._updateSelectorContents()
195
196

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/modules/GuiTableGenerator.py in _updateSelectorContents(self)
116 texts = ['%s' % objectList.pid for objectList in self.objectLists]
117
--> 118 self.selector.setData(texts=texts, objects=self.objectLists)
119 if not self.objectList.shortClassName == 'PL':
120 if '<all>' not in self.selector.texts:</all>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/widgets/PulldownList.py in setData(self, texts, objects, index, icons)
165 icons = [None] * n
166
--> 167 self.clear()
168 for i, text in enumerate(texts):
169 self.addItem(text, objects[i], icons[i])

RuntimeError: wrapped C/C++ object of type PulldownList has been deleted

pls[0].delete()

RuntimeError Traceback (most recent call last)
<ipython-input-9-7ec6b55bc3ed> in <module>()
----> 1 pls[0].delete()</module></ipython-input-9-7ec6b55bc3ed>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/_implementation/AbstractWrapperObject.py in delete(self)
311 # NBNB clean-up of wrapper structure is done via notifiers.
312 # NBNB some child classes must override this function
--> 313 self._wrappedData.delete()
314
315 def getByPid(self, pidstring:str) :

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpnmodel/ccpncore/api/memops/Implementation.py in delete(self)
3574 for obj in reversed(objsToBeDeleted):
3575 for notify in obj.class._notifies.get('delete', ()):
-> 3576 notify(obj)
3577
3578 for notify in self.class._notifies.get('endDeleteBlock', ()):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/Project.py in _finaliseApiDelete(self, wrappedData)
727 pid = obj.pid
728
--> 729 obj._finaliseAction('delete')
730
731 # remove from wrapped2Obj

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/core/_implementation/AbstractWrapperObject.py in _finaliseAction(self, action)
651 self._project._logger.debug('finaliseAction notifier: %s; %s; %s'
652 % (action, self, notifier))
--> 653 notifier(self)
654
655 def _startFunctionCommandBlock(self, funcName, *params, values=None, defaults=None, parName=None):

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/modules/PeakTable.py in _updatePeakLists(self, value)
192 def _updatePeakLists(self, value):
193 self.peakTable.objectLists = self.project.peakLists
--> 194 self.peakTable._updateSelectorContents()
195
196

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/modules/GuiTableGenerator.py in _updateSelectorContents(self)
116 texts = ['%s' % objectList.pid for objectList in self.objectLists]
117
--> 118 self.selector.setData(texts=texts, objects=self.objectLists)
119 if not self.objectList.shortClassName == 'PL':
120 if '<all>' not in self.selector.texts:</all>

/home/ccpn/SharedCcpn/svnroots/ccpnv3/trunk/ccpn/src/python/ccpn/ui/gui/widgets/PulldownList.py in setData(self, texts, objects, index, icons)
165 icons = [None] * n
166
--> 167 self.clear()
168 for i, text in enumerate(texts):
169 self.addItem(text, objects[i], icons[i])

RuntimeError: wrapped C/C++ object of type PulldownList has been deleted

Discussion

  • Geerten W. Vuister

    • Priority: 2 --> 3
     
  • wb104

    wb104 - 2017-08-01
    • status: open --> closed
     
  • wb104

    wb104 - 2017-08-01

    Hopefully sorted now (protect against deleted peak / peakList / peakListView in relevant notifier)

     

Log in to post a comment.

MongoDB Logo MongoDB