Opened 5 years ago

Closed 5 years ago

#3447 closed defect (fixed)

2D label errors

Reported by: kater@… Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Depiction Version: 1.0
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Begin forwarded message:

From: Lukas Kater
Subject: Re: [chimerax-users] chimerax label bug
Date: June 26, 2020 at 2:19:00 AM PDT
To: <chimerax-users@…>

Hi ChimeraX developers,

Sorry about that previous email...

Please let me know if there is a better way to report bugs.

I have been trying to use 2dlabel to annotate some things in a movie. I have stumbled across a number of problems:

1) creating 2 labels with the same name causes a crash (v1 quits and daily build just displays the log bellow under Fedora 32):
2dlab create ADP text "ADP state" color black size 26 bold true xpos 0.03 ypos 0.92 visibility false
2dlab create ADP text "ADP state" color black size 26 bold true xpos 0.03 ypos 0.92 visibility false

Traceback (most recent call last):

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/cmd_line/tool.py", line 263, in execute

cmd.run(cmd_text)

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2805, in run

result = ci.function(session, kw_args)

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/label/label2d.py", line 88, in label_create

return Label(session, name, kw)

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/label/label2d.py", line 512, in init

lb.add_label(self)

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/label/label2d.py", line 400, in add_label

nl.delete()

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/label/label2d.py", line 530, in delete

lm.delete_label(self)

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/label/label2d.py", line 417, in delete_label

self._labels.remove(label)

ValueError: list.remove(x): x not in list

ValueError: list.remove(x): x not in list

File "/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/label/label2d.py", line 417, in delete_label
self._labels.remove(label)

See log for complete Python traceback.

2) set bgColor hides labels
2dlab create ADP text "ADP state" color black size 26 bold true xpos 0.03 ypos 0.92 visibility false
# label is there (although visibility false?!)
set bgColor white
#label is gone

3) labels created with visibility false are still displayed
see above. But I can change visibility with 2dlab change

Thanks for any help!

Lukas Kater

Change History (1)

comment:1 by Tom Goddard, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

The code now gives a simple error and not a traceback when you try to create a second label with the same name of an existing one.

The "2dlabel create" command now respects the visibility option when first displayed.

The "2dlabel create" command is not documented in ChimeraX although as you discovered it does exist for backward compatibility with Chimera. It would be better to use the documented "2dlabel" command as the undocumented syntax you are using may be removed in a future ChimeraX.

Note: See TracTickets for help on using tickets.