Fix for exception when modifying extents #330

Merged
merged 5 commits into from Apr 20, 2016

Conversation

Projects
None yet
3 participants
@stefanoborini
Contributor

stefanoborini commented Mar 31, 2016

Fixes #37

Fixes incorrect behavior with extent request at imshow
Solves #37

(cherry picked from commit 5489e88)
mayavi/tools/tools.py
@@ -304,12 +304,12 @@ def set_extent(module, extents):
extenty = 0.5 * (ymax - ymin)
extentz = 0.5 * (zmax - zmin)
# Now the actual bounds.
- xmin, xmax, ymin, ymax, zmin, zmax = module.actor.actor.bounds
+ xmin, xmax, ymin, ymax, zmin, zmax = module.actor.bounds

This comment has been minimized.

@prabhuramachandran

prabhuramachandran Apr 1, 2016

Member

I think this will need to be conditional. For example one could do the following:

actor = getattr(module.actor, 'actor', module.actor)

and then use actor.bounds etc. The reason is that in some cases the module.actor may not be an image actor, so one should test that for the case when the object is not an Image actor that it continues to work.

@prabhuramachandran

prabhuramachandran Apr 1, 2016

Member

I think this will need to be conditional. For example one could do the following:

actor = getattr(module.actor, 'actor', module.actor)

and then use actor.bounds etc. The reason is that in some cases the module.actor may not be an image actor, so one should test that for the case when the object is not an Image actor that it continues to work.

stefanoborini added some commits Apr 1, 2016

mayavi/tools/tools.py
@@ -323,17 +328,18 @@ def set_extent(module, extents):
else:
scalez = 1
- module.actor.actor.scale = (scalex, scaley, scalez)
+ module.actor.scale = (scalex, scaley, scalez)

This comment has been minimized.

@kitchoi

kitchoi Apr 1, 2016

Member

actor.scale = (scalex, scaley, scalez)?

@kitchoi

kitchoi Apr 1, 2016

Member

actor.scale = (scalex, scaley, scalez)?

@stefanoborini

This comment has been minimized.

Show comment
Hide comment
Contributor

stefanoborini commented Apr 4, 2016

@prabhuramachandran

This comment has been minimized.

Show comment
Hide comment
@prabhuramachandran

prabhuramachandran Apr 20, 2016

Member

LGTM. Sorry for the delay, can you resolve the conflicts and I will merge it right away.

Member

prabhuramachandran commented Apr 20, 2016

LGTM. Sorry for the delay, can you resolve the conflicts and I will merge it right away.

@kitchoi

This comment has been minimized.

Show comment
Hide comment
@kitchoi

kitchoi Apr 20, 2016

Member

@stefanoborini I can take this over if you're busy with other stuff?

Member

kitchoi commented Apr 20, 2016

@stefanoborini I can take this over if you're busy with other stuff?

@stefanoborini

This comment has been minimized.

Show comment
Hide comment
@stefanoborini

stefanoborini Apr 20, 2016

Contributor

@kitchoi No I'll do it

Contributor

stefanoborini commented Apr 20, 2016

@kitchoi No I'll do it

@prabhuramachandran

This comment has been minimized.

Show comment
Hide comment
Member

prabhuramachandran commented Apr 20, 2016

Thanks!

@prabhuramachandran prabhuramachandran merged commit ce21cfe into master Apr 20, 2016

5 checks passed

codecov/project 45.49% (target 40.00%)
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@prabhuramachandran prabhuramachandran deleted the 37-fix-for-actor branch Apr 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment