New image.py, added support for channels() to PG, Selector and all from GenericImage on

Hmm the current_generator might still be undefined, and calling
"get_current_generator" crashes if it wasn't called self() first.
I could check for self.inspect_value('index')==None maybe?




On Thu, Jul 17, 2014 at 7:36 PM, James A. Bednar <notifications@github.com>
wrote:

> In imagen/__init__.py:
>
> > @@ -874,6 +874,17 @@ def get_current_generator(self):
> >          int_index=int(len(self.generators)*wrap(0,1.0,self.inspect_value('index')))
> >          return self.generators[int_index]
> >
> > +    def channels(self, **params_to_override):
> > +        self(**params_to_override)
> > +        current_generator = self.get_current_generator()
> > +        return current_generator.channels()
> > +
> > +    def num_channels(self):
> > +        if(len(self.generators)>0):
> > +            return self.generators[0].num_channels()
>
> Shouldn't num_channels return self.get_current_generator().num_channels()?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ioam/imagen/pull/31/files#r15075604>.
>