Opened 5 years ago

Closed 5 years ago

#3993 closed defect (fixed)

issue with AtomicShapeDrawing.add_shape

Reported by: Tony Schaefer Owned by: Greg Couch
Priority: normal Milestone:
Component: Graphics Version:
Keywords: Cc: Tom Goddard
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

I cannot add a shape to a chimerax.atomic.AtomicShapeDrawing when the 'color' argument is either an N x 4 numpy array or a list

if it's a numpy array (first two times I ran my python script), it fails because numpy arrays don't have an 'asarray' method

if it's a list (last time I ran the script), it fails because lists don't have the 'ndim' attribute


Log:
cd C:\Users\normn/Desktop
Current working directory is: C:\Users\normn\Desktop
UCSF ChimeraX version: 1.1 (2020-09-09)
© 2016-2020 Regents of the University of California. All rights reserved.
How to cite UCSF ChimeraX
open C:\Users\normn\Desktop\test_triangles.py format python
spend 0.29s figuring out which points to delete
spend 3.72s deleting points and triangles
spend 0.02s shifting indicis for triangles
Traceback (most recent call last):
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\gui.py", line 629, in customEvent
    func(*args, **kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\widgets\htmlview.py", line 440, in defer
    cxcmd(session, topic)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\widgets\htmlview.py", line 456, in cxcmd
    run(session, cmd)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\run.py", line 31, in run
    results = command.run(text, log=log)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2805, in run
    result = ci.function(session, **kw_args)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 100, in cmd_open
    return Command(session, registry=registry).run(provider_cmd_text, log=log)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2805, in run
    result = ci.function(session, **kw_args)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 154, in provider_open
    name or model_name_from_path(fi.file_name)), provider_kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 372, in collated_open
    return func(*func_args, **func_kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core_formats\__init__.py", line 48, in open
    return open_python_script(session, data, file_name)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py", line 82, in open_python_script
    _exec_python(session, code, argv)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py", line 59, in _exec_python
    exec(code, sandbox.__dict__)
  File "test_triangles.py", line 169, in <module>
    drawing.add_shape(c_v, c_n, new_t, colors)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
    colors = color.asarray(color, dtype=numpy.uint8)
AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
colors = color.asarray(color, dtype=numpy.uint8)

See log for complete Python traceback.

ui tool show Shell
open C:\Users\normn\Desktop\test_triangles.py format python
spend 0.28s figuring out which points to delete
spend 3.72s deleting points and triangles
spend 0.02s shifting indicis for triangles
colors shape: (3386, 4)
Traceback (most recent call last):
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\gui.py", line 629, in customEvent
    func(*args, **kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\widgets\htmlview.py", line 440, in defer
    cxcmd(session, topic)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\widgets\htmlview.py", line 456, in cxcmd
    run(session, cmd)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\run.py", line 31, in run
    results = command.run(text, log=log)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2805, in run
    result = ci.function(session, **kw_args)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 100, in cmd_open
    return Command(session, registry=registry).run(provider_cmd_text, log=log)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2805, in run
    result = ci.function(session, **kw_args)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 154, in provider_open
    name or model_name_from_path(fi.file_name)), provider_kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 372, in collated_open
    return func(*func_args, **func_kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core_formats\__init__.py", line 48, in open
    return open_python_script(session, data, file_name)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py", line 82, in open_python_script
    _exec_python(session, code, argv)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py", line 59, in _exec_python
    exec(code, sandbox.__dict__)
  File "test_triangles.py", line 169, in <module>
    drawing.add_shape(c_v, c_n, new_t, colors)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
    colors = color.asarray(color, dtype=numpy.uint8)
AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
colors = color.asarray(color, dtype=numpy.uint8)

See log for complete Python traceback.

open C:\Users\normn\Desktop\test_triangles.py format python
spend 0.28s figuring out which points to delete
spend 3.71s deleting points and triangles
spend 0.02s shifting indicis for triangles
colors shape: (3386, 4)
Traceback (most recent call last):
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\gui.py", line 629, in customEvent
    func(*args, **kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\widgets\htmlview.py", line 440, in defer
    cxcmd(session, topic)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\widgets\htmlview.py", line 456, in cxcmd
    run(session, cmd)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\run.py", line 31, in run
    results = command.run(text, log=log)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2805, in run
    result = ci.function(session, **kw_args)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 100, in cmd_open
    return Command(session, registry=registry).run(provider_cmd_text, log=log)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2805, in run
    result = ci.function(session, **kw_args)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 154, in provider_open
    name or model_name_from_path(fi.file_name)), provider_kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\open_command\cmd.py", line 372, in collated_open
    return func(*func_args, **func_kw)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core_formats\__init__.py", line 48, in open
    return open_python_script(session, data, file_name)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py", line 82, in open_python_script
    _exec_python(session, code, argv)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py", line 59, in _exec_python
    exec(code, sandbox.__dict__)
  File "test_triangles.py", line 171, in <module>
    drawing.add_shape(c_v, c_n, new_t, colors)
  File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\atomic\shapedrawing.py", line 217, in add_shape
    if color.ndim == 1 or color.shape[0] == 1:
AttributeError: 'list' object has no attribute 'ndim'

AttributeError: 'list' object has no attribute 'ndim'

File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\atomic\shapedrawing.py", line 217, in add_shape
if color.ndim == 1 or color.shape[0] == 1:

See log for complete Python traceback.

Failed to send bug report. Error while sending follows:
Traceback (most recent call last):
File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\bug_reporter\bug_reporter_gui.py", line 241, in submit
errcode, errmsg, headers, body = post_multipart_formdata(BUG_HOST, BUG_SELECTOR, fields)
File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\webservices\post_form.py", line 40, in post_multipart_formdata
h.request('POST', url, body=body, headers=headers)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1262, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1308, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1257, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1028, in _send_output
self.send(msg)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 968, in send
self.connect()
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 940, in connect
(self.host,self.port), self.timeout, self.source_address)
File "D:\ChimeraX 1.1\bin\lib\socket.py", line 728, in create_connection
raise err
File "D:\ChimeraX 1.1\bin\lib\socket.py", line 716, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Failed to send bug report. Error while sending follows:
Traceback (most recent call last):
File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\bug_reporter\bug_reporter_gui.py", line 241, in submit
errcode, errmsg, headers, body = post_multipart_formdata(BUG_HOST, BUG_SELECTOR, fields)
File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\webservices\post_form.py", line 40, in post_multipart_formdata
h.request('POST', url, body=body, headers=headers)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1262, in request
self._send_request(method, url, body, headers, encode_chunked)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1308, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1257, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1028, in _send_output
self.send(msg)
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 968, in send
self.connect()
File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 940, in connect
(self.host,self.port), self.timeout, self.source_address)
File "D:\ChimeraX 1.1\bin\lib\socket.py", line 728, in create_connection
raise err
File "D:\ChimeraX 1.1\bin\lib\socket.py", line 716, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Change History (4)

