I2PC / scipion

Scipion is an image processing framework to obtain 3D models of macromolecular complexes using Electron Microscopy (3DEM)
http://scipion.i2pc.es
Other
76 stars 47 forks source link

Critical bug when deleting discardedCoordinates after XmippManualPicking #2056

Closed delarosatrevin closed 4 years ago

delarosatrevin commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create new run of Xmipp manual picking and select 'Save discarded coordinates = Yes'
  2. Pick some particles manually and activate training, generate outputCoordinates
  3. Close the GUI and execute the run again
  4. Go to next micrograph and remove some coordinates from the proposed ones
  5. Generate again outputCoordinates (after this two new output: outputCoordinates2 and outputDiscardedCoordantes2)
  6. Close the GUI and then from the summary, right click on the outputDiscardedCoordinates2 and 'Delete' this output
  7. After this the project does not open since the _outputs list of this protocol still contains the 'outputDiscardedCoordinates2' but it is no longer an attribute of the protocol.

Expected behavior After deleting the output, it should not be in the _outputs list

Additional context The following error trace is shown when trying to open the project again.

>>>>> python  /home/josem/work/development/scipion-devel/pyworkflow/apps/pw_project.py last
Error trying to update protocol: (jobId=30068)
 ERROR: 'XmippProtParticlePicking' object has no attribute 'outputDiscardedCoordinates2', tries=0
Error trying to update protocol: (jobId=30068)
 ERROR: 'XmippProtParticlePicking' object has no attribute 'outputDiscardedCoordinates2', tries=1
Error trying to update protocol: (jobId=30068)
 ERROR: 'XmippProtParticlePicking' object has no attribute 'outputDiscardedCoordinates2', tries=2
Error trying to update protocol: (jobId=30068)
 ERROR: 'XmippProtParticlePicking' object has no attribute 'outputDiscardedCoordinates2', tries=3
Traceback (most recent call last):
  File "/home/josem/work/development/scipion-devel/pyworkflow/project/project.py", line 686, in _updateProtocol
    prot2.closeMappers()
  File "/home/josem/work/development/scipion-devel/pyworkflow/protocol/protocol.py", line 2072, in closeMappers
    for _, attr in self.iterOutputAttributes(Set):
  File "/home/josem/work/development/scipion-devel/pyworkflow/protocol/protocol.py", line 738, in iterOutputAttributes
    for key, attr in iterator():
  File "/home/josem/work/development/scipion-devel/pyworkflow/protocol/protocol.py", line 750, in _iterOutputsNew
    attr = getattr(self, attrName)
AttributeError: 'XmippProtParticlePicking' object has no attribute 'outputDiscardedCoordinates2'
Traceback (most recent call last):
  File "/home/josem/work/development/scipion-devel/pyworkflow/apps/pw_project.py", line 82, in <module>
    projWindow = ProjectWindow(projPath)
  File "/home/josem/work/development/scipion-devel/pyworkflow/gui/project/project.py", line 125, in __init__
    self.switchView(VIEW_PROTOCOLS)
  File "/home/josem/work/development/scipion-devel/pyworkflow/gui/project/base.py", line 150, in switchView
    self.viewWidget = self.viewFuncs[newView](self.footer, self)
  File "/home/josem/work/development/scipion-devel/pyworkflow/gui/project/viewprotocols.py", line 640, in __init__
    c = self.createContent()
  File "/home/josem/work/development/scipion-devel/pyworkflow/gui/project/viewprotocols.py", line 709, in createContent
    self.createRunsGraph(runsFrame)
  File "/home/josem/work/development/scipion-devel/pyworkflow/gui/project/viewprotocols.py", line 1097, in createRunsGraph
    self.updateRunsGraph()
  File "/home/josem/work/development/scipion-devel/pyworkflow/gui/project/viewprotocols.py", line 1102, in updateRunsGraph
    checkPids=checkPids)
  File "/home/josem/work/development/scipion-devel/pyworkflow/project/project.py", line 1328, in getRunsGraph
    self._runsGraph = self.getGraphFromRuns(runs)
  File "/home/josem/work/development/scipion-devel/pyworkflow/project/project.py", line 1346, in getGraphFromRuns
    for _, attr in r.iterOutputAttributes():
  File "/home/josem/work/development/scipion-devel/pyworkflow/protocol/protocol.py", line 738, in iterOutputAttributes
    for key, attr in iterator():
  File "/home/josem/work/development/scipion-devel/pyworkflow/protocol/protocol.py", line 750, in _iterOutputsNew
    attr = getattr(self, attrName)
AttributeError: 'XmippProtParticlePicking' object has no attribute 'outputDiscardedCoordinates2'
pconesa commented 4 years ago

thanks @delarosatrevin we will look at it and see how bast can it be fixed and deployed.

delarosatrevin commented 4 years ago

At least I was able to reproduce it this time.

As a temporary workaround I wrote the following script to fix the outputs list: https://github.com/delarosatrevin/scipion-scripts/blob/master/fix_wrong_output.py

pconesa commented 4 years ago

I fixed this in scipion 3--> https://github.com/scipion-em/scipion-pyworkflow/pull/31