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

Command line version should not require wx or PythonCard #37

Closed ViralBShah closed 10 years ago

ViralBShah commented 10 years ago

This used to work.

julia 05:51:34 {master} ~/Circuitscape$ python bin/csverify.py 
Traceback (most recent call last):
  File "bin/csverify.py", line 5, in <module>
    from circuitscape.verify import cs_verifyall
  File "/home/viral/Circuitscape/circuitscape/__init__.py", line 2, in <module>
    from gui import show_gui
  File "/home/viral/Circuitscape/circuitscape/gui.py", line 19, in <module>
    from PythonCard import dialog, model 
ImportError: No module named PythonCard
tanmaykm commented 10 years ago

This is currently a side-efect of packaging, since we have not split the gui to a separate package, and circuitscape package exports show_gui.

This should circumvent that:

from circuitscape.compute import Compute

Will change csrun.py to use this instead.

ViralBShah commented 10 years ago

Still getting error on running the verify tests.

Virals-MacBook-Pro 05:43:51 (master) ~/repos/Circuitscape$ export PYTHONPATH=`pwd`:.
Virals-MacBook-Pro 05:43:53 (master) ~/repos/Circuitscape$ make test
python bin/csverify.py
======================================================================
ERROR: test_network_multiple_ground_1 (circuitscape.verify.verify_routines.cs_verify)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/viral/repos/Circuitscape/circuitscape/verify/verify_routines.py", line 152, in test_network_multiple_ground_1
    test_network_mg(self, 'mgNetworkVerify1')
  File "/Users/viral/repos/Circuitscape/circuitscape/verify/verify_routines.py", line 94, in test_network_mg
    _voltages = cs.compute()
  File "/Users/viral/repos/Circuitscape/circuitscape/profiler.py", line 127, in wrapper
    return func(*args)
  File "/Users/viral/repos/Circuitscape/circuitscape/compute.py", line 34, in compute
    result, solver_failed = self.compute_network() # Call module for solving arbitrary graphs (not raster grids)
  File "/Users/viral/repos/Circuitscape/circuitscape/profiler.py", line 127, in wrapper
    return func(*args)
  File "/Users/viral/repos/Circuitscape/circuitscape/compute.py", line 45, in compute_network
    focal_nodes = self.read_focal_nodes(self.options.focal_node_file)
  File "/Users/viral/repos/Circuitscape/circuitscape/compute.py", line 121, in read_focal_nodes
    focal_nodes = CSIO.load_graph(filename)
  File "/Users/viral/repos/Circuitscape/circuitscape/io.py", line 174, in load_graph
    CSIO._check_file_exists(filename)
  File "/Users/viral/repos/Circuitscape/circuitscape/io.py", line 24, in _check_file_exists
    raise RuntimeError('File "'  + filename + '" does not exist')
RuntimeError: File "(Browse for file with locations of focal points or areas)" does not exist

----------------------------------------------------------------------
Ran 47 tests in 2.302s

FAILED (errors=1)
Virals-MacBook-Pro 05:43:58 (master) ~/repos/Circuitscape$ 
tanmaykm commented 10 years ago

What you are seeing now is same as issue #38. And looks like you are working on the master branch. I think I should merge pull request #39 which has many of these fixes.

ViralBShah commented 10 years ago

Yes, please. Sorry - I somehow thought that the PR had been merged. My bad.