Opened 2 years ago
Closed 2 years ago
#9050 closed defect (fixed)
"volume flip" fails when inPlace is true
Reported by: | Tristan Croll | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | moderate | Milestone: | |
Component: | Volume Data | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
Works fine for inPlace false
.
volume flip #1 axis y inPlace true
Traceback (most recent call last):
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\cmd_line\tool.py", line 319, in execute
cmd.run(cmd_text)
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\core\commands\cli.py", line 2897, in run
result = ci.function(session, kw_args)
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\map_filter\vopcommand.py", line 1045, in volume_flip
fv = [flip_operation(v, axis, subregion, step, in_place, model_id)
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\map_filter\vopcommand.py", line 1045, in <listcomp>
fv = [flip_operation(v, axis, subregion, step, in_place, model_id)
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\map_filter\vopcommand.py", line 1057, in flip_operation
flip.flip_in_place(m, axes)
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\map_filter\flip.py", line 94, in flip_in_place
for k in range(n/2-1):
TypeError: 'float' object cannot be interpreted as an integer
TypeError: 'float' object cannot be interpreted as an integer
File "C:\Program Files\ChimeraX\bin\lib\site-packages\chimerax\map_filter\flip.py", line 94, in flip_in_place
for k in range(n/2-1):
See log for complete Python traceback.
Fixed.
I guess that ported code was never used since n/2 gives an integer in old Chimera Python 2 but a float in Python 3 where n2 is required.
Keep in mind that you can't flip in place a volume opened from a file, only an in-memory copy of the volume (e.g. made with "volume copy" command). This is an unfortunate limitation of all the volume in-place operations -- they cannot detach themselves from the underlying file data.