Skip to content

Commit c253e5b

Browse files
committed
Merge branch 'release/1.1.0'
Related with #11 and #9
2 parents 7c90c19 + 979422a commit c253e5b

File tree

4 files changed

+66
-6
lines changed

4 files changed

+66
-6
lines changed

emate/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
try:
88
import cupy as cp
99
except:
10-
print("Warning: Cupy package not found")
10+
print("Warning: CUPy package not found")
1111

12-
__version__ = "1.0.4"
13-
__license__ = ""
12+
__version__ = "1.1.0"
13+
__license__ = "MIT"
1414
__author__ = "Bruno Messias; Thomas K Peron"
1515
__author_email__ = "[email protected]"
1616
__name__ = "eMaTe"

requiriments_cpu.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy==1.19.0
2+
scipy==1.5.0
3+
tensorflow==1.15.3

requiriments_gpu.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy==1.19.0
2+
scipy==1.5.0
3+
tensorflow-gpu==1.15.2

setup.py

+57-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,73 @@
11
from setuptools import setup, find_packages
2+
import ctypes
23

34

5+
def checkCUDAisAvailable():
6+
"""
7+
This function check if any of this possible libs are available.
8+
see https://gist.github.com/f0k/63a664160d016a491b2cbea15913d549
9+
10+
Returns:
11+
--------
12+
libsOk : bool
13+
If True then CUDA is available
14+
"""
15+
# some possible lib names
16+
libnames = ('libcuda.so', 'libcuda.dylib', 'cuda.dll')
17+
libsOk = True
18+
for libname in libnames:
19+
try:
20+
cuda = ctypes.CDLL(libname)
21+
except OSError:
22+
continue
23+
else:
24+
break
25+
else:
26+
libsOk = False
27+
return libsOk
28+
29+
def getRequirements():
30+
"""
31+
This function it's used in order to get the package names. Which
32+
depends on the libs available in the machine.
33+
34+
Return:
35+
-------
36+
conditionalRequirements: list
37+
A list of strings containing the pip pkgs.
38+
"""
39+
cudaLibsOk = checkCUDAisAvailable()
40+
41+
conditionalRequirements = []
42+
if cudaLibsOk:
43+
conditionalRequirements += ["tensorflow-gpu==1.15.3", ]
44+
else:
45+
print("\n CUDA it's not available in your machine.")
46+
print(" You won't be able to use the GPU support.\n")
47+
conditionalRequirements += ["tensorflow==1.15.3", ]
48+
49+
return conditionalRequirements
50+
51+
conditionalRequirements = getRequirements()
52+
install_requires = ["scipy", "numpy"] + conditionalRequirements
53+
454
with open("README.md", "r") as f:
555
README_TEXT = f.read()
656

757
setup(
858
name="emate",
9-
version="v1.0.4",
59+
version="v1.1.0",
1060
packages=find_packages(exclude=["build", ]),
1161
long_description=README_TEXT,
1262
long_description_content_type="text/markdown",
13-
install_requires=["tensorflow==1.15.0", "scipy", "numpy"],
63+
install_requires=install_requires,
1464
include_package_data=True,
1565
license="MIT",
16-
description="",
66+
description="""eMaTe can run in both CPU and GPU and can
67+
estimate the spectral density and related trace functions,
68+
such as entropy and Estrada index, even in matrices
69+
(directed or undirected graphs) with
70+
million of nodes.""",
1771
author_email="[email protected]",
1872
author="Bruno Messias; Thomas K Peron",
1973
download_url="https://github.com/stdogpkg/emate/archive/v1.0.4.tar.gz",

0 commit comments

Comments
 (0)