in reply to:  1 ; comment:1 by Tony Schaefer, 5 years ago

looking back on it, I'm not sure why I thought a list would work instead of an array... the documentation says array
________________________________
From: ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu>
Sent: Saturday, November 28, 2020 3:01 AM
To: Anthony James Schaefer <tony.schaefer@uga.edu>
Subject: [ChimeraX] #3993: issue with AtomicShapeDrawing.add_shape

[EXTERNAL SENDER - PROCEED CAUTIOUSLY]


#3993: issue with AtomicShapeDrawing.add_shape
---------------------------+-----------------------------
 Reporter:  Tony Schaefer  |                Type:  defect
   Status:  new            |            Priority:  normal
Component:  Unassigned     |          Blocked By:
 Blocking:                 |  Notify when closed:
---------------------------+-----------------------------
 {{{
 I cannot add a shape to a chimerax.atomic.AtomicShapeDrawing when the
 'color' argument is either an N x 4 numpy array or a list

 if it's a numpy array (first two times I ran my python script), it fails
 because numpy arrays don't have an 'asarray' method

 if it's a list (last time I ran the script), it fails because lists don't
 have the 'ndim' attribute


 Log:
 cd C:\Users\normn/Desktop
 Current working directory is: C:\Users\normn\Desktop
 UCSF ChimeraX version: 1.1 (2020-09-09)
 © 2016-2020 Regents of the University of California. All rights reserved.
 How to cite UCSF ChimeraX
 open C:\Users\normn\Desktop\test_triangles.py format python
 spend 0.29s figuring out which points to delete
 spend 3.72s deleting points and triangles
 spend 0.02s shifting indicis for triangles
 Traceback (most recent call last):
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\gui.py", line
 629, in customEvent
     func(*args, **kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\ui\widgets\htmlview.py", line 440, in defer
     cxcmd(session, topic)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\ui\widgets\htmlview.py", line 456, in cxcmd
     run(session, cmd)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\run.py", line 31, in run
     results = command.run(text, log=log)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\cli.py", line 2805, in run
     result = ci.function(session, **kw_args)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 100, in cmd_open
     return Command(session, registry=registry).run(provider_cmd_text,
 log=log)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\cli.py", line 2805, in run
     result = ci.function(session, **kw_args)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 154, in provider_open
     name or model_name_from_path(fi.file_name)), provider_kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 372, in collated_open
     return func(*func_args, **func_kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core_formats\__init__.py", line 48, in open
     return open_python_script(session, data, file_name)
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py",
 line 82, in open_python_script
     _exec_python(session, code, argv)
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py",
 line 59, in _exec_python
     exec(code, sandbox.__dict__)
   File "test_triangles.py", line 169, in <module>
     drawing.add_shape(c_v, c_n, new_t, colors)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
     colors = color.asarray(color, dtype=numpy.uint8)
 AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

 AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
 colors = color.asarray(color, dtype=numpy.uint8)

 See log for complete Python traceback.

 ui tool show Shell
 open C:\Users\normn\Desktop\test_triangles.py format python
 spend 0.28s figuring out which points to delete
 spend 3.72s deleting points and triangles
 spend 0.02s shifting indicis for triangles
 colors shape: (3386, 4)
 Traceback (most recent call last):
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\gui.py", line
 629, in customEvent
     func(*args, **kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\ui\widgets\htmlview.py", line 440, in defer
     cxcmd(session, topic)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\ui\widgets\htmlview.py", line 456, in cxcmd
     run(session, cmd)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\run.py", line 31, in run
     results = command.run(text, log=log)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\cli.py", line 2805, in run
     result = ci.function(session, **kw_args)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 100, in cmd_open
     return Command(session, registry=registry).run(provider_cmd_text,
 log=log)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\cli.py", line 2805, in run
     result = ci.function(session, **kw_args)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 154, in provider_open
     name or model_name_from_path(fi.file_name)), provider_kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 372, in collated_open
     return func(*func_args, **func_kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core_formats\__init__.py", line 48, in open
     return open_python_script(session, data, file_name)
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py",
 line 82, in open_python_script
     _exec_python(session, code, argv)
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py",
 line 59, in _exec_python
     exec(code, sandbox.__dict__)
   File "test_triangles.py", line 169, in <module>
     drawing.add_shape(c_v, c_n, new_t, colors)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
     colors = color.asarray(color, dtype=numpy.uint8)
 AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

 AttributeError: 'numpy.ndarray' object has no attribute 'asarray'

 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\atomic\shapedrawing.py", line 221, in add_shape
 colors = color.asarray(color, dtype=numpy.uint8)

 See log for complete Python traceback.

 open C:\Users\normn\Desktop\test_triangles.py format python
 spend 0.28s figuring out which points to delete
 spend 3.71s deleting points and triangles
 spend 0.02s shifting indicis for triangles
 colors shape: (3386, 4)
 Traceback (most recent call last):
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\ui\gui.py", line
 629, in customEvent
     func(*args, **kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\ui\widgets\htmlview.py", line 440, in defer
     cxcmd(session, topic)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\ui\widgets\htmlview.py", line 456, in cxcmd
     run(session, cmd)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\run.py", line 31, in run
     results = command.run(text, log=log)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\cli.py", line 2805, in run
     result = ci.function(session, **kw_args)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 100, in cmd_open
     return Command(session, registry=registry).run(provider_cmd_text,
 log=log)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core\commands\cli.py", line 2805, in run
     result = ci.function(session, **kw_args)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 154, in provider_open
     name or model_name_from_path(fi.file_name)), provider_kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\open_command\cmd.py", line 372, in collated_open
     return func(*func_args, **func_kw)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\core_formats\__init__.py", line 48, in open
     return open_python_script(session, data, file_name)
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py",
 line 82, in open_python_script
     _exec_python(session, code, argv)
   File "D:\ChimeraX 1.1\bin\lib\site-packages\chimerax\core\scripting.py",
 line 59, in _exec_python
     exec(code, sandbox.__dict__)
   File "test_triangles.py", line 171, in <module>
     drawing.add_shape(c_v, c_n, new_t, colors)
   File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\atomic\shapedrawing.py", line 217, in add_shape
     if color.ndim == 1 or color.shape[0] == 1:
 AttributeError: 'list' object has no attribute 'ndim'

 AttributeError: 'list' object has no attribute 'ndim'

 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\atomic\shapedrawing.py", line 217, in add_shape
 if color.ndim == 1 or color.shape[0] == 1:

 See log for complete Python traceback.

 Failed to send bug report. Error while sending follows:
 Traceback (most recent call last):
 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\bug_reporter\bug_reporter_gui.py", line 241, in submit
 errcode, errmsg, headers, body = post_multipart_formdata(BUG_HOST,
 BUG_SELECTOR, fields)
 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\webservices\post_form.py", line 40, in
 post_multipart_formdata
 h.request('POST', url, body=body, headers=headers)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1262, in request
 self._send_request(method, url, body, headers, encode_chunked)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1308, in _send_request
 self.endheaders(body, encode_chunked=encode_chunked)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1257, in endheaders
 self._send_output(message_body, encode_chunked=encode_chunked)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1028, in _send_output
 self.send(msg)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 968, in send
 self.connect()
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 940, in connect
 (self.host,self.port), self.timeout, self.source_address)
 File "D:\ChimeraX 1.1\bin\lib\socket.py", line 728, in create_connection
 raise err
 File "D:\ChimeraX 1.1\bin\lib\socket.py", line 716, in create_connection
 sock.connect(sa)
 TimeoutError: [WinError 10060] A connection attempt failed because the
 connected party did not properly respond after a period of time, or
 established connection failed because connected host has failed to respond
 Failed to send bug report. Error while sending follows:
 Traceback (most recent call last):
 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\bug_reporter\bug_reporter_gui.py", line 241, in submit
 errcode, errmsg, headers, body = post_multipart_formdata(BUG_HOST,
 BUG_SELECTOR, fields)
 File "D:\ChimeraX 1.1\bin\lib\site-
 packages\chimerax\webservices\post_form.py", line 40, in
 post_multipart_formdata
 h.request('POST', url, body=body, headers=headers)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1262, in request
 self._send_request(method, url, body, headers, encode_chunked)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1308, in _send_request
 self.endheaders(body, encode_chunked=encode_chunked)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1257, in endheaders
 self._send_output(message_body, encode_chunked=encode_chunked)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 1028, in _send_output
 self.send(msg)
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 968, in send
 self.connect()
 File "D:\ChimeraX 1.1\bin\lib\http\client.py", line 940, in connect
 (self.host,self.port), self.timeout, self.source_address)
 File "D:\ChimeraX 1.1\bin\lib\socket.py", line 728, in create_connection
 raise err
 File "D:\ChimeraX 1.1\bin\lib\socket.py", line 716, in create_connection
 sock.connect(sa)
 TimeoutError: [WinError 10060] A connection attempt failed because the
 connected party did not properly respond after a period of time, or
 established connection failed because connected host has failed to respond

 }}}

--
Ticket URL: <https://plato.cgl.ucsf.edu/trac/ChimeraX/ticket/3993>
ChimeraX <http://www.rbvi.ucsf.edu/chimerax/>
ChimeraX Issue Tracker

comment:2 by Eric Pettersen, 5 years ago

Cc: Tom Goddard added
Component: UnassignedGraphics
Owner: set to Greg Couch
Platform: all
Project: ChimeraX
Status: newassigned

comment:3 by Tom Goddard, 5 years ago

It is possible that your attempt to make a multicolor AtomicShapeDrawing has never been tested. Greg added that code for nucleotide display and I don't know if it uses multi-color. You are right that numpy arrays don't have an asarray() method so the code looks like it would never work.

comment:4 by Greg Couch, 5 years ago

Resolution: fixed
Status: assignedclosed

FYI, if you are adding lots of shapes, it is much more efficient to use AtomicDrawing.add_shapes() instead of calling AtomicDrawing.add_shape() for each one. The latter has quadratic performance. The python analogy is that add_shapes is like str.join([strings]) and add_shape is like "string += string".

Fixed the code, it should have been "numpy.asarray, not <ndarray>.asarray.

Note: See TracTickets for help on using tickets.