ucd-cws / PISCES

Software for tracking and analyzing fish species range data
Other
0 stars 2 forks source link

GenerateMap bug #49

Closed nickrsan closed 10 years ago

nickrsan commented 10 years ago

Original report by AndyB (Bitbucket: AndyB, GitHub: AndyB).


GenerateMap2 fails to execute if there are any files in layer_cache. The first map is generated correctly after clearing the layer cache but all subsequent maps fail to generate (even though the layers are cached).

Traceback (most recent call last): File "C:\Users\ambell\Documents\PISCES\scripts\PISCES\tbx_generate_map.py", line 79, in map_objects = mapping.begin("all", return_maps=True) # run the maps and get the objects File "C:\Users\ambell\Documents\PISCES\scripts\PISCES\mapping.py", line 690, in begin all_maps[index].generate() File "C:\Users\ambell\Documents\PISCES\scripts\PISCES\mapping.py", line 278, in generate file_only = replace_fid_with_common(file_only) File "C:\Users\ambell\Documents\PISCES\scripts\PISCES\mapping.py", line 942, in replace_fid_with_common replace_string = str(replace_string).replace(l_fid, local_vars.all_fish[l_fid].species) KeyError: u'MMC01'

Failed to execute (GenerateMap2).

nickrsan commented 10 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


Hey Andy, I have an idea of what's going on. I don't think I merged changes across to QC_2013. Can you check in your database one more time this afternoon, then I'll merge changes between branches and give you the new code, etc? If you're using either release or default, then I'll need to look into this. This line of code was part of the grief before.

nickrsan commented 10 years ago

Original comment by Nicholas Santos (Bitbucket: nickrsan, GitHub: nickrsan).


Added a basic mapping test. Made script tool funcs not overwrite all the local variables if get_location() is called multiple times. Resolves issue #49