andompesta / ComE

Implementation of ComE algorithm
59 stars 32 forks source link

I have the trouble "name '__current_graph' is not defined" in function "_write_walks_to_disk(agrs)" #3

Open Hua233 opened 5 years ago

Hua233 commented 5 years ago

when i use the function "_write_walks_to_disk(args)", the terminal will hint "name '__current_graph' is not defined". I wonder if global variables cannot be invoked in the process.

ghost commented 5 years ago

I also encountered this problem. Have you solved it?

etsoukanara commented 4 years ago

Same problem (Windows10). Can anybody help with this?

Update:

Steps I followed and worked for me:

  1. In comE-master: conda env create -f env.yml removing packages related with linux

  2. Add following block of code to "cython_utils.py" under the line from distutils.core import setup:

    try:
    from setuptools import setup
    from setuptools import Extension
    except ImportError:
    from distutils.core import setup
    from distutils.extension import Extension
  3. python cython_utils.py build_ext --inplace

  4. In file "util/graph_utils.py" line 13 add ThreadPoolExecutorfunction: from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor and in def write_walks_to_disk replace ProcessPoolExecutorwith ThreadPoolExecutorin lines 146, 150.

Hope that helps!

ChenglongMa commented 2 years ago

I think we need to avoid the global variables __current_graph and __vertex2str.

Here is my solution. I've created a pull request to fix this.