Opened 8 years ago

Closed 8 years ago

#898 closed defect (fixed)

tried to save marker with label to file, got AttributeError: 'ObjectLabels' object has no attribute 'atoms'

Reported by: Elaine Meng Owned by: Tom Goddard
Priority: minor Milestone:
Component: Input/Output Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I added a marker, labeled it, and tried to save it to a file to see what would happen... however, you already told me marker notes weren't implemented yet, so it's user error, I suppose.

ave ~/Desktop/test.cmm models #3
Traceback (most recent call last):
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/cmd_line/tool.py", line 190, in execute
cmd.run(cmd_text)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/commands/cli.py", line 2512, in run
result = ci.function(session, kw_args)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/commands/save.py", line 63, in save
fmt.export(session, filename, fmt.nicknames[0],
kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/io.py", line 193, in export
result = self.export_func(session, path, kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/markers/init.py", line 35, in save_file
return cmmfiles.write_cmm(session, path, models)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/markers/cmmfiles.py", line 19, in write_cmm
f.write(markersets_as_xml(models))
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/markers/cmmfiles.py", line 85, in markersets_as_xml
lines.append(markerset_as_xml(ms))
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/markers/cmmfiles.py", line 31, in markerset_as_xml
markers = list(mset.atoms)
AttributeError: 'ObjectLabels' object has no attribute 'atoms'

Change History (2)

comment:1 by Elaine Meng, 8 years ago

the file was created but it was empty, so trying to open it also gave a traceback

comment:2 by Tom Goddard, 8 years ago

Resolution: fixed
Status: assignedclosed

Fixed.

Specifying model #3 also included the labels model #3.1. Made code ignore non-marker-set models when saving.

Currently labels are not saved with markers in the *.cmm file.

Note: See TracTickets for help on using tickets.