summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lj_matrix/__init__.py23
-rw-r--r--lj_matrix/__main__.py13
-rw-r--r--lj_matrix/c_matrix.py2
-rw-r--r--lj_matrix/do_ml.py4
-rw-r--r--lj_matrix/gauss_kernel.py2
-rw-r--r--lj_matrix/lj_matrix.py2
-rw-r--r--lj_matrix/read_qm7_data.py2
-rw-r--r--lj_matrix/version.py23
-rw-r--r--setup.py102
9 files changed, 161 insertions, 12 deletions
diff --git a/lj_matrix/__init__.py b/lj_matrix/__init__.py
index 48cd14913..47d7e5013 100644
--- a/lj_matrix/__init__.py
+++ b/lj_matrix/__init__.py
@@ -20,3 +20,26 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
+from misc import printc
+from read_qm7_data import read_qm7_data, read_nc_data, reas_db_data
+from c_matrix import c_matrix, c_matrix_multiple
+from cholesky_solve import cholesky_solve
+from do_ml import do_ml
+from frob_norm import frob_norm
+from gauss_kernel import gauss_kernel
+from lj_matrix import lj_matrix, lj_matrix_multiple
+
+# If somebody does "from package import *", this is what they will
+# be able to access:
+__all__ = ['printc',
+ 'read_qm7_data',
+ 'read_nc_data',
+ 'reas_db_data',
+ 'c_matrix',
+ 'c_matrix_multiple',
+ 'cholesky_solve',
+ 'do_ml',
+ 'frob_norm',
+ 'gauss_kernel',
+ 'lj_matrix',
+ 'lj_matrix_multiple']
diff --git a/lj_matrix/__main__.py b/lj_matrix/__main__.py
index 4e13f4995..5a0e95b94 100644
--- a/lj_matrix/__main__.py
+++ b/lj_matrix/__main__.py
@@ -24,11 +24,11 @@ import time
from multiprocessing import Process, Pipe
# import matplotlib.pyplot as plt
import pandas as pd
-from lj_matrix.misc import printc
-from lj_matrix.read_qm7_data import read_qm7_data
-from lj_matrix.c_matrix import c_matrix_multiple
-from lj_matrix.lj_matrix import lj_matrix_multiple
-from lj_matrix.do_ml import do_ml
+from misc import printc
+from read_qm7_data import read_qm7_data
+from c_matrix import c_matrix_multiple
+from lj_matrix import lj_matrix_multiple
+from do_ml import do_ml
# Test
@@ -235,4 +235,5 @@ def pl():
if __name__ == '__main__':
# ml()
- pl()
+ # pl()
+ print('OK!')
diff --git a/lj_matrix/c_matrix.py b/lj_matrix/c_matrix.py
index f40a18c68..4de711a1b 100644
--- a/lj_matrix/c_matrix.py
+++ b/lj_matrix/c_matrix.py
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import time
-from lj_matrix.misc import printc
+from misc import printc
import math
import numpy as np
from numpy.linalg import eig
diff --git a/lj_matrix/do_ml.py b/lj_matrix/do_ml.py
index acf5455f4..c88533e68 100644
--- a/lj_matrix/do_ml.py
+++ b/lj_matrix/do_ml.py
@@ -23,8 +23,8 @@ SOFTWARE.
import time
from misc import printc
import numpy as np
-from lj_matrix.gauss_kernel import gauss_kernel
-from lj_matrix.cholesky_solve import cholesky_solve
+from gauss_kernel import gauss_kernel
+from cholesky_solve import cholesky_solve
def do_ml(desc_data,
diff --git a/lj_matrix/gauss_kernel.py b/lj_matrix/gauss_kernel.py
index 5dd8e6406..0dfc65d59 100644
--- a/lj_matrix/gauss_kernel.py
+++ b/lj_matrix/gauss_kernel.py
@@ -22,7 +22,7 @@ SOFTWARE.
"""
import math
import numpy as np
-from lj_matrix.frob_norm import frob_norm
+from frob_norm import frob_norm
def gauss_kernel(X_1, X_2, sigma):
diff --git a/lj_matrix/lj_matrix.py b/lj_matrix/lj_matrix.py
index 4f63e95ca..2a8e0d956 100644
--- a/lj_matrix/lj_matrix.py
+++ b/lj_matrix/lj_matrix.py
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import time
-from lj_matrix.misc import printc
+from misc import printc
import math
import numpy as np
from numpy.linalg import eig
diff --git a/lj_matrix/read_qm7_data.py b/lj_matrix/read_qm7_data.py
index b54691fb0..068ea1a42 100644
--- a/lj_matrix/read_qm7_data.py
+++ b/lj_matrix/read_qm7_data.py
@@ -24,7 +24,7 @@ import os
import time
import numpy as np
import random
-from lj_matrix.misc import printc
+from misc import printc
# 'periodic_table_of_elements.txt' retrieved from
diff --git a/lj_matrix/version.py b/lj_matrix/version.py
new file mode 100644
index 000000000..fab58433d
--- /dev/null
+++ b/lj_matrix/version.py
@@ -0,0 +1,23 @@
+"""MIT License
+
+Copyright (c) 2019 David Luevano Alvarado
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+"""
+__version__ = '0.0.1'
diff --git a/setup.py b/setup.py
new file mode 100644
index 000000000..719ef3ce0
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,102 @@
+"""MIT License
+
+Copyright (c) 2019 David Luevano Alvarado
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+"""
+# This setup.py template was obtained from
+# https://github.com/navdeep-G/setup.py/blob/master/setup.py
+# ----------------------------------------------------------------------
+# Note: To use the 'upload' functionality of this file, you must:
+# $ pipenv install twine --dev
+
+import io
+import os
+
+from setuptools import find_packages, setup
+
+from lj_matrix.version import __version__
+
+# Package meta-data.
+NAME = 'lj_matrix'
+DESCRIPTION = 'A Lennard Jones matrix exploration.'
+URL = 'https://github.com/luevano/lj_matrix'
+EMAIL = 'a301436@uach.mx'
+AUTHOR = 'David Luevano Alvarado'
+REQUIRES_PYTHON = '>=3.7'
+VERSION = __version__
+# VERSION = '0.0.1'
+
+# What packages are required for this module to be executed?
+REQUIRED = [
+ # 'requests', 'maya', 'records',
+]
+
+# What packages are optional?
+EXTRAS = {
+ # 'fancy feature': ['django'],
+}
+
+# The rest you shouldn't have to touch too much :)
+# ------------------------------------------------
+# Except, perhaps the License and Trove Classifiers!
+# If you do change the License, remember to change
+# the Trove Classifier for that!
+
+here = os.path.abspath(os.path.dirname(__file__))
+
+# Import the README and use it as the long-description.
+# Note: this will only work if 'README.md'
+# is present in your MANIFEST.in file!
+try:
+ with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
+ long_description = '\n' + f.read()
+except FileNotFoundError:
+ long_description = DESCRIPTION
+
+# Where the magic happens:
+setup(
+ name=NAME,
+ version=VERSION,
+ description=DESCRIPTION,
+ long_description=long_description,
+ long_description_content_type='text/markdown',
+ author=AUTHOR,
+ author_email=EMAIL,
+ python_requires=REQUIRES_PYTHON,
+ url=URL,
+ packages=find_packages(exclude=["tests",
+ "*.tests",
+ "*.tests.*",
+ "tests.*"]),
+ # If your package is a single module, use this instead of 'packages':
+ # py_modules=['mypackage'],
+ install_requires=REQUIRED,
+ extras_require=EXTRAS,
+ include_package_data=True,
+ license='MIT',
+ classifiers=[
+ # Trove classifiers
+ # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
+ 'License :: OSI Approved :: MIT License',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.7'
+ ]
+)