consbio/mpilot

numpy.ndarray object has no attribute mask

Closed this issue · 0 comments

The Sum command is sometimes raising the following exception:

Traceback (most recent call last):
  File "<string>", line 360, in execute
  File "C:\Python27\ArcGIS10.6\lib\site-packages\mpilot\program.py", line 292, in run
    command.run()
  File "C:\Python27\ArcGIS10.6\lib\site-packages\mpilot\commands.py", line 134, in run
    **self.validate_params({arg.name: arg.value for arg in self.arguments})
  File "C:\Python27\ArcGIS10.6\lib\site-packages\mpilot\libraries\eems\fuzzy.py", line 454, in execute
    arrays[0].mask,
  File "C:\Python27\ArcGIS10.6\lib\site-packages\mpilot\libraries\eems\fuzzy.py", line 453, in <genexpr>
    (arr.mask for arr in arrays[1:]),
AttributeError: 'numpy.ndarray' object has no attribute 'mask'

This seems to be due to a non-masked array being passed to the command. This and other non fuzzy commands should be updated and tested to work with masked and nonmasked arrays.