jkeifer / pyHytemporal

An in-progress python library and command line tools for hypertemporal image classification
MIT License
0 stars 0 forks source link

classify fails with strange error message if no fit images are found #14

Open jkeifer opened 9 years ago

jkeifer commented 9 years ago

Here is the trace:

'generator' object has no attribute 'getitem' Traceback (most recent call last): File "/Users/phoetrymaster/Development/Python/Projects/pyHytemporal/pyhytemporal/classify.py", line 51, in classify_and_assess_accuracy bestthresh = thresholdlist[0] TypeError: 'generator' object has no attribute 'getitem' Traceback (most recent call last): File "commands.py", line 393, in cli() File "/Users/phoetrymaster/.virtualenvs/pyHytemporal/lib/python2.7/site-packages/click/core.py", line 488, in call return self.main(_args, _kwargs) File "/Users/phoetrymaster/.virtualenvs/pyHytemporal/lib/python2.7/site-packages/click/core.py", line 474, in main self.invoke(ctx) File "/Users/phoetrymaster/.virtualenvs/pyHytemporal/lib/python2.7/site-packages/click/core.py", line 758, in invoke return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:]) File "/Users/phoetrymaster/.virtualenvs/pyHytemporal/lib/python2.7/site-packages/click/core.py", line 767, in invoke_subcommand return cmd.invoke(cmd_ctx) File "/Users/phoetrymaster/.virtualenvs/pyHytemporal/lib/python2.7/site-packages/click/core.py", line 659, in invoke ctx.invoke(self.callback, _ctx.params) File "/Users/phoetrymaster/.virtualenvs/pyHytemporal/lib/python2.7/site-packages/click/core.py", line 325, in invoke return callback(_args, **kwargs) File "commands.py", line 259, in classify classifiedimagename=outputimagename) File "/Users/phoetrymaster/Development/Python/Projects/pyHytemporal/pyhytemporal/classify.py", line 79, in classify_and_assess_accuracy bestthresh, nodata, cropimgproperties.nodata) File "/Users/phoetrymaster/Development/Python/Projects/pyHytemporal/pyhytemporal/classify.py", line 144, in classify_with_threshold for ndarray in nodataarrays: UnboundLocalError: local variable 'nodataarrays' referenced before assignment

Need to validate the input before this error is thrown.