Circuitscape / Circuitscape.py

Circuitscape uses electronic circuit theory to solve problems in landscape ecology.
https://www.circuitscape.org/
Other
27 stars 17 forks source link

fixes #65 : correct advanced network mode for cases with more than 1 components #66

Closed tanmaykm closed 10 years ago

tanmaykm commented 10 years ago

This should fix errors in cases where the graph contains more than 1 components.

With these changes, here are the data files and results for Mario Hofmann's problem: https://gist.github.com/tanmaykm/9683189

bmcrae commented 10 years ago

I'm getting the same error- with a downloaded zip copy. I double checked it was running the new version. Am I missing something?

Traceback (most recent call last):
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\gui.py", line 533, in on_calcButton_mouseClick
    _voltages, solver_failed = cs.compute()
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\profiler.py", line 144, in wrapper
    return func(*args)
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\compute.py", line 31, in compute
    return self.compute_raster()
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\profiler.py", line 144, in wrapper
    return func(*args)
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\compute.py", line 147, in compute_raster
    self.load_maps()
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\profiler.py", line 212, in wrapper
    return func(*args)
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\profiler.py", line 144, in wrapper
    return func(*args)
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\compute.py", line 950, in load_maps
    CSIO.read_cell_map(self.options.habitat_file, self.options.habitat_map_is_resistances, reclass_file, self.state)
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\io.py", line 507, in read_cell_map
    cell_map = CSIO._ascii_grid_reader(habitat_map, 'float64')
  File "C:\Users\bmcrae\Documents\GitHub\Circuitscape-tanmaykm\circuitscape\io.py", line 127, in _ascii_grid_reader
    temp[:,0] = pmap
ValueError: could not broadcast input array from shape (2,3) into shape (6)
tanmaykm commented 10 years ago

Are you doing this in network mode? I can see a compute_raster in the stack trace.

bmcrae commented 10 years ago

Duh! You are right. Works now, I'll just do a quick check with another problem and get back to you. Makes me think we might want to add a check for raster input format... Thanks!

On Fri, Mar 21, 2014 at 9:50 AM, Tanmay Mohapatra notifications@github.comwrote:

Are you doing this in network mode? I can see a compute_raster in the stack trace.

Reply to this email directly or view it on GitHubhttps://github.com/Circuitscape/Circuitscape/pull/66#issuecomment-38296885 .

bmcrae commented 10 years ago

Verified with Mario's problem and a combination of other problems. Thanks!

bmcrae commented 10 years ago

FYI, I just added a check for proper file formats to GUI code.

tanmaykm commented 10 years ago

Thanks. I shall build the mac executable and update the beta release.

bmcrae commented 10 years ago

I need to incorporate the new logo- maybe build in a few days?

On Fri, Mar 21, 2014 at 8:37 PM, Tanmay Mohapatra notifications@github.comwrote:

Thanks. I shall build the mac executable and update the beta release.

Reply to this email directly or view it on GitHubhttps://github.com/Circuitscape/Circuitscape/pull/66#issuecomment-38341894 .

tanmaykm commented 10 years ago

Ok. Sure!