This forum is shutting down! Please post new discussions at

ValueError in Overlap analysis model

hmorzariahmorzaria Member
edited December 2014 in Marine Models
I am running InVEST 3.1.0 in a Windows 7, 64-bit machine.

I have multispecific fisheries as input data, 43 point shapefiles representing areas where fisheries are active. It runs fine through creating intermediate data, the model creates all the rasters, but when calculating the frequency it crashes and a separate window that says "Invest_natcap has stopped working and needs to close" appears. The log file yields no useful information.

By, sequentially adding and removing fisheries, I finally got the model to work and eventually "ValueError: Cannot construct an iterator with more than 32 operands (35 were requested)"

Is there a way around this error? short of grouping my fisheries which I don't really want to do...



  • DougDoug Administrator, NatCap Staff

    When you got the model to work and received that error message did you get a proper output Log with that error message and run? If so, could you post it here?

    It is very strange that the program would die as mentioned... Also if possible and you can, you could send your data zipped up to here: . If it's too big to send let me know.

    Thanks for your patience!
  • Hi, thanks

    No, the output Log does not record the error (see attached).

    I'll send you the zipped data; as I mentioned I only get the second error ("ValueError: Cannot construct an iterator with more than 32 operands (35 were requested)" when I used 35 shapefiles. With the whole set, 43 shapefiles, the program simply crashes.

  • RichRich Administrator, NatCap Staff
    Usually on those ValueErrors there's additional information in the log window about what lines of code this stuff crashed on. Doug and I dug through the codebase and tried to guess where that might happen, but aren't sure. It's the first time we've gotten an exception like that which is interesting, I'm not even sure how to generate that error by hand. Anyway, if you see that error I'm talking about it would be wonderful if you could post it.
  • DougDoug Administrator, NatCap Staff
    Hi @hmorzaria

    Sorry this bug has taken awhile to shake out but I think we finally have a handle on it. It's one of the more interesting we've come across in awhile, although I'm sure that doesn't make you feel much better haha.

    Unfortunately at the moment, the Overlap Model cannot be run with more than 32 shapefiles... This limitation is an internal Python restraint that has popped up in a very weird place. I will be able to get you a fixed release in the near future, but I'll want to do some quick testing to make sure that the results and model are acting appropriately with the patch.

    Thanks for your patience and help in this! Once I get that patch, I'll send it your way.

  • DougDoug Administrator, NatCap Staff
    Hi @hmorzaria

    I think we've finally got a patch ready to be tested! [6855c75bf3ad]_x86_Setup.exe

    This latest build of InVEST should have the fixes to allow Overlap Analyses to handle more than 32 shapefiles.

    I ran it on the data you passed along and got it to run successfully. Please let me know if you have anymore issues!

This discussion has been closed.