lisette-espin/mrqap-python

How to solve the question that resource module is not useful in window ?

yuliangru opened this issue · 2 comments

Hi Lisette,

I am using python 3.7 in windows environment, however the resource module is not working, I don't know how to solve it, the information I checked shows that resource can only be run in Unix.
Also, is the MRQAP result calculated by this code consistent with UCINET?

Best regards,
yuliangru

Hi @yuliangru,

The resource module is there only for the profiling (to log the memory usage).
So, you can comment it out all over since it is not used to run MRQAP.

You can either do this in libs/profiling.py
68. self.mem_resource[key] = None #resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / rusage_denom

or this in libs/mrqap.py
17. #from libs.profiling import Profiling
56. self.memory = None #memory if memory is not None else Profiling() # to track memory usage
77. return #self.memory.check_memory(key)
89. key = None #self.npermutations if self.memory.perm else self.n

As for the results, when I coded this, I followed some examples from a book.
Those examples were run in UCINET (using the graphs from data) and the results using my code matched.
Unfortunately, I don't remember what book it was :-/

Hi @lisette-espin ,

Thank you for your answer, and it works well!

Best regards,
yuliangru