From de57d5fe9741f494a5858f62426455b60a83b7e8 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Mon, 31 Mar 2025 11:35:15 +0200 Subject: [PATCH] Refactoring --- Angle.py => LinearAlgebra/Angle.py | 10 ++++++++- Direction.py => LinearAlgebra/Direction.py | 0 Float.py => LinearAlgebra/Float.py | 0 Quaternion.py => LinearAlgebra/Quaternion.py | 0 Spherical.py => LinearAlgebra/Spherical.py | 0 SwingTwist.py => LinearAlgebra/SwingTwist.py | 0 Vector.py => LinearAlgebra/Vector.py | 0 __init__.py => LinearAlgebra/__init__.py | 0 setup.py | 22 ++++++++++++++++++++ 9 files changed, 31 insertions(+), 1 deletion(-) rename Angle.py => LinearAlgebra/Angle.py (97%) rename Direction.py => LinearAlgebra/Direction.py (100%) rename Float.py => LinearAlgebra/Float.py (100%) rename Quaternion.py => LinearAlgebra/Quaternion.py (100%) rename Spherical.py => LinearAlgebra/Spherical.py (100%) rename SwingTwist.py => LinearAlgebra/SwingTwist.py (100%) rename Vector.py => LinearAlgebra/Vector.py (100%) rename __init__.py => LinearAlgebra/__init__.py (100%) create mode 100644 setup.py diff --git a/Angle.py b/LinearAlgebra/Angle.py similarity index 97% rename from Angle.py rename to LinearAlgebra/Angle.py index bd127d9..3b37d50 100644 --- a/Angle.py +++ b/LinearAlgebra/Angle.py @@ -1,9 +1,17 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0.If a copy of the MPL was not distributed with this # file, You can obtain one at https ://mozilla.org/MPL/2.0/. +import sys +import os + +# Make the parent directory (root of the package) discoverable +package_directory = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, package_directory) import math -from .Float import * +import importlib +#from Float import * +importlib.import_module("Float") # This is in fact AngleSingle class Angle: diff --git a/Direction.py b/LinearAlgebra/Direction.py similarity index 100% rename from Direction.py rename to LinearAlgebra/Direction.py diff --git a/Float.py b/LinearAlgebra/Float.py similarity index 100% rename from Float.py rename to LinearAlgebra/Float.py diff --git a/Quaternion.py b/LinearAlgebra/Quaternion.py similarity index 100% rename from Quaternion.py rename to LinearAlgebra/Quaternion.py diff --git a/Spherical.py b/LinearAlgebra/Spherical.py similarity index 100% rename from Spherical.py rename to LinearAlgebra/Spherical.py diff --git a/SwingTwist.py b/LinearAlgebra/SwingTwist.py similarity index 100% rename from SwingTwist.py rename to LinearAlgebra/SwingTwist.py diff --git a/Vector.py b/LinearAlgebra/Vector.py similarity index 100% rename from Vector.py rename to LinearAlgebra/Vector.py diff --git a/__init__.py b/LinearAlgebra/__init__.py similarity index 100% rename from __init__.py rename to LinearAlgebra/__init__.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e13bcb3 --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +from setuptools import setup, find_packages + +setup( + name='LinearAlgebra', + version='0.3.0', + packages=find_packages(), + install_requires=[ + # List your library dependencies here + ], + author='Your Name', + author_email='your.email@example.com', + description='A brief description of your library', + long_description=open('README.md').read(), + long_description_content_type='text/markdown', + url='https://github.com/yourusername/your_library', + classifiers=[ + 'Programming Language :: Python :: 3', + 'License :: OSI Approved :: MPL2.0 License', + 'Operating System :: OS Independent', + ], + python_requires='>=3.6', +)