GGiecold-zz / Cluster_Ensembles

A package for combining multiple partitions into a consolidated clustering. The combinatorial optimization problem of obtaining such a consensus clustering is reformulated in terms of approximation algorithms for graph or hyper-graph partitioning.
MIT License
69 stars 43 forks source link

memory() function is linux-specific #3

Closed BDannowitz closed 8 years ago

BDannowitz commented 8 years ago

I can't speak for Windows, but as far as OS X goes, the only barrier to using this module is the 'memory' function, which looks to /proc/meminfo, which only exists in *nix systems. I've fixed this for myself by just hard-coding a very large number for my free memory, but there's probably a good cross-platform solution that could be implemented, if you were interested.

Perhaps a look into psutil (https://github.com/giampaolo/psutil) might be a good cross-platform solution?

Example:

psutil.phymem_usage() usage(total=4153868288, used=2854199296, free=1299668992, percent=34.6)

GGiecold-zz commented 8 years ago

Thank you for raising this issue. Your contribution to enhancing "Cluster_Ensembles" would be most welcome in the form of a pull request. I have used "psutil" on various occasions (e.g. as a dependency of "Concurrent_AP") and your suggestion of using the "phymem_usage" function is spot-on.

With kind regards,

Gregory