neurocurator icon indicating copy to clipboard operation
neurocurator copied to clipboard

[Annotations] Adding Parameters to Annotations with no tags crashes

Open christian-oreilly opened this issue 7 years ago • 2 comments

Steps:

  1. Create a new annotation, without adding any tag.
  2. Create a new parameter (e.g., age).
  3. Try to save. It should fail and produce the following stack trace.

Stack trace:

Traceback (most recent call last):
  File "/home/oreilly/GIT_repos/neurocurator/neurocurator/modParamWidgets.py", line 317, in saveParameter
    relationship = self.relationWgt.getRelationship()
  File "/home/oreilly/GIT_repos/neurocurator/neurocurator/paramRelationWgt.py", line 128, in getRelationship
    return Relationship(self.relationshipCbo.currentText(), tag1, tag2)
UnboundLocalError: local variable 'tag1' referenced before assignment

christian-oreilly avatar Jan 11 '18 15:01 christian-oreilly

What was the reference ID?

I wasn't able to reproduce this behaviour with NeuroCurator v0.4.0 (packaged) and the following steps:

  1. In tab References, double-click on the reference of ID PMID_7965855.
  2. In Annotations details, click on New.
  3. Select 'table' in Annotation type.
  4. Enter '1' in Table no., Row no. and Column_no..
  5. Click on Save.
  6. Click on the annotation in Listing of existing annotations.
  7. Click on Parameters on the right panel.
  8. Click on New.
  9. Select 'age' for Parameter in Parameter details.
  10. Enter '3' in Values and 'week' in Unit.
  11. Click on Save in Existing parameters.
  12. No stack trace.

pafonta avatar Jan 15 '18 10:01 pafonta

The issue appears when Relationship in Parameter details has a value different from 'unspecified' ('point', 'directed', 'undirected').

When creating a new parameter, it is possible that Relationship has already a value different from 'unspecified' because of #35: the value comes from the previous selected parameter.

pafonta avatar Jan 15 '18 13:01 pafonta