-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Is your feature request related to a problem? Please describe.
During hackathon, I lost a precious hour tracking down a mysterious bug. It turned out I was accessing a cell's targetVolume when that value was not actually available. (I was using the XML-based Volume plugin, not the VolumeLocalFlex plugin.) It was not obvious that targetVolume should not work. The cells obviously do have one, which was set in the XML. I expected Python to be able to retrieve it. I accessed the cell.targetVolume property and assumed it would be correct, but it was in fact always returning 0.
(Worth checking: it stands to reason that lambdaVolume, targetSurface, and lambdaSurface may suffer from the same issue, but I did not check.)
Describe the solution you'd like
Ideal solution: cell.targetVolume should work correctly with this plugin, returning the targetVolume of the cell.
Describe alternatives you've considered
It would also be perfectly acceptable if any attempt to access targetVolume would throw an error, with an appropriately informative error message.
Additional context
I note that the CC3D_Quick_Reference_Guide contains footnotes stating certain properties whose availability depends on what plugin you are using. For example, all "Cell surface" properties are "Only available when Surface , SurfaceTracker, SurfaceFlex or SurfaceLocalFlex plugins are called." No such footnote alerts the user to the issue with targetVolume, and it should be there. (However, adding that footnote would not by itself be a sufficient solution. Even with documentation, the property should not return an incorrect value.)
Also note that I don't actually care, for my own purposes, whether this is ever fixed. I have learned my lesson and will never use that XML plugin again; initializing all the targetVolumes in python is easy enough to do, so I will always use VolumeLocalFlex. But, future newbies will benefit from the fix. And James asked me to open an issue!