amuse
amuse copied to clipboard
Add warning/error when indexing grids wrongly
When using the grid interface to set variables of an AMUSE/OMUSE code, one can easily make the mistake to put the indexing brackets in the wrong place. Then nothing is actually written, even though the operation appears to succeed. Is it possible to catch this an give a warning or error message?
dales.grid.THL[:,:,5] = 280 | units.K # wrong
dales.grid[:,:,5].THL = 280 | units.K # right
I think there is unused code to address this in datamodel/base.py, specifically AbstractAttributeValue..though this needs a lot of work still...
note this is related to #45 (ie for in-memory sets there is no difference in result for the two above patterns)