- changed status to open
Verify values have been computed
All data retrieval methods that require calling a compute()
method first should raise an exception if the requested data has not yet been computed.
Comments (5)
-
reporter -
- removed responsible
-
reporter @vramasub I would like to handle this in the near term, to be released with the refactoring for memoryviews in PR #246. It's slightly more important when using memoryviews, because memoryviews throw errors that are slightly more confusing when one of their dimensions is zero. There are way too many places where users can access uninitialized memory by creating compute objects and querying their properties. What do you think about adding an internal Python-level property
self._computed
and a methodself._ensure_computed()
(to raise errors ifself._computed is False
) that is called by property-getters? -
I think that sounds like a reasonable plan. More and more, I'm moving back towards wanting to have an abstract parent compute class that defines some basic things like this for everything... but that's a separate discussion and needs more thought. For now, I'd be OK with just duplicating some code and implementing this for the various classes as needed.
-
reporter - changed version to 2.0
- Log in to comment