This forum is shutting down! Please post new discussions at

Scenario generator tool

kimfungloykimfungloy Member
edited June 2015 in Pre/Post-Processing

I am having problems running the scenario generator tool. I am receiving an error : TypeError: unsupported operand type(s) for /: 'unicode' and 'float'

What does this mean? Also, is there a better example of how the transition likelihood table, the factors table, and the landcover raster should be filled in? I filled them in according to the manual, but that gave me some errors in the beginning, mostly regarding the naming of the covers etc, the corresponding Id's etc. I would like a better example/tutorial than the one in the guide.

Post edited by Doug on


  • DougDoug Administrator, NatCap Staff
    Hi @kimfungloy,

    I just responded to your newer post, and in doing so I came across the same inconsistencies with the documentation and what the model expects. The sample tables provided are not that helpful as I think some of the column names might not be correct. 

    I'll try to ping some folks and find some helpful information!
  • Hi Doug,

    thanks so much for your help. I look forward to your feedback
  • DougDoug Administrator, NatCap Staff
    Looks like there is a plan to revamp the documentation this summer along with sample data. For the now the model seems to be stuck in a state of transition. Some of our engineers who were gurus for the model have moved on and it hasn't quite got picked up yet. 

    I'll keep you posted if I come across any better training data. Thanks for your patience.
  • jdouglassjdouglass Administrator, NatCap Staff
    Also, the specific meaning of

    TypeError: unsupported operand type(s) for /: 'unicode' and 'float'

    is that there's some place where the model is reading in a value (probably a table value) that is being interpreted as a text string and not a number, and the model doesn't try to cast this string to a float before attempting division.

    Could you perhaps attach your model's logfile so we can see where it's breaking?

  • Hi,

    I tried adjusting the tables and running the model again. It now gives me another error:

    UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 726: ordinal not in range(128)

    However, it does produce a scenario landcover map, it places it in the workspace, not in the output map. It does show changes in landcover. I wil attach the log file.
  • jdouglassjdouglass Administrator, NatCap Staff
    Hi @kimfungloy,

    The error UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 726: ordinal not in range(128) is because there's a non-ascii character used when generating the html table, probably in the "Name" column of the transition table.  My guess from the u'\xeb' ordinal is that it's an e with umlaut ( in one of the rows.  The scenario generator doesn't handle non-ASCII characters very well at the moment, so would it be possible to replace the the ë with an e or some other character and see if that works?

  • Hi @jdouglass,

    I am pleased to tell you that your solution worked! I have been able to run the model successfully. Thank you do much for all your help. 

    Keep up the good work!

  • jdouglassjdouglass Administrator, NatCap Staff
    Awesome, I'm glad that worked!  I'll mark this thread as resolved,  but let us know if anything else comes up!
This discussion has been closed.