Open giovanni-rosotti opened 8 years ago
I prefer the list solution, it is more flexible. Although we need to be careful since both strings and lists are iterable.
Damn it, yes! But we can check if the type is a string, there's a robust way of doing it (although, it's different in python 2/3) which I'm already using somewhere else
The answer is here [1], and requires using the six package:
[1] http://stackoverflow.com/questions/1303243/how-to-find-out-if-a-python-object-is-a-string
It could be useful to have (some of) the python functions to support multiple types. It could be done either by passing lists of types (e.g. ['dust','sph']) or making the code understand fictitious type (e.g. 'total'). I'd prefer the first one but would like to know what you think. Once we have decided the interface, I need to decide the implementation (i.e. either aggregate the arrays in python or modifying the c++ snapshot class. Or modifying only the render class if we think it's useful only for renders)