From c8f3925675656315f7560e57f9667276a847cd70 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Tue, 6 Dec 2022 22:59:41 -0300 Subject: [PATCH] Adds setup.py --- .gitignore | 6 ++++-- setup.py | 35 +++++++++++++++++++++++++++++++++++ test/test_process.py | 24 ++++++++++++------------ 3 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 5c48bf2..313bdf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ -*.pyc +build/ .vscode .idea/ +*.pyc +*.so *.c -*.so +yoshi_seals.egg-info/ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2bcd262 --- /dev/null +++ b/setup.py @@ -0,0 +1,35 @@ +import setuptools +import os + +__name = "yoshi_seals" + +__version_sufix = os.environ.get('VERSION_SUFIX') +if not __version_sufix: + __version_sufix = "dev" + +__version = f"2.0.{__version_sufix}" + +with open("README.md", "r") as fh: + long_description = fh.read() + +setuptools.setup( + name=__name, + version=__version, + author="Vitor Hideyoshi", + author_email="vitor.h.n.batista@gmail.com", + description="Numeric Calculus python module in the topic of Linear Algebra", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/HideyoshiNakazone/Seals-NumericCalculus.git", + packages=setuptools.find_packages(), + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "Operating System :: OS Independent" + ], + python_requires='>=3.6', + install_requires=[ + 'numpy', + 'pandas', + ], +) diff --git a/test/test_process.py b/test/test_process.py index cdfc267..4c9b94a 100644 --- a/test/test_process.py +++ b/test/test_process.py @@ -54,13 +54,13 @@ class TestProcess(unittest.TestCase): ps.vstack(a, b) def test_gauss(self): - a = np.array(([4., 3.], [3., 2.])) - b = np.array(([1.], [1.])) + a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.])) + b = np.array(([44.], [128.], [214.])) matrix = ps.gauss(a, b) - expected_matrix = np.array([[1.], [-1.]]) + expected_matrix = np.array([[-8.], [6.], [2.]]) - npt.assert_array_equal(matrix, expected_matrix) + npt.assert_almost_equal(matrix, expected_matrix) def test_cholesky(self): a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.])) @@ -72,19 +72,19 @@ class TestProcess(unittest.TestCase): npt.assert_almost_equal(matrix, expected_matrix) def test_decomposition(self): - a = np.array(([4., 3.], [3., 2.])) - b = np.array(([1.], [1.])) + a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.])) + b = np.array(([44.], [128.], [214.])) matrix = ps.decomposition(a, b) - expected_matrix = np.array([[1.], [-1.]]) + expected_matrix = np.array([[-8.], [6.], [2.]]) - npt.assert_array_equal(matrix, expected_matrix) + npt.assert_almost_equal(matrix, expected_matrix) def test_cramer(self): - a = np.array(([4., 3.], [3., 2.])) - b = np.array(([1.], [1.])) + a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.])) + b = np.array(([44.], [128.], [214.])) matrix = ps.cramer(a, b) - expected_matrix = np.array([[1.], [-1.]]) + expected_matrix = np.array([[-8.], [6.], [2.]]) - npt.assert_array_equal(matrix, expected_matrix) + npt.assert_almost_equal(matrix, expected_matrix)