Hi,
So I've been experimenting with using inspyred to optimize a model based on the example code on the website. On the first iteration the simulation runs without a problem and prints out the calculated fitness value. On the second iteration, I get the error
UnboundLocalError: local variable 'nrnRegions' referenced before assignment
What I've figure out is that in netrxd.py under _addReactions() in the block of code between lines 355 and 363, if param['regions'] is a list, then there is no way for the variable nrnRegions to be assigned. What was happening was that my param['regions'] variables were strings on the first iteration, but then got converted into lists so that on the second pass nrnRegions never got assigned.
A quick fix would be to put "if param['regions']:" on the line before the try statement. By that point param['regions'] should either be None or a list and should be fine